From f3f4b3b02f3d9679060b75c764f65bcfaf95519e Mon Sep 17 00:00:00 2001 From: Zed <601306339@qq.com> Date: Wed, 20 Oct 2021 11:33:37 +0800 Subject: [PATCH] del useless version --- .../network/_network_management_client.py | 8431 ---------------- .../mgmt/network/v2017_08_01/__init__.py | 19 - .../network/v2017_08_01/_configuration.py | 70 - .../mgmt/network/v2017_08_01/_metadata.json | 154 - .../v2017_08_01/_network_management_client.py | 255 - .../mgmt/network/v2017_08_01/_version.py | 9 - .../mgmt/network/v2017_08_01/aio/__init__.py | 10 - .../network/v2017_08_01/aio/_configuration.py | 66 - .../aio/_network_management_client.py | 248 - .../v2017_08_01/aio/operations/__init__.py | 81 - .../_application_gateways_operations.py | 1027 -- ..._available_endpoint_services_operations.py | 112 - .../_bgp_service_communities_operations.py | 108 - .../_default_security_rules_operations.py | 178 - ...route_circuit_authorizations_operations.py | 429 - ...press_route_circuit_peerings_operations.py | 429 - .../_express_route_circuits_operations.py | 985 -- ...ress_route_service_providers_operations.py | 108 - .../_inbound_nat_rules_operations.py | 434 - ...lancer_backend_address_pools_operations.py | 178 - ...r_frontend_ip_configurations_operations.py | 178 - ...alancer_load_balancing_rules_operations.py | 178 - ..._balancer_network_interfaces_operations.py | 116 - .../_load_balancer_probes_operations.py | 178 - .../operations/_load_balancers_operations.py | 477 - .../_local_network_gateways_operations.py | 406 - ..._interface_ip_configurations_operations.py | 178 - ...ork_interface_load_balancers_operations.py | 116 - .../_network_interfaces_operations.py | 933 -- .../_network_management_client_operations.py | 80 - .../_network_security_groups_operations.py | 478 - .../_network_watchers_operations.py | 1505 --- .../operations/_packet_captures_operations.py | 662 -- .../_public_ip_addresses_operations.py | 717 -- .../_route_filter_rules_operations.py | 561 -- .../operations/_route_filters_operations.py | 602 -- .../operations/_route_tables_operations.py | 477 - .../aio/operations/_routes_operations.py | 428 - .../operations/_security_rules_operations.py | 429 - .../aio/operations/_subnets_operations.py | 433 - .../aio/operations/_usages_operations.py | 112 - ..._network_gateway_connections_operations.py | 732 -- .../_virtual_network_gateways_operations.py | 1340 --- .../_virtual_network_peerings_operations.py | 429 - .../_virtual_networks_operations.py | 614 -- .../network/v2017_08_01/models/__init__.py | 717 -- .../network/v2017_08_01/models/_models.py | 7796 --------------- .../network/v2017_08_01/models/_models_py3.py | 8826 ----------------- .../_network_management_client_enums.py | 623 -- .../v2017_08_01/operations/__init__.py | 81 - .../_application_gateways_operations.py | 1048 -- ..._available_endpoint_services_operations.py | 117 - .../_bgp_service_communities_operations.py | 113 - .../_default_security_rules_operations.py | 184 - ...route_circuit_authorizations_operations.py | 439 - ...press_route_circuit_peerings_operations.py | 439 - .../_express_route_circuits_operations.py | 1004 -- ...ress_route_service_providers_operations.py | 113 - .../_inbound_nat_rules_operations.py | 444 - ...lancer_backend_address_pools_operations.py | 184 - ...r_frontend_ip_configurations_operations.py | 184 - ...alancer_load_balancing_rules_operations.py | 184 - ..._balancer_network_interfaces_operations.py | 121 - .../_load_balancer_probes_operations.py | 184 - .../operations/_load_balancers_operations.py | 488 - .../_local_network_gateways_operations.py | 416 - ..._interface_ip_configurations_operations.py | 184 - ...ork_interface_load_balancers_operations.py | 121 - .../_network_interfaces_operations.py | 951 -- .../_network_management_client_operations.py | 85 - .../_network_security_groups_operations.py | 489 - .../_network_watchers_operations.py | 1532 --- .../operations/_packet_captures_operations.py | 676 -- .../_public_ip_addresses_operations.py | 731 -- .../_route_filter_rules_operations.py | 573 -- .../operations/_route_filters_operations.py | 615 -- .../operations/_route_tables_operations.py | 488 - .../operations/_routes_operations.py | 438 - .../operations/_security_rules_operations.py | 439 - .../operations/_subnets_operations.py | 443 - .../operations/_usages_operations.py | 117 - ..._network_gateway_connections_operations.py | 747 -- .../_virtual_network_gateways_operations.py | 1365 --- .../_virtual_network_peerings_operations.py | 439 - .../_virtual_networks_operations.py | 627 -- .../azure/mgmt/network/v2017_08_01/py.typed | 1 - 86 files changed, 60456 deletions(-) delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/__init__.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_configuration.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_metadata.json delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_network_management_client.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_version.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/__init__.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_configuration.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_network_management_client.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/__init__.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_application_gateways_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_available_endpoint_services_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_bgp_service_communities_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_default_security_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_authorizations_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_peerings_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuits_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_service_providers_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_inbound_nat_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_network_interfaces_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_probes_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancers_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_local_network_gateways_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_ip_configurations_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_load_balancers_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interfaces_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_management_client_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_security_groups_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_watchers_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_packet_captures_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_public_ip_addresses_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filter_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filters_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_tables_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_routes_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_security_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_subnets_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_usages_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateway_connections_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateways_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_peerings_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_networks_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/__init__.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_models.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_models_py3.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_network_management_client_enums.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/__init__.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_application_gateways_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_available_endpoint_services_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_bgp_service_communities_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_default_security_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_authorizations_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_peerings_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuits_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_service_providers_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_inbound_nat_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_backend_address_pools_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_load_balancing_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_network_interfaces_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_probes_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancers_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_local_network_gateways_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_ip_configurations_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_load_balancers_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interfaces_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_management_client_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_security_groups_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_watchers_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_packet_captures_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_public_ip_addresses_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filter_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filters_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_tables_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_routes_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_security_rules_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_subnets_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_usages_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateway_connections_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateways_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_peerings_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_networks_operations.py delete mode 100644 sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/py.typed diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py deleted file mode 100644 index 8636a5e926d3..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/_network_management_client.py +++ /dev/null @@ -1,8431 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from azure.profiles import KnownProfiles, ProfileDefinition -from azure.profiles.multiapiclient import MultiApiClientMixin -from msrest import Deserializer, Serializer - -from ._configuration import NetworkManagementClientConfiguration -from ._operations_mixin import NetworkManagementClientOperationsMixin - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -class _SDKClient(object): - def __init__(self, *args, **kwargs): - """This is a fake class to support current implemetation of MultiApiClientMixin." - Will be removed in final version of multiapi azure-core based client - """ - pass - -class NetworkManagementClient(NetworkManagementClientOperationsMixin, MultiApiClientMixin, _SDKClient): - """Network Client. - - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - :type subscription_id: str - :param api_version: API version to use if no profile is provided, or if missing in profile. - :type api_version: str - :param base_url: Service URL - :type base_url: str - :param profile: A profile definition, from KnownProfiles to dict. - :type profile: azure.profiles.KnownProfiles - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - DEFAULT_API_VERSION = '2021-03-01' - _PROFILE_TAG = "azure.mgmt.network.NetworkManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - 'firewall_policy_rule_groups': '2020-04-01', - 'interface_endpoints': '2019-02-01', - 'p2_svpn_server_configurations': '2019-07-01', - }}, - _PROFILE_TAG + " latest" - ) - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - api_version=None, # type: Optional[str] - base_url=None, # type: Optional[str] - profile=KnownProfiles.default, # type: KnownProfiles - **kwargs # type: Any - ): - if not base_url: - base_url = 'https://management.azure.com' - self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(NetworkManagementClient, self).__init__( - api_version=api_version, - profile=profile - ) - - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: - - * 2015-06-15: :mod:`v2015_06_15.models` - * 2016-09-01: :mod:`v2016_09_01.models` - * 2016-12-01: :mod:`v2016_12_01.models` - * 2017-03-01: :mod:`v2017_03_01.models` - * 2017-06-01: :mod:`v2017_06_01.models` - * 2017-08-01: :mod:`v2017_08_01.models` - * 2017-09-01: :mod:`v2017_09_01.models` - * 2017-10-01: :mod:`v2017_10_01.models` - * 2017-11-01: :mod:`v2017_11_01.models` - * 2018-01-01: :mod:`v2018_01_01.models` - * 2018-02-01: :mod:`v2018_02_01.models` - * 2018-04-01: :mod:`v2018_04_01.models` - * 2018-06-01: :mod:`v2018_06_01.models` - * 2018-07-01: :mod:`v2018_07_01.models` - * 2018-08-01: :mod:`v2018_08_01.models` - * 2018-10-01: :mod:`v2018_10_01.models` - * 2018-11-01: :mod:`v2018_11_01.models` - * 2018-12-01: :mod:`v2018_12_01.models` - * 2019-02-01: :mod:`v2019_02_01.models` - * 2019-04-01: :mod:`v2019_04_01.models` - * 2019-06-01: :mod:`v2019_06_01.models` - * 2019-07-01: :mod:`v2019_07_01.models` - * 2019-08-01: :mod:`v2019_08_01.models` - * 2019-09-01: :mod:`v2019_09_01.models` - * 2019-11-01: :mod:`v2019_11_01.models` - * 2019-12-01: :mod:`v2019_12_01.models` - * 2020-03-01: :mod:`v2020_03_01.models` - * 2020-04-01: :mod:`v2020_04_01.models` - * 2020-05-01: :mod:`v2020_05_01.models` - * 2020-06-01: :mod:`v2020_06_01.models` - * 2020-07-01: :mod:`v2020_07_01.models` - * 2020-08-01: :mod:`v2020_08_01.models` - * 2020-11-01: :mod:`v2020_11_01.models` - * 2021-02-01: :mod:`v2021_02_01.models` - * 2021-03-01: :mod:`v2021_03_01.models` - """ - if api_version == '2015-06-15': - from .v2015_06_15 import models - return models - elif api_version == '2016-09-01': - from .v2016_09_01 import models - return models - elif api_version == '2016-12-01': - from .v2016_12_01 import models - return models - elif api_version == '2017-03-01': - from .v2017_03_01 import models - return models - elif api_version == '2017-06-01': - from .v2017_06_01 import models - return models - elif api_version == '2017-08-01': - from .v2017_08_01 import models - return models - elif api_version == '2017-09-01': - from .v2017_09_01 import models - return models - elif api_version == '2017-10-01': - from .v2017_10_01 import models - return models - elif api_version == '2017-11-01': - from .v2017_11_01 import models - return models - elif api_version == '2018-01-01': - from .v2018_01_01 import models - return models - elif api_version == '2018-02-01': - from .v2018_02_01 import models - return models - elif api_version == '2018-04-01': - from .v2018_04_01 import models - return models - elif api_version == '2018-06-01': - from .v2018_06_01 import models - return models - elif api_version == '2018-07-01': - from .v2018_07_01 import models - return models - elif api_version == '2018-08-01': - from .v2018_08_01 import models - return models - elif api_version == '2018-10-01': - from .v2018_10_01 import models - return models - elif api_version == '2018-11-01': - from .v2018_11_01 import models - return models - elif api_version == '2018-12-01': - from .v2018_12_01 import models - return models - elif api_version == '2019-02-01': - from .v2019_02_01 import models - return models - elif api_version == '2019-04-01': - from .v2019_04_01 import models - return models - elif api_version == '2019-06-01': - from .v2019_06_01 import models - return models - elif api_version == '2019-07-01': - from .v2019_07_01 import models - return models - elif api_version == '2019-08-01': - from .v2019_08_01 import models - return models - elif api_version == '2019-09-01': - from .v2019_09_01 import models - return models - elif api_version == '2019-11-01': - from .v2019_11_01 import models - return models - elif api_version == '2019-12-01': - from .v2019_12_01 import models - return models - elif api_version == '2020-03-01': - from .v2020_03_01 import models - return models - elif api_version == '2020-04-01': - from .v2020_04_01 import models - return models - elif api_version == '2020-05-01': - from .v2020_05_01 import models - return models - elif api_version == '2020-06-01': - from .v2020_06_01 import models - return models - elif api_version == '2020-07-01': - from .v2020_07_01 import models - return models - elif api_version == '2020-08-01': - from .v2020_08_01 import models - return models - elif api_version == '2020-11-01': - from .v2020_11_01 import models - return models - elif api_version == '2021-02-01': - from .v2021_02_01 import models - return models - elif api_version == '2021-03-01': - from .v2021_03_01 import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def application_gateway_private_endpoint_connections(self): - """Instance depends on the API version: - - * 2020-05-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` - * 2020-06-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` - * 2020-07-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` - * 2020-08-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` - * 2020-11-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` - * 2021-02-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` - * 2021-03-01: :class:`ApplicationGatewayPrivateEndpointConnectionsOperations` - """ - api_version = self._get_api_version('application_gateway_private_endpoint_connections') - if api_version == '2020-05-01': - from .v2020_05_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ApplicationGatewayPrivateEndpointConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'application_gateway_private_endpoint_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def application_gateway_private_link_resources(self): - """Instance depends on the API version: - - * 2020-05-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` - * 2020-06-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` - * 2020-07-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` - * 2020-08-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` - * 2020-11-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` - * 2021-02-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` - * 2021-03-01: :class:`ApplicationGatewayPrivateLinkResourcesOperations` - """ - api_version = self._get_api_version('application_gateway_private_link_resources') - if api_version == '2020-05-01': - from .v2020_05_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ApplicationGatewayPrivateLinkResourcesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'application_gateway_private_link_resources'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def application_gateways(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ApplicationGatewaysOperations` - * 2016-09-01: :class:`ApplicationGatewaysOperations` - * 2016-12-01: :class:`ApplicationGatewaysOperations` - * 2017-03-01: :class:`ApplicationGatewaysOperations` - * 2017-06-01: :class:`ApplicationGatewaysOperations` - * 2017-08-01: :class:`ApplicationGatewaysOperations` - * 2017-09-01: :class:`ApplicationGatewaysOperations` - * 2017-10-01: :class:`ApplicationGatewaysOperations` - * 2017-11-01: :class:`ApplicationGatewaysOperations` - * 2018-01-01: :class:`ApplicationGatewaysOperations` - * 2018-02-01: :class:`ApplicationGatewaysOperations` - * 2018-04-01: :class:`ApplicationGatewaysOperations` - * 2018-06-01: :class:`ApplicationGatewaysOperations` - * 2018-07-01: :class:`ApplicationGatewaysOperations` - * 2018-08-01: :class:`ApplicationGatewaysOperations` - * 2018-10-01: :class:`ApplicationGatewaysOperations` - * 2018-11-01: :class:`ApplicationGatewaysOperations` - * 2018-12-01: :class:`ApplicationGatewaysOperations` - * 2019-02-01: :class:`ApplicationGatewaysOperations` - * 2019-04-01: :class:`ApplicationGatewaysOperations` - * 2019-06-01: :class:`ApplicationGatewaysOperations` - * 2019-07-01: :class:`ApplicationGatewaysOperations` - * 2019-08-01: :class:`ApplicationGatewaysOperations` - * 2019-09-01: :class:`ApplicationGatewaysOperations` - * 2019-11-01: :class:`ApplicationGatewaysOperations` - * 2019-12-01: :class:`ApplicationGatewaysOperations` - * 2020-03-01: :class:`ApplicationGatewaysOperations` - * 2020-04-01: :class:`ApplicationGatewaysOperations` - * 2020-05-01: :class:`ApplicationGatewaysOperations` - * 2020-06-01: :class:`ApplicationGatewaysOperations` - * 2020-07-01: :class:`ApplicationGatewaysOperations` - * 2020-08-01: :class:`ApplicationGatewaysOperations` - * 2020-11-01: :class:`ApplicationGatewaysOperations` - * 2021-02-01: :class:`ApplicationGatewaysOperations` - * 2021-03-01: :class:`ApplicationGatewaysOperations` - """ - api_version = self._get_api_version('application_gateways') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ApplicationGatewaysOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ApplicationGatewaysOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'application_gateways'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def application_security_groups(self): - """Instance depends on the API version: - - * 2017-09-01: :class:`ApplicationSecurityGroupsOperations` - * 2017-10-01: :class:`ApplicationSecurityGroupsOperations` - * 2017-11-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-01-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-02-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-04-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-06-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-07-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-08-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-10-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-11-01: :class:`ApplicationSecurityGroupsOperations` - * 2018-12-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-02-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-04-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-06-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-07-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-08-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-09-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-11-01: :class:`ApplicationSecurityGroupsOperations` - * 2019-12-01: :class:`ApplicationSecurityGroupsOperations` - * 2020-03-01: :class:`ApplicationSecurityGroupsOperations` - * 2020-04-01: :class:`ApplicationSecurityGroupsOperations` - * 2020-05-01: :class:`ApplicationSecurityGroupsOperations` - * 2020-06-01: :class:`ApplicationSecurityGroupsOperations` - * 2020-07-01: :class:`ApplicationSecurityGroupsOperations` - * 2020-08-01: :class:`ApplicationSecurityGroupsOperations` - * 2020-11-01: :class:`ApplicationSecurityGroupsOperations` - * 2021-02-01: :class:`ApplicationSecurityGroupsOperations` - * 2021-03-01: :class:`ApplicationSecurityGroupsOperations` - """ - api_version = self._get_api_version('application_security_groups') - if api_version == '2017-09-01': - from .v2017_09_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ApplicationSecurityGroupsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ApplicationSecurityGroupsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'application_security_groups'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def available_delegations(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`AvailableDelegationsOperations` - * 2018-10-01: :class:`AvailableDelegationsOperations` - * 2018-11-01: :class:`AvailableDelegationsOperations` - * 2018-12-01: :class:`AvailableDelegationsOperations` - * 2019-02-01: :class:`AvailableDelegationsOperations` - * 2019-04-01: :class:`AvailableDelegationsOperations` - * 2019-06-01: :class:`AvailableDelegationsOperations` - * 2019-07-01: :class:`AvailableDelegationsOperations` - * 2019-08-01: :class:`AvailableDelegationsOperations` - * 2019-09-01: :class:`AvailableDelegationsOperations` - * 2019-11-01: :class:`AvailableDelegationsOperations` - * 2019-12-01: :class:`AvailableDelegationsOperations` - * 2020-03-01: :class:`AvailableDelegationsOperations` - * 2020-04-01: :class:`AvailableDelegationsOperations` - * 2020-05-01: :class:`AvailableDelegationsOperations` - * 2020-06-01: :class:`AvailableDelegationsOperations` - * 2020-07-01: :class:`AvailableDelegationsOperations` - * 2020-08-01: :class:`AvailableDelegationsOperations` - * 2020-11-01: :class:`AvailableDelegationsOperations` - * 2021-02-01: :class:`AvailableDelegationsOperations` - * 2021-03-01: :class:`AvailableDelegationsOperations` - """ - api_version = self._get_api_version('available_delegations') - if api_version == '2018-08-01': - from .v2018_08_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import AvailableDelegationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AvailableDelegationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'available_delegations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def available_endpoint_services(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`AvailableEndpointServicesOperations` - * 2017-08-01: :class:`AvailableEndpointServicesOperations` - * 2017-09-01: :class:`AvailableEndpointServicesOperations` - * 2017-10-01: :class:`AvailableEndpointServicesOperations` - * 2017-11-01: :class:`AvailableEndpointServicesOperations` - * 2018-01-01: :class:`AvailableEndpointServicesOperations` - * 2018-02-01: :class:`AvailableEndpointServicesOperations` - * 2018-04-01: :class:`AvailableEndpointServicesOperations` - * 2018-06-01: :class:`AvailableEndpointServicesOperations` - * 2018-07-01: :class:`AvailableEndpointServicesOperations` - * 2018-08-01: :class:`AvailableEndpointServicesOperations` - * 2018-10-01: :class:`AvailableEndpointServicesOperations` - * 2018-11-01: :class:`AvailableEndpointServicesOperations` - * 2018-12-01: :class:`AvailableEndpointServicesOperations` - * 2019-02-01: :class:`AvailableEndpointServicesOperations` - * 2019-04-01: :class:`AvailableEndpointServicesOperations` - * 2019-06-01: :class:`AvailableEndpointServicesOperations` - * 2019-07-01: :class:`AvailableEndpointServicesOperations` - * 2019-08-01: :class:`AvailableEndpointServicesOperations` - * 2019-09-01: :class:`AvailableEndpointServicesOperations` - * 2019-11-01: :class:`AvailableEndpointServicesOperations` - * 2019-12-01: :class:`AvailableEndpointServicesOperations` - * 2020-03-01: :class:`AvailableEndpointServicesOperations` - * 2020-04-01: :class:`AvailableEndpointServicesOperations` - * 2020-05-01: :class:`AvailableEndpointServicesOperations` - * 2020-06-01: :class:`AvailableEndpointServicesOperations` - * 2020-07-01: :class:`AvailableEndpointServicesOperations` - * 2020-08-01: :class:`AvailableEndpointServicesOperations` - * 2020-11-01: :class:`AvailableEndpointServicesOperations` - * 2021-02-01: :class:`AvailableEndpointServicesOperations` - * 2021-03-01: :class:`AvailableEndpointServicesOperations` - """ - api_version = self._get_api_version('available_endpoint_services') - if api_version == '2017-06-01': - from .v2017_06_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import AvailableEndpointServicesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AvailableEndpointServicesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'available_endpoint_services'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def available_private_endpoint_types(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2019-06-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2019-07-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2019-08-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2019-09-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2019-11-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2019-12-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2020-03-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2020-04-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2020-05-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2020-06-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2020-07-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2020-08-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2020-11-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2021-02-01: :class:`AvailablePrivateEndpointTypesOperations` - * 2021-03-01: :class:`AvailablePrivateEndpointTypesOperations` - """ - api_version = self._get_api_version('available_private_endpoint_types') - if api_version == '2019-04-01': - from .v2019_04_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AvailablePrivateEndpointTypesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'available_private_endpoint_types'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def available_resource_group_delegations(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2018-10-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2018-11-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2018-12-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-02-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-04-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-06-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-07-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-08-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-09-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-11-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2019-12-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2020-03-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2020-04-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2020-05-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2020-06-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2020-07-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2020-08-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2020-11-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2021-02-01: :class:`AvailableResourceGroupDelegationsOperations` - * 2021-03-01: :class:`AvailableResourceGroupDelegationsOperations` - """ - api_version = self._get_api_version('available_resource_group_delegations') - if api_version == '2018-08-01': - from .v2018_08_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AvailableResourceGroupDelegationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'available_resource_group_delegations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def available_service_aliases(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`AvailableServiceAliasesOperations` - * 2019-09-01: :class:`AvailableServiceAliasesOperations` - * 2019-11-01: :class:`AvailableServiceAliasesOperations` - * 2019-12-01: :class:`AvailableServiceAliasesOperations` - * 2020-03-01: :class:`AvailableServiceAliasesOperations` - * 2020-04-01: :class:`AvailableServiceAliasesOperations` - * 2020-05-01: :class:`AvailableServiceAliasesOperations` - * 2020-06-01: :class:`AvailableServiceAliasesOperations` - * 2020-07-01: :class:`AvailableServiceAliasesOperations` - * 2020-08-01: :class:`AvailableServiceAliasesOperations` - * 2020-11-01: :class:`AvailableServiceAliasesOperations` - * 2021-02-01: :class:`AvailableServiceAliasesOperations` - * 2021-03-01: :class:`AvailableServiceAliasesOperations` - """ - api_version = self._get_api_version('available_service_aliases') - if api_version == '2019-08-01': - from .v2019_08_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import AvailableServiceAliasesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AvailableServiceAliasesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'available_service_aliases'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def azure_firewall_fqdn_tags(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`AzureFirewallFqdnTagsOperations` - * 2018-10-01: :class:`AzureFirewallFqdnTagsOperations` - * 2018-11-01: :class:`AzureFirewallFqdnTagsOperations` - * 2018-12-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-02-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-04-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-06-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-07-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-08-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-09-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-11-01: :class:`AzureFirewallFqdnTagsOperations` - * 2019-12-01: :class:`AzureFirewallFqdnTagsOperations` - * 2020-03-01: :class:`AzureFirewallFqdnTagsOperations` - * 2020-04-01: :class:`AzureFirewallFqdnTagsOperations` - * 2020-05-01: :class:`AzureFirewallFqdnTagsOperations` - * 2020-06-01: :class:`AzureFirewallFqdnTagsOperations` - * 2020-07-01: :class:`AzureFirewallFqdnTagsOperations` - * 2020-08-01: :class:`AzureFirewallFqdnTagsOperations` - * 2020-11-01: :class:`AzureFirewallFqdnTagsOperations` - * 2021-02-01: :class:`AzureFirewallFqdnTagsOperations` - * 2021-03-01: :class:`AzureFirewallFqdnTagsOperations` - """ - api_version = self._get_api_version('azure_firewall_fqdn_tags') - if api_version == '2018-08-01': - from .v2018_08_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AzureFirewallFqdnTagsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'azure_firewall_fqdn_tags'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def azure_firewalls(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`AzureFirewallsOperations` - * 2018-06-01: :class:`AzureFirewallsOperations` - * 2018-07-01: :class:`AzureFirewallsOperations` - * 2018-08-01: :class:`AzureFirewallsOperations` - * 2018-10-01: :class:`AzureFirewallsOperations` - * 2018-11-01: :class:`AzureFirewallsOperations` - * 2018-12-01: :class:`AzureFirewallsOperations` - * 2019-02-01: :class:`AzureFirewallsOperations` - * 2019-04-01: :class:`AzureFirewallsOperations` - * 2019-06-01: :class:`AzureFirewallsOperations` - * 2019-07-01: :class:`AzureFirewallsOperations` - * 2019-08-01: :class:`AzureFirewallsOperations` - * 2019-09-01: :class:`AzureFirewallsOperations` - * 2019-11-01: :class:`AzureFirewallsOperations` - * 2019-12-01: :class:`AzureFirewallsOperations` - * 2020-03-01: :class:`AzureFirewallsOperations` - * 2020-04-01: :class:`AzureFirewallsOperations` - * 2020-05-01: :class:`AzureFirewallsOperations` - * 2020-06-01: :class:`AzureFirewallsOperations` - * 2020-07-01: :class:`AzureFirewallsOperations` - * 2020-08-01: :class:`AzureFirewallsOperations` - * 2020-11-01: :class:`AzureFirewallsOperations` - * 2021-02-01: :class:`AzureFirewallsOperations` - * 2021-03-01: :class:`AzureFirewallsOperations` - """ - api_version = self._get_api_version('azure_firewalls') - if api_version == '2018-04-01': - from .v2018_04_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import AzureFirewallsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import AzureFirewallsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'azure_firewalls'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def bastion_hosts(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`BastionHostsOperations` - * 2019-06-01: :class:`BastionHostsOperations` - * 2019-07-01: :class:`BastionHostsOperations` - * 2019-08-01: :class:`BastionHostsOperations` - * 2019-09-01: :class:`BastionHostsOperations` - * 2019-11-01: :class:`BastionHostsOperations` - * 2019-12-01: :class:`BastionHostsOperations` - * 2020-03-01: :class:`BastionHostsOperations` - * 2020-04-01: :class:`BastionHostsOperations` - * 2020-05-01: :class:`BastionHostsOperations` - * 2020-06-01: :class:`BastionHostsOperations` - * 2020-07-01: :class:`BastionHostsOperations` - * 2020-08-01: :class:`BastionHostsOperations` - * 2020-11-01: :class:`BastionHostsOperations` - * 2021-02-01: :class:`BastionHostsOperations` - * 2021-03-01: :class:`BastionHostsOperations` - """ - api_version = self._get_api_version('bastion_hosts') - if api_version == '2019-04-01': - from .v2019_04_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import BastionHostsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import BastionHostsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'bastion_hosts'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def bgp_service_communities(self): - """Instance depends on the API version: - - * 2016-12-01: :class:`BgpServiceCommunitiesOperations` - * 2017-03-01: :class:`BgpServiceCommunitiesOperations` - * 2017-06-01: :class:`BgpServiceCommunitiesOperations` - * 2017-08-01: :class:`BgpServiceCommunitiesOperations` - * 2017-09-01: :class:`BgpServiceCommunitiesOperations` - * 2017-10-01: :class:`BgpServiceCommunitiesOperations` - * 2017-11-01: :class:`BgpServiceCommunitiesOperations` - * 2018-01-01: :class:`BgpServiceCommunitiesOperations` - * 2018-02-01: :class:`BgpServiceCommunitiesOperations` - * 2018-04-01: :class:`BgpServiceCommunitiesOperations` - * 2018-06-01: :class:`BgpServiceCommunitiesOperations` - * 2018-07-01: :class:`BgpServiceCommunitiesOperations` - * 2018-08-01: :class:`BgpServiceCommunitiesOperations` - * 2018-10-01: :class:`BgpServiceCommunitiesOperations` - * 2018-11-01: :class:`BgpServiceCommunitiesOperations` - * 2018-12-01: :class:`BgpServiceCommunitiesOperations` - * 2019-02-01: :class:`BgpServiceCommunitiesOperations` - * 2019-04-01: :class:`BgpServiceCommunitiesOperations` - * 2019-06-01: :class:`BgpServiceCommunitiesOperations` - * 2019-07-01: :class:`BgpServiceCommunitiesOperations` - * 2019-08-01: :class:`BgpServiceCommunitiesOperations` - * 2019-09-01: :class:`BgpServiceCommunitiesOperations` - * 2019-11-01: :class:`BgpServiceCommunitiesOperations` - * 2019-12-01: :class:`BgpServiceCommunitiesOperations` - * 2020-03-01: :class:`BgpServiceCommunitiesOperations` - * 2020-04-01: :class:`BgpServiceCommunitiesOperations` - * 2020-05-01: :class:`BgpServiceCommunitiesOperations` - * 2020-06-01: :class:`BgpServiceCommunitiesOperations` - * 2020-07-01: :class:`BgpServiceCommunitiesOperations` - * 2020-08-01: :class:`BgpServiceCommunitiesOperations` - * 2020-11-01: :class:`BgpServiceCommunitiesOperations` - * 2021-02-01: :class:`BgpServiceCommunitiesOperations` - * 2021-03-01: :class:`BgpServiceCommunitiesOperations` - """ - api_version = self._get_api_version('bgp_service_communities') - if api_version == '2016-12-01': - from .v2016_12_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import BgpServiceCommunitiesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import BgpServiceCommunitiesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'bgp_service_communities'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def connection_monitors(self): - """Instance depends on the API version: - - * 2017-10-01: :class:`ConnectionMonitorsOperations` - * 2017-11-01: :class:`ConnectionMonitorsOperations` - * 2018-01-01: :class:`ConnectionMonitorsOperations` - * 2018-02-01: :class:`ConnectionMonitorsOperations` - * 2018-04-01: :class:`ConnectionMonitorsOperations` - * 2018-06-01: :class:`ConnectionMonitorsOperations` - * 2018-07-01: :class:`ConnectionMonitorsOperations` - * 2018-08-01: :class:`ConnectionMonitorsOperations` - * 2018-10-01: :class:`ConnectionMonitorsOperations` - * 2018-11-01: :class:`ConnectionMonitorsOperations` - * 2018-12-01: :class:`ConnectionMonitorsOperations` - * 2019-02-01: :class:`ConnectionMonitorsOperations` - * 2019-04-01: :class:`ConnectionMonitorsOperations` - * 2019-06-01: :class:`ConnectionMonitorsOperations` - * 2019-07-01: :class:`ConnectionMonitorsOperations` - * 2019-08-01: :class:`ConnectionMonitorsOperations` - * 2019-09-01: :class:`ConnectionMonitorsOperations` - * 2019-11-01: :class:`ConnectionMonitorsOperations` - * 2019-12-01: :class:`ConnectionMonitorsOperations` - * 2020-03-01: :class:`ConnectionMonitorsOperations` - * 2020-04-01: :class:`ConnectionMonitorsOperations` - * 2020-05-01: :class:`ConnectionMonitorsOperations` - * 2020-06-01: :class:`ConnectionMonitorsOperations` - * 2020-07-01: :class:`ConnectionMonitorsOperations` - * 2020-08-01: :class:`ConnectionMonitorsOperations` - * 2020-11-01: :class:`ConnectionMonitorsOperations` - * 2021-02-01: :class:`ConnectionMonitorsOperations` - * 2021-03-01: :class:`ConnectionMonitorsOperations` - """ - api_version = self._get_api_version('connection_monitors') - if api_version == '2017-10-01': - from .v2017_10_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ConnectionMonitorsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ConnectionMonitorsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'connection_monitors'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def custom_ip_prefixes(self): - """Instance depends on the API version: - - * 2020-06-01: :class:`CustomIPPrefixesOperations` - * 2020-07-01: :class:`CustomIPPrefixesOperations` - * 2020-08-01: :class:`CustomIPPrefixesOperations` - * 2020-11-01: :class:`CustomIPPrefixesOperations` - * 2021-02-01: :class:`CustomIPPrefixesOperations` - * 2021-03-01: :class:`CustomIPPrefixesOperations` - """ - api_version = self._get_api_version('custom_ip_prefixes') - if api_version == '2020-06-01': - from .v2020_06_01.operations import CustomIPPrefixesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import CustomIPPrefixesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import CustomIPPrefixesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import CustomIPPrefixesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import CustomIPPrefixesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import CustomIPPrefixesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'custom_ip_prefixes'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def ddos_custom_policies(self): - """Instance depends on the API version: - - * 2018-11-01: :class:`DdosCustomPoliciesOperations` - * 2018-12-01: :class:`DdosCustomPoliciesOperations` - * 2019-02-01: :class:`DdosCustomPoliciesOperations` - * 2019-04-01: :class:`DdosCustomPoliciesOperations` - * 2019-06-01: :class:`DdosCustomPoliciesOperations` - * 2019-07-01: :class:`DdosCustomPoliciesOperations` - * 2019-08-01: :class:`DdosCustomPoliciesOperations` - * 2019-09-01: :class:`DdosCustomPoliciesOperations` - * 2019-11-01: :class:`DdosCustomPoliciesOperations` - * 2019-12-01: :class:`DdosCustomPoliciesOperations` - * 2020-03-01: :class:`DdosCustomPoliciesOperations` - * 2020-04-01: :class:`DdosCustomPoliciesOperations` - * 2020-05-01: :class:`DdosCustomPoliciesOperations` - * 2020-06-01: :class:`DdosCustomPoliciesOperations` - * 2020-07-01: :class:`DdosCustomPoliciesOperations` - * 2020-08-01: :class:`DdosCustomPoliciesOperations` - * 2020-11-01: :class:`DdosCustomPoliciesOperations` - * 2021-02-01: :class:`DdosCustomPoliciesOperations` - * 2021-03-01: :class:`DdosCustomPoliciesOperations` - """ - api_version = self._get_api_version('ddos_custom_policies') - if api_version == '2018-11-01': - from .v2018_11_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import DdosCustomPoliciesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import DdosCustomPoliciesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ddos_custom_policies'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def ddos_protection_plans(self): - """Instance depends on the API version: - - * 2018-02-01: :class:`DdosProtectionPlansOperations` - * 2018-04-01: :class:`DdosProtectionPlansOperations` - * 2018-06-01: :class:`DdosProtectionPlansOperations` - * 2018-07-01: :class:`DdosProtectionPlansOperations` - * 2018-08-01: :class:`DdosProtectionPlansOperations` - * 2018-10-01: :class:`DdosProtectionPlansOperations` - * 2018-11-01: :class:`DdosProtectionPlansOperations` - * 2018-12-01: :class:`DdosProtectionPlansOperations` - * 2019-02-01: :class:`DdosProtectionPlansOperations` - * 2019-04-01: :class:`DdosProtectionPlansOperations` - * 2019-06-01: :class:`DdosProtectionPlansOperations` - * 2019-07-01: :class:`DdosProtectionPlansOperations` - * 2019-08-01: :class:`DdosProtectionPlansOperations` - * 2019-09-01: :class:`DdosProtectionPlansOperations` - * 2019-11-01: :class:`DdosProtectionPlansOperations` - * 2019-12-01: :class:`DdosProtectionPlansOperations` - * 2020-03-01: :class:`DdosProtectionPlansOperations` - * 2020-04-01: :class:`DdosProtectionPlansOperations` - * 2020-05-01: :class:`DdosProtectionPlansOperations` - * 2020-06-01: :class:`DdosProtectionPlansOperations` - * 2020-07-01: :class:`DdosProtectionPlansOperations` - * 2020-08-01: :class:`DdosProtectionPlansOperations` - * 2020-11-01: :class:`DdosProtectionPlansOperations` - * 2021-02-01: :class:`DdosProtectionPlansOperations` - * 2021-03-01: :class:`DdosProtectionPlansOperations` - """ - api_version = self._get_api_version('ddos_protection_plans') - if api_version == '2018-02-01': - from .v2018_02_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import DdosProtectionPlansOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import DdosProtectionPlansOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ddos_protection_plans'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def default_security_rules(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`DefaultSecurityRulesOperations` - * 2017-08-01: :class:`DefaultSecurityRulesOperations` - * 2017-09-01: :class:`DefaultSecurityRulesOperations` - * 2017-10-01: :class:`DefaultSecurityRulesOperations` - * 2017-11-01: :class:`DefaultSecurityRulesOperations` - * 2018-01-01: :class:`DefaultSecurityRulesOperations` - * 2018-02-01: :class:`DefaultSecurityRulesOperations` - * 2018-04-01: :class:`DefaultSecurityRulesOperations` - * 2018-06-01: :class:`DefaultSecurityRulesOperations` - * 2018-07-01: :class:`DefaultSecurityRulesOperations` - * 2018-08-01: :class:`DefaultSecurityRulesOperations` - * 2018-10-01: :class:`DefaultSecurityRulesOperations` - * 2018-11-01: :class:`DefaultSecurityRulesOperations` - * 2018-12-01: :class:`DefaultSecurityRulesOperations` - * 2019-02-01: :class:`DefaultSecurityRulesOperations` - * 2019-04-01: :class:`DefaultSecurityRulesOperations` - * 2019-06-01: :class:`DefaultSecurityRulesOperations` - * 2019-07-01: :class:`DefaultSecurityRulesOperations` - * 2019-08-01: :class:`DefaultSecurityRulesOperations` - * 2019-09-01: :class:`DefaultSecurityRulesOperations` - * 2019-11-01: :class:`DefaultSecurityRulesOperations` - * 2019-12-01: :class:`DefaultSecurityRulesOperations` - * 2020-03-01: :class:`DefaultSecurityRulesOperations` - * 2020-04-01: :class:`DefaultSecurityRulesOperations` - * 2020-05-01: :class:`DefaultSecurityRulesOperations` - * 2020-06-01: :class:`DefaultSecurityRulesOperations` - * 2020-07-01: :class:`DefaultSecurityRulesOperations` - * 2020-08-01: :class:`DefaultSecurityRulesOperations` - * 2020-11-01: :class:`DefaultSecurityRulesOperations` - * 2021-02-01: :class:`DefaultSecurityRulesOperations` - * 2021-03-01: :class:`DefaultSecurityRulesOperations` - """ - api_version = self._get_api_version('default_security_rules') - if api_version == '2017-06-01': - from .v2017_06_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import DefaultSecurityRulesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import DefaultSecurityRulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'default_security_rules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def dscp_configuration(self): - """Instance depends on the API version: - - * 2020-06-01: :class:`DscpConfigurationOperations` - * 2020-07-01: :class:`DscpConfigurationOperations` - * 2020-08-01: :class:`DscpConfigurationOperations` - * 2020-11-01: :class:`DscpConfigurationOperations` - * 2021-02-01: :class:`DscpConfigurationOperations` - * 2021-03-01: :class:`DscpConfigurationOperations` - """ - api_version = self._get_api_version('dscp_configuration') - if api_version == '2020-06-01': - from .v2020_06_01.operations import DscpConfigurationOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import DscpConfigurationOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import DscpConfigurationOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import DscpConfigurationOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import DscpConfigurationOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import DscpConfigurationOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'dscp_configuration'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_circuit_authorizations(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2016-09-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2016-12-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-03-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-08-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-09-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-10-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2017-11-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-01-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-02-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-07-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-08-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-10-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-11-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2018-12-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-02-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-07-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-08-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-09-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-11-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2019-12-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2020-03-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2020-04-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2020-05-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2020-06-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2020-07-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2020-08-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2020-11-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2021-02-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - * 2021-03-01: :class:`ExpressRouteCircuitAuthorizationsOperations` - """ - api_version = self._get_api_version('express_route_circuit_authorizations') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteCircuitAuthorizationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_circuit_authorizations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_circuit_connections(self): - """Instance depends on the API version: - - * 2018-02-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-04-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-06-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-07-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-08-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-10-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-11-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2018-12-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-02-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-04-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-06-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-07-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-08-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-09-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-11-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2019-12-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2020-03-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2020-04-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2020-05-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2020-06-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2020-07-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2020-08-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2020-11-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2021-02-01: :class:`ExpressRouteCircuitConnectionsOperations` - * 2021-03-01: :class:`ExpressRouteCircuitConnectionsOperations` - """ - api_version = self._get_api_version('express_route_circuit_connections') - if api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteCircuitConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_circuit_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_circuit_peerings(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ExpressRouteCircuitPeeringsOperations` - * 2016-09-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2016-12-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-03-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-06-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-08-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-09-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-10-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2017-11-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-01-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-02-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-04-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-06-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-07-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-08-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-10-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-11-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2018-12-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-02-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-04-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-06-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-07-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-08-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-09-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-11-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2019-12-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2020-03-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2020-04-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2020-05-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2020-06-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2020-07-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2020-08-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2020-11-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2021-02-01: :class:`ExpressRouteCircuitPeeringsOperations` - * 2021-03-01: :class:`ExpressRouteCircuitPeeringsOperations` - """ - api_version = self._get_api_version('express_route_circuit_peerings') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteCircuitPeeringsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_circuit_peerings'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_circuits(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ExpressRouteCircuitsOperations` - * 2016-09-01: :class:`ExpressRouteCircuitsOperations` - * 2016-12-01: :class:`ExpressRouteCircuitsOperations` - * 2017-03-01: :class:`ExpressRouteCircuitsOperations` - * 2017-06-01: :class:`ExpressRouteCircuitsOperations` - * 2017-08-01: :class:`ExpressRouteCircuitsOperations` - * 2017-09-01: :class:`ExpressRouteCircuitsOperations` - * 2017-10-01: :class:`ExpressRouteCircuitsOperations` - * 2017-11-01: :class:`ExpressRouteCircuitsOperations` - * 2018-01-01: :class:`ExpressRouteCircuitsOperations` - * 2018-02-01: :class:`ExpressRouteCircuitsOperations` - * 2018-04-01: :class:`ExpressRouteCircuitsOperations` - * 2018-06-01: :class:`ExpressRouteCircuitsOperations` - * 2018-07-01: :class:`ExpressRouteCircuitsOperations` - * 2018-08-01: :class:`ExpressRouteCircuitsOperations` - * 2018-10-01: :class:`ExpressRouteCircuitsOperations` - * 2018-11-01: :class:`ExpressRouteCircuitsOperations` - * 2018-12-01: :class:`ExpressRouteCircuitsOperations` - * 2019-02-01: :class:`ExpressRouteCircuitsOperations` - * 2019-04-01: :class:`ExpressRouteCircuitsOperations` - * 2019-06-01: :class:`ExpressRouteCircuitsOperations` - * 2019-07-01: :class:`ExpressRouteCircuitsOperations` - * 2019-08-01: :class:`ExpressRouteCircuitsOperations` - * 2019-09-01: :class:`ExpressRouteCircuitsOperations` - * 2019-11-01: :class:`ExpressRouteCircuitsOperations` - * 2019-12-01: :class:`ExpressRouteCircuitsOperations` - * 2020-03-01: :class:`ExpressRouteCircuitsOperations` - * 2020-04-01: :class:`ExpressRouteCircuitsOperations` - * 2020-05-01: :class:`ExpressRouteCircuitsOperations` - * 2020-06-01: :class:`ExpressRouteCircuitsOperations` - * 2020-07-01: :class:`ExpressRouteCircuitsOperations` - * 2020-08-01: :class:`ExpressRouteCircuitsOperations` - * 2020-11-01: :class:`ExpressRouteCircuitsOperations` - * 2021-02-01: :class:`ExpressRouteCircuitsOperations` - * 2021-03-01: :class:`ExpressRouteCircuitsOperations` - """ - api_version = self._get_api_version('express_route_circuits') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteCircuitsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteCircuitsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_circuits'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_connections(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRouteConnectionsOperations` - * 2018-10-01: :class:`ExpressRouteConnectionsOperations` - * 2018-11-01: :class:`ExpressRouteConnectionsOperations` - * 2018-12-01: :class:`ExpressRouteConnectionsOperations` - * 2019-02-01: :class:`ExpressRouteConnectionsOperations` - * 2019-04-01: :class:`ExpressRouteConnectionsOperations` - * 2019-06-01: :class:`ExpressRouteConnectionsOperations` - * 2019-07-01: :class:`ExpressRouteConnectionsOperations` - * 2019-08-01: :class:`ExpressRouteConnectionsOperations` - * 2019-09-01: :class:`ExpressRouteConnectionsOperations` - * 2019-11-01: :class:`ExpressRouteConnectionsOperations` - * 2019-12-01: :class:`ExpressRouteConnectionsOperations` - * 2020-03-01: :class:`ExpressRouteConnectionsOperations` - * 2020-04-01: :class:`ExpressRouteConnectionsOperations` - * 2020-05-01: :class:`ExpressRouteConnectionsOperations` - * 2020-06-01: :class:`ExpressRouteConnectionsOperations` - * 2020-07-01: :class:`ExpressRouteConnectionsOperations` - * 2020-08-01: :class:`ExpressRouteConnectionsOperations` - * 2020-11-01: :class:`ExpressRouteConnectionsOperations` - * 2021-02-01: :class:`ExpressRouteConnectionsOperations` - * 2021-03-01: :class:`ExpressRouteConnectionsOperations` - """ - api_version = self._get_api_version('express_route_connections') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_cross_connection_peerings(self): - """Instance depends on the API version: - - * 2018-02-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-06-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-07-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-08-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-10-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-11-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2018-12-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-02-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-06-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-07-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-08-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-09-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-11-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2019-12-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2020-03-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2020-04-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2020-05-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2020-06-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2020-07-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2020-08-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2020-11-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2021-02-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - * 2021-03-01: :class:`ExpressRouteCrossConnectionPeeringsOperations` - """ - api_version = self._get_api_version('express_route_cross_connection_peerings') - if api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteCrossConnectionPeeringsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_cross_connection_peerings'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_cross_connections(self): - """Instance depends on the API version: - - * 2018-02-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-04-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-06-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-07-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-08-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-10-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-11-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2018-12-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-02-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-04-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-06-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-07-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-08-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-09-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-11-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2019-12-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2020-03-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2020-04-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2020-05-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2020-06-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2020-07-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2020-08-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2020-11-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2021-02-01: :class:`ExpressRouteCrossConnectionsOperations` - * 2021-03-01: :class:`ExpressRouteCrossConnectionsOperations` - """ - api_version = self._get_api_version('express_route_cross_connections') - if api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteCrossConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_cross_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_gateways(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRouteGatewaysOperations` - * 2018-10-01: :class:`ExpressRouteGatewaysOperations` - * 2018-11-01: :class:`ExpressRouteGatewaysOperations` - * 2018-12-01: :class:`ExpressRouteGatewaysOperations` - * 2019-02-01: :class:`ExpressRouteGatewaysOperations` - * 2019-04-01: :class:`ExpressRouteGatewaysOperations` - * 2019-06-01: :class:`ExpressRouteGatewaysOperations` - * 2019-07-01: :class:`ExpressRouteGatewaysOperations` - * 2019-08-01: :class:`ExpressRouteGatewaysOperations` - * 2019-09-01: :class:`ExpressRouteGatewaysOperations` - * 2019-11-01: :class:`ExpressRouteGatewaysOperations` - * 2019-12-01: :class:`ExpressRouteGatewaysOperations` - * 2020-03-01: :class:`ExpressRouteGatewaysOperations` - * 2020-04-01: :class:`ExpressRouteGatewaysOperations` - * 2020-05-01: :class:`ExpressRouteGatewaysOperations` - * 2020-06-01: :class:`ExpressRouteGatewaysOperations` - * 2020-07-01: :class:`ExpressRouteGatewaysOperations` - * 2020-08-01: :class:`ExpressRouteGatewaysOperations` - * 2020-11-01: :class:`ExpressRouteGatewaysOperations` - * 2021-02-01: :class:`ExpressRouteGatewaysOperations` - * 2021-03-01: :class:`ExpressRouteGatewaysOperations` - """ - api_version = self._get_api_version('express_route_gateways') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteGatewaysOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteGatewaysOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_gateways'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_links(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRouteLinksOperations` - * 2018-10-01: :class:`ExpressRouteLinksOperations` - * 2018-11-01: :class:`ExpressRouteLinksOperations` - * 2018-12-01: :class:`ExpressRouteLinksOperations` - * 2019-02-01: :class:`ExpressRouteLinksOperations` - * 2019-04-01: :class:`ExpressRouteLinksOperations` - * 2019-06-01: :class:`ExpressRouteLinksOperations` - * 2019-07-01: :class:`ExpressRouteLinksOperations` - * 2019-08-01: :class:`ExpressRouteLinksOperations` - * 2019-09-01: :class:`ExpressRouteLinksOperations` - * 2019-11-01: :class:`ExpressRouteLinksOperations` - * 2019-12-01: :class:`ExpressRouteLinksOperations` - * 2020-03-01: :class:`ExpressRouteLinksOperations` - * 2020-04-01: :class:`ExpressRouteLinksOperations` - * 2020-05-01: :class:`ExpressRouteLinksOperations` - * 2020-06-01: :class:`ExpressRouteLinksOperations` - * 2020-07-01: :class:`ExpressRouteLinksOperations` - * 2020-08-01: :class:`ExpressRouteLinksOperations` - * 2020-11-01: :class:`ExpressRouteLinksOperations` - * 2021-02-01: :class:`ExpressRouteLinksOperations` - * 2021-03-01: :class:`ExpressRouteLinksOperations` - """ - api_version = self._get_api_version('express_route_links') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteLinksOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteLinksOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_links'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_ports(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRoutePortsOperations` - * 2018-10-01: :class:`ExpressRoutePortsOperations` - * 2018-11-01: :class:`ExpressRoutePortsOperations` - * 2018-12-01: :class:`ExpressRoutePortsOperations` - * 2019-02-01: :class:`ExpressRoutePortsOperations` - * 2019-04-01: :class:`ExpressRoutePortsOperations` - * 2019-06-01: :class:`ExpressRoutePortsOperations` - * 2019-07-01: :class:`ExpressRoutePortsOperations` - * 2019-08-01: :class:`ExpressRoutePortsOperations` - * 2019-09-01: :class:`ExpressRoutePortsOperations` - * 2019-11-01: :class:`ExpressRoutePortsOperations` - * 2019-12-01: :class:`ExpressRoutePortsOperations` - * 2020-03-01: :class:`ExpressRoutePortsOperations` - * 2020-04-01: :class:`ExpressRoutePortsOperations` - * 2020-05-01: :class:`ExpressRoutePortsOperations` - * 2020-06-01: :class:`ExpressRoutePortsOperations` - * 2020-07-01: :class:`ExpressRoutePortsOperations` - * 2020-08-01: :class:`ExpressRoutePortsOperations` - * 2020-11-01: :class:`ExpressRoutePortsOperations` - * 2021-02-01: :class:`ExpressRoutePortsOperations` - * 2021-03-01: :class:`ExpressRoutePortsOperations` - """ - api_version = self._get_api_version('express_route_ports') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRoutePortsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRoutePortsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_ports'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_ports_locations(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`ExpressRoutePortsLocationsOperations` - * 2018-10-01: :class:`ExpressRoutePortsLocationsOperations` - * 2018-11-01: :class:`ExpressRoutePortsLocationsOperations` - * 2018-12-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-02-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-04-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-06-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-07-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-08-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-09-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-11-01: :class:`ExpressRoutePortsLocationsOperations` - * 2019-12-01: :class:`ExpressRoutePortsLocationsOperations` - * 2020-03-01: :class:`ExpressRoutePortsLocationsOperations` - * 2020-04-01: :class:`ExpressRoutePortsLocationsOperations` - * 2020-05-01: :class:`ExpressRoutePortsLocationsOperations` - * 2020-06-01: :class:`ExpressRoutePortsLocationsOperations` - * 2020-07-01: :class:`ExpressRoutePortsLocationsOperations` - * 2020-08-01: :class:`ExpressRoutePortsLocationsOperations` - * 2020-11-01: :class:`ExpressRoutePortsLocationsOperations` - * 2021-02-01: :class:`ExpressRoutePortsLocationsOperations` - * 2021-03-01: :class:`ExpressRoutePortsLocationsOperations` - """ - api_version = self._get_api_version('express_route_ports_locations') - if api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRoutePortsLocationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_ports_locations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def express_route_service_providers(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`ExpressRouteServiceProvidersOperations` - * 2016-09-01: :class:`ExpressRouteServiceProvidersOperations` - * 2016-12-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-03-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-06-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-08-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-09-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-10-01: :class:`ExpressRouteServiceProvidersOperations` - * 2017-11-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-01-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-02-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-04-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-06-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-07-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-08-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-10-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-11-01: :class:`ExpressRouteServiceProvidersOperations` - * 2018-12-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-02-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-04-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-06-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-07-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-08-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-09-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-11-01: :class:`ExpressRouteServiceProvidersOperations` - * 2019-12-01: :class:`ExpressRouteServiceProvidersOperations` - * 2020-03-01: :class:`ExpressRouteServiceProvidersOperations` - * 2020-04-01: :class:`ExpressRouteServiceProvidersOperations` - * 2020-05-01: :class:`ExpressRouteServiceProvidersOperations` - * 2020-06-01: :class:`ExpressRouteServiceProvidersOperations` - * 2020-07-01: :class:`ExpressRouteServiceProvidersOperations` - * 2020-08-01: :class:`ExpressRouteServiceProvidersOperations` - * 2020-11-01: :class:`ExpressRouteServiceProvidersOperations` - * 2021-02-01: :class:`ExpressRouteServiceProvidersOperations` - * 2021-03-01: :class:`ExpressRouteServiceProvidersOperations` - """ - api_version = self._get_api_version('express_route_service_providers') - if api_version == '2015-06-15': - from .v2015_06_15.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ExpressRouteServiceProvidersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'express_route_service_providers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def firewall_policies(self): - """Instance depends on the API version: - - * 2019-06-01: :class:`FirewallPoliciesOperations` - * 2019-07-01: :class:`FirewallPoliciesOperations` - * 2019-08-01: :class:`FirewallPoliciesOperations` - * 2019-09-01: :class:`FirewallPoliciesOperations` - * 2019-11-01: :class:`FirewallPoliciesOperations` - * 2019-12-01: :class:`FirewallPoliciesOperations` - * 2020-03-01: :class:`FirewallPoliciesOperations` - * 2020-04-01: :class:`FirewallPoliciesOperations` - * 2020-05-01: :class:`FirewallPoliciesOperations` - * 2020-06-01: :class:`FirewallPoliciesOperations` - * 2020-07-01: :class:`FirewallPoliciesOperations` - * 2020-08-01: :class:`FirewallPoliciesOperations` - * 2020-11-01: :class:`FirewallPoliciesOperations` - * 2021-02-01: :class:`FirewallPoliciesOperations` - * 2021-03-01: :class:`FirewallPoliciesOperations` - """ - api_version = self._get_api_version('firewall_policies') - if api_version == '2019-06-01': - from .v2019_06_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import FirewallPoliciesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import FirewallPoliciesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'firewall_policies'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def firewall_policy_rule_collection_groups(self): - """Instance depends on the API version: - - * 2020-05-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` - * 2020-06-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` - * 2020-07-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` - * 2020-08-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` - * 2020-11-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` - * 2021-02-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` - * 2021-03-01: :class:`FirewallPolicyRuleCollectionGroupsOperations` - """ - api_version = self._get_api_version('firewall_policy_rule_collection_groups') - if api_version == '2020-05-01': - from .v2020_05_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import FirewallPolicyRuleCollectionGroupsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'firewall_policy_rule_collection_groups'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def firewall_policy_rule_groups(self): - """Instance depends on the API version: - - * 2019-06-01: :class:`FirewallPolicyRuleGroupsOperations` - * 2019-07-01: :class:`FirewallPolicyRuleGroupsOperations` - * 2019-08-01: :class:`FirewallPolicyRuleGroupsOperations` - * 2019-09-01: :class:`FirewallPolicyRuleGroupsOperations` - * 2019-11-01: :class:`FirewallPolicyRuleGroupsOperations` - * 2019-12-01: :class:`FirewallPolicyRuleGroupsOperations` - * 2020-03-01: :class:`FirewallPolicyRuleGroupsOperations` - * 2020-04-01: :class:`FirewallPolicyRuleGroupsOperations` - """ - api_version = self._get_api_version('firewall_policy_rule_groups') - if api_version == '2019-06-01': - from .v2019_06_01.operations import FirewallPolicyRuleGroupsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import FirewallPolicyRuleGroupsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import FirewallPolicyRuleGroupsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import FirewallPolicyRuleGroupsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import FirewallPolicyRuleGroupsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import FirewallPolicyRuleGroupsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import FirewallPolicyRuleGroupsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import FirewallPolicyRuleGroupsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'firewall_policy_rule_groups'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def flow_logs(self): - """Instance depends on the API version: - - * 2019-11-01: :class:`FlowLogsOperations` - * 2019-12-01: :class:`FlowLogsOperations` - * 2020-03-01: :class:`FlowLogsOperations` - * 2020-04-01: :class:`FlowLogsOperations` - * 2020-05-01: :class:`FlowLogsOperations` - * 2020-06-01: :class:`FlowLogsOperations` - * 2020-07-01: :class:`FlowLogsOperations` - * 2020-08-01: :class:`FlowLogsOperations` - * 2020-11-01: :class:`FlowLogsOperations` - * 2021-02-01: :class:`FlowLogsOperations` - * 2021-03-01: :class:`FlowLogsOperations` - """ - api_version = self._get_api_version('flow_logs') - if api_version == '2019-11-01': - from .v2019_11_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import FlowLogsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import FlowLogsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'flow_logs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def hub_route_tables(self): - """Instance depends on the API version: - - * 2020-04-01: :class:`HubRouteTablesOperations` - * 2020-05-01: :class:`HubRouteTablesOperations` - * 2020-06-01: :class:`HubRouteTablesOperations` - * 2020-07-01: :class:`HubRouteTablesOperations` - * 2020-08-01: :class:`HubRouteTablesOperations` - * 2020-11-01: :class:`HubRouteTablesOperations` - * 2021-02-01: :class:`HubRouteTablesOperations` - * 2021-03-01: :class:`HubRouteTablesOperations` - """ - api_version = self._get_api_version('hub_route_tables') - if api_version == '2020-04-01': - from .v2020_04_01.operations import HubRouteTablesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import HubRouteTablesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import HubRouteTablesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import HubRouteTablesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import HubRouteTablesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import HubRouteTablesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import HubRouteTablesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import HubRouteTablesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'hub_route_tables'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def hub_virtual_network_connections(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-06-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-07-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-08-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-10-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-11-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2018-12-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-02-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-04-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-06-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-07-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-08-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-09-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-11-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2019-12-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2020-03-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2020-04-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2020-05-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2020-06-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2020-07-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2020-08-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2020-11-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2021-02-01: :class:`HubVirtualNetworkConnectionsOperations` - * 2021-03-01: :class:`HubVirtualNetworkConnectionsOperations` - """ - api_version = self._get_api_version('hub_virtual_network_connections') - if api_version == '2018-04-01': - from .v2018_04_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import HubVirtualNetworkConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'hub_virtual_network_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def inbound_nat_rules(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`InboundNatRulesOperations` - * 2017-08-01: :class:`InboundNatRulesOperations` - * 2017-09-01: :class:`InboundNatRulesOperations` - * 2017-10-01: :class:`InboundNatRulesOperations` - * 2017-11-01: :class:`InboundNatRulesOperations` - * 2018-01-01: :class:`InboundNatRulesOperations` - * 2018-02-01: :class:`InboundNatRulesOperations` - * 2018-04-01: :class:`InboundNatRulesOperations` - * 2018-06-01: :class:`InboundNatRulesOperations` - * 2018-07-01: :class:`InboundNatRulesOperations` - * 2018-08-01: :class:`InboundNatRulesOperations` - * 2018-10-01: :class:`InboundNatRulesOperations` - * 2018-11-01: :class:`InboundNatRulesOperations` - * 2018-12-01: :class:`InboundNatRulesOperations` - * 2019-02-01: :class:`InboundNatRulesOperations` - * 2019-04-01: :class:`InboundNatRulesOperations` - * 2019-06-01: :class:`InboundNatRulesOperations` - * 2019-07-01: :class:`InboundNatRulesOperations` - * 2019-08-01: :class:`InboundNatRulesOperations` - * 2019-09-01: :class:`InboundNatRulesOperations` - * 2019-11-01: :class:`InboundNatRulesOperations` - * 2019-12-01: :class:`InboundNatRulesOperations` - * 2020-03-01: :class:`InboundNatRulesOperations` - * 2020-04-01: :class:`InboundNatRulesOperations` - * 2020-05-01: :class:`InboundNatRulesOperations` - * 2020-06-01: :class:`InboundNatRulesOperations` - * 2020-07-01: :class:`InboundNatRulesOperations` - * 2020-08-01: :class:`InboundNatRulesOperations` - * 2020-11-01: :class:`InboundNatRulesOperations` - * 2021-02-01: :class:`InboundNatRulesOperations` - * 2021-03-01: :class:`InboundNatRulesOperations` - """ - api_version = self._get_api_version('inbound_nat_rules') - if api_version == '2017-06-01': - from .v2017_06_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import InboundNatRulesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import InboundNatRulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'inbound_nat_rules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def inbound_security_rule(self): - """Instance depends on the API version: - - * 2020-06-01: :class:`InboundSecurityRuleOperations` - * 2020-07-01: :class:`InboundSecurityRuleOperations` - * 2020-08-01: :class:`InboundSecurityRuleOperations` - * 2020-11-01: :class:`InboundSecurityRuleOperations` - * 2021-02-01: :class:`InboundSecurityRuleOperations` - * 2021-03-01: :class:`InboundSecurityRuleOperations` - """ - api_version = self._get_api_version('inbound_security_rule') - if api_version == '2020-06-01': - from .v2020_06_01.operations import InboundSecurityRuleOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import InboundSecurityRuleOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import InboundSecurityRuleOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import InboundSecurityRuleOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import InboundSecurityRuleOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import InboundSecurityRuleOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'inbound_security_rule'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def interface_endpoints(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`InterfaceEndpointsOperations` - * 2018-10-01: :class:`InterfaceEndpointsOperations` - * 2018-11-01: :class:`InterfaceEndpointsOperations` - * 2018-12-01: :class:`InterfaceEndpointsOperations` - * 2019-02-01: :class:`InterfaceEndpointsOperations` - """ - api_version = self._get_api_version('interface_endpoints') - if api_version == '2018-08-01': - from .v2018_08_01.operations import InterfaceEndpointsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import InterfaceEndpointsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import InterfaceEndpointsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import InterfaceEndpointsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import InterfaceEndpointsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'interface_endpoints'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def ip_allocations(self): - """Instance depends on the API version: - - * 2020-03-01: :class:`IpAllocationsOperations` - * 2020-04-01: :class:`IpAllocationsOperations` - * 2020-05-01: :class:`IpAllocationsOperations` - * 2020-06-01: :class:`IpAllocationsOperations` - * 2020-07-01: :class:`IpAllocationsOperations` - * 2020-08-01: :class:`IpAllocationsOperations` - * 2020-11-01: :class:`IpAllocationsOperations` - * 2021-02-01: :class:`IpAllocationsOperations` - * 2021-03-01: :class:`IpAllocationsOperations` - """ - api_version = self._get_api_version('ip_allocations') - if api_version == '2020-03-01': - from .v2020_03_01.operations import IpAllocationsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import IpAllocationsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import IpAllocationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import IpAllocationsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import IpAllocationsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import IpAllocationsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import IpAllocationsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import IpAllocationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import IpAllocationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ip_allocations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def ip_groups(self): - """Instance depends on the API version: - - * 2019-09-01: :class:`IpGroupsOperations` - * 2019-11-01: :class:`IpGroupsOperations` - * 2019-12-01: :class:`IpGroupsOperations` - * 2020-03-01: :class:`IpGroupsOperations` - * 2020-04-01: :class:`IpGroupsOperations` - * 2020-05-01: :class:`IpGroupsOperations` - * 2020-06-01: :class:`IpGroupsOperations` - * 2020-07-01: :class:`IpGroupsOperations` - * 2020-08-01: :class:`IpGroupsOperations` - * 2020-11-01: :class:`IpGroupsOperations` - * 2021-02-01: :class:`IpGroupsOperations` - * 2021-03-01: :class:`IpGroupsOperations` - """ - api_version = self._get_api_version('ip_groups') - if api_version == '2019-09-01': - from .v2019_09_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import IpGroupsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import IpGroupsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ip_groups'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def load_balancer_backend_address_pools(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2017-08-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2017-09-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2017-10-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2017-11-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-01-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-02-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-07-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-08-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-10-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-11-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2018-12-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-02-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-07-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-08-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-09-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-11-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2019-12-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2020-03-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2020-04-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2020-05-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2020-06-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2020-07-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2020-08-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2020-11-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2021-02-01: :class:`LoadBalancerBackendAddressPoolsOperations` - * 2021-03-01: :class:`LoadBalancerBackendAddressPoolsOperations` - """ - api_version = self._get_api_version('load_balancer_backend_address_pools') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import LoadBalancerBackendAddressPoolsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'load_balancer_backend_address_pools'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def load_balancer_frontend_ip_configurations(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2017-08-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2017-09-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2017-10-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2017-11-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-01-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-02-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-07-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-08-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-10-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-11-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2018-12-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-02-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-07-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-08-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-09-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-11-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2019-12-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2020-03-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2020-04-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2020-05-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2020-06-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2020-07-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2020-08-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2020-11-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2021-02-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - * 2021-03-01: :class:`LoadBalancerFrontendIPConfigurationsOperations` - """ - api_version = self._get_api_version('load_balancer_frontend_ip_configurations') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import LoadBalancerFrontendIPConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'load_balancer_frontend_ip_configurations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def load_balancer_load_balancing_rules(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2017-08-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2017-09-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2017-10-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2017-11-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-01-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-02-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-07-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-08-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-10-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-11-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2018-12-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-02-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-07-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-08-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-09-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-11-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2019-12-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2020-03-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2020-04-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2020-05-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2020-06-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2020-07-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2020-08-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2020-11-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2021-02-01: :class:`LoadBalancerLoadBalancingRulesOperations` - * 2021-03-01: :class:`LoadBalancerLoadBalancingRulesOperations` - """ - api_version = self._get_api_version('load_balancer_load_balancing_rules') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import LoadBalancerLoadBalancingRulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'load_balancer_load_balancing_rules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def load_balancer_network_interfaces(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2017-08-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2017-09-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2017-10-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2017-11-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-01-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-02-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-04-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-06-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-07-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-08-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-10-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-11-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2018-12-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-02-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-04-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-06-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-07-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-08-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-09-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-11-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2019-12-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2020-03-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2020-04-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2020-05-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2020-06-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2020-07-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2020-08-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2020-11-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2021-02-01: :class:`LoadBalancerNetworkInterfacesOperations` - * 2021-03-01: :class:`LoadBalancerNetworkInterfacesOperations` - """ - api_version = self._get_api_version('load_balancer_network_interfaces') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import LoadBalancerNetworkInterfacesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'load_balancer_network_interfaces'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def load_balancer_outbound_rules(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`LoadBalancerOutboundRulesOperations` - * 2018-10-01: :class:`LoadBalancerOutboundRulesOperations` - * 2018-11-01: :class:`LoadBalancerOutboundRulesOperations` - * 2018-12-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-02-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-04-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-06-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-07-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-08-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-09-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-11-01: :class:`LoadBalancerOutboundRulesOperations` - * 2019-12-01: :class:`LoadBalancerOutboundRulesOperations` - * 2020-03-01: :class:`LoadBalancerOutboundRulesOperations` - * 2020-04-01: :class:`LoadBalancerOutboundRulesOperations` - * 2020-05-01: :class:`LoadBalancerOutboundRulesOperations` - * 2020-06-01: :class:`LoadBalancerOutboundRulesOperations` - * 2020-07-01: :class:`LoadBalancerOutboundRulesOperations` - * 2020-08-01: :class:`LoadBalancerOutboundRulesOperations` - * 2020-11-01: :class:`LoadBalancerOutboundRulesOperations` - * 2021-02-01: :class:`LoadBalancerOutboundRulesOperations` - * 2021-03-01: :class:`LoadBalancerOutboundRulesOperations` - """ - api_version = self._get_api_version('load_balancer_outbound_rules') - if api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import LoadBalancerOutboundRulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'load_balancer_outbound_rules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def load_balancer_probes(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`LoadBalancerProbesOperations` - * 2017-08-01: :class:`LoadBalancerProbesOperations` - * 2017-09-01: :class:`LoadBalancerProbesOperations` - * 2017-10-01: :class:`LoadBalancerProbesOperations` - * 2017-11-01: :class:`LoadBalancerProbesOperations` - * 2018-01-01: :class:`LoadBalancerProbesOperations` - * 2018-02-01: :class:`LoadBalancerProbesOperations` - * 2018-04-01: :class:`LoadBalancerProbesOperations` - * 2018-06-01: :class:`LoadBalancerProbesOperations` - * 2018-07-01: :class:`LoadBalancerProbesOperations` - * 2018-08-01: :class:`LoadBalancerProbesOperations` - * 2018-10-01: :class:`LoadBalancerProbesOperations` - * 2018-11-01: :class:`LoadBalancerProbesOperations` - * 2018-12-01: :class:`LoadBalancerProbesOperations` - * 2019-02-01: :class:`LoadBalancerProbesOperations` - * 2019-04-01: :class:`LoadBalancerProbesOperations` - * 2019-06-01: :class:`LoadBalancerProbesOperations` - * 2019-07-01: :class:`LoadBalancerProbesOperations` - * 2019-08-01: :class:`LoadBalancerProbesOperations` - * 2019-09-01: :class:`LoadBalancerProbesOperations` - * 2019-11-01: :class:`LoadBalancerProbesOperations` - * 2019-12-01: :class:`LoadBalancerProbesOperations` - * 2020-03-01: :class:`LoadBalancerProbesOperations` - * 2020-04-01: :class:`LoadBalancerProbesOperations` - * 2020-05-01: :class:`LoadBalancerProbesOperations` - * 2020-06-01: :class:`LoadBalancerProbesOperations` - * 2020-07-01: :class:`LoadBalancerProbesOperations` - * 2020-08-01: :class:`LoadBalancerProbesOperations` - * 2020-11-01: :class:`LoadBalancerProbesOperations` - * 2021-02-01: :class:`LoadBalancerProbesOperations` - * 2021-03-01: :class:`LoadBalancerProbesOperations` - """ - api_version = self._get_api_version('load_balancer_probes') - if api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import LoadBalancerProbesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import LoadBalancerProbesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'load_balancer_probes'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def load_balancers(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`LoadBalancersOperations` - * 2016-09-01: :class:`LoadBalancersOperations` - * 2016-12-01: :class:`LoadBalancersOperations` - * 2017-03-01: :class:`LoadBalancersOperations` - * 2017-06-01: :class:`LoadBalancersOperations` - * 2017-08-01: :class:`LoadBalancersOperations` - * 2017-09-01: :class:`LoadBalancersOperations` - * 2017-10-01: :class:`LoadBalancersOperations` - * 2017-11-01: :class:`LoadBalancersOperations` - * 2018-01-01: :class:`LoadBalancersOperations` - * 2018-02-01: :class:`LoadBalancersOperations` - * 2018-04-01: :class:`LoadBalancersOperations` - * 2018-06-01: :class:`LoadBalancersOperations` - * 2018-07-01: :class:`LoadBalancersOperations` - * 2018-08-01: :class:`LoadBalancersOperations` - * 2018-10-01: :class:`LoadBalancersOperations` - * 2018-11-01: :class:`LoadBalancersOperations` - * 2018-12-01: :class:`LoadBalancersOperations` - * 2019-02-01: :class:`LoadBalancersOperations` - * 2019-04-01: :class:`LoadBalancersOperations` - * 2019-06-01: :class:`LoadBalancersOperations` - * 2019-07-01: :class:`LoadBalancersOperations` - * 2019-08-01: :class:`LoadBalancersOperations` - * 2019-09-01: :class:`LoadBalancersOperations` - * 2019-11-01: :class:`LoadBalancersOperations` - * 2019-12-01: :class:`LoadBalancersOperations` - * 2020-03-01: :class:`LoadBalancersOperations` - * 2020-04-01: :class:`LoadBalancersOperations` - * 2020-05-01: :class:`LoadBalancersOperations` - * 2020-06-01: :class:`LoadBalancersOperations` - * 2020-07-01: :class:`LoadBalancersOperations` - * 2020-08-01: :class:`LoadBalancersOperations` - * 2020-11-01: :class:`LoadBalancersOperations` - * 2021-02-01: :class:`LoadBalancersOperations` - * 2021-03-01: :class:`LoadBalancersOperations` - """ - api_version = self._get_api_version('load_balancers') - if api_version == '2015-06-15': - from .v2015_06_15.operations import LoadBalancersOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import LoadBalancersOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import LoadBalancersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'load_balancers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def local_network_gateways(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`LocalNetworkGatewaysOperations` - * 2016-09-01: :class:`LocalNetworkGatewaysOperations` - * 2016-12-01: :class:`LocalNetworkGatewaysOperations` - * 2017-03-01: :class:`LocalNetworkGatewaysOperations` - * 2017-06-01: :class:`LocalNetworkGatewaysOperations` - * 2017-08-01: :class:`LocalNetworkGatewaysOperations` - * 2017-09-01: :class:`LocalNetworkGatewaysOperations` - * 2017-10-01: :class:`LocalNetworkGatewaysOperations` - * 2017-11-01: :class:`LocalNetworkGatewaysOperations` - * 2018-01-01: :class:`LocalNetworkGatewaysOperations` - * 2018-02-01: :class:`LocalNetworkGatewaysOperations` - * 2018-04-01: :class:`LocalNetworkGatewaysOperations` - * 2018-06-01: :class:`LocalNetworkGatewaysOperations` - * 2018-07-01: :class:`LocalNetworkGatewaysOperations` - * 2018-08-01: :class:`LocalNetworkGatewaysOperations` - * 2018-10-01: :class:`LocalNetworkGatewaysOperations` - * 2018-11-01: :class:`LocalNetworkGatewaysOperations` - * 2018-12-01: :class:`LocalNetworkGatewaysOperations` - * 2019-02-01: :class:`LocalNetworkGatewaysOperations` - * 2019-04-01: :class:`LocalNetworkGatewaysOperations` - * 2019-06-01: :class:`LocalNetworkGatewaysOperations` - * 2019-07-01: :class:`LocalNetworkGatewaysOperations` - * 2019-08-01: :class:`LocalNetworkGatewaysOperations` - * 2019-09-01: :class:`LocalNetworkGatewaysOperations` - * 2019-11-01: :class:`LocalNetworkGatewaysOperations` - * 2019-12-01: :class:`LocalNetworkGatewaysOperations` - * 2020-03-01: :class:`LocalNetworkGatewaysOperations` - * 2020-04-01: :class:`LocalNetworkGatewaysOperations` - * 2020-05-01: :class:`LocalNetworkGatewaysOperations` - * 2020-06-01: :class:`LocalNetworkGatewaysOperations` - * 2020-07-01: :class:`LocalNetworkGatewaysOperations` - * 2020-08-01: :class:`LocalNetworkGatewaysOperations` - * 2020-11-01: :class:`LocalNetworkGatewaysOperations` - * 2021-02-01: :class:`LocalNetworkGatewaysOperations` - * 2021-03-01: :class:`LocalNetworkGatewaysOperations` - """ - api_version = self._get_api_version('local_network_gateways') - if api_version == '2015-06-15': - from .v2015_06_15.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import LocalNetworkGatewaysOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import LocalNetworkGatewaysOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'local_network_gateways'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def nat_gateways(self): - """Instance depends on the API version: - - * 2019-02-01: :class:`NatGatewaysOperations` - * 2019-04-01: :class:`NatGatewaysOperations` - * 2019-06-01: :class:`NatGatewaysOperations` - * 2019-07-01: :class:`NatGatewaysOperations` - * 2019-08-01: :class:`NatGatewaysOperations` - * 2019-09-01: :class:`NatGatewaysOperations` - * 2019-11-01: :class:`NatGatewaysOperations` - * 2019-12-01: :class:`NatGatewaysOperations` - * 2020-03-01: :class:`NatGatewaysOperations` - * 2020-04-01: :class:`NatGatewaysOperations` - * 2020-05-01: :class:`NatGatewaysOperations` - * 2020-06-01: :class:`NatGatewaysOperations` - * 2020-07-01: :class:`NatGatewaysOperations` - * 2020-08-01: :class:`NatGatewaysOperations` - * 2020-11-01: :class:`NatGatewaysOperations` - * 2021-02-01: :class:`NatGatewaysOperations` - * 2021-03-01: :class:`NatGatewaysOperations` - """ - api_version = self._get_api_version('nat_gateways') - if api_version == '2019-02-01': - from .v2019_02_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NatGatewaysOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NatGatewaysOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'nat_gateways'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def nat_rules(self): - """Instance depends on the API version: - - * 2020-08-01: :class:`NatRulesOperations` - * 2020-11-01: :class:`NatRulesOperations` - * 2021-02-01: :class:`NatRulesOperations` - * 2021-03-01: :class:`NatRulesOperations` - """ - api_version = self._get_api_version('nat_rules') - if api_version == '2020-08-01': - from .v2020_08_01.operations import NatRulesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NatRulesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NatRulesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NatRulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'nat_rules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def network_interface_ip_configurations(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2017-08-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2017-09-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2017-10-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2017-11-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-01-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-02-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-07-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-08-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-10-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-11-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2018-12-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-02-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-07-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-08-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-09-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-11-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2019-12-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2020-03-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2020-04-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2020-05-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2020-06-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2020-07-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2020-08-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2020-11-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2021-02-01: :class:`NetworkInterfaceIPConfigurationsOperations` - * 2021-03-01: :class:`NetworkInterfaceIPConfigurationsOperations` - """ - api_version = self._get_api_version('network_interface_ip_configurations') - if api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NetworkInterfaceIPConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'network_interface_ip_configurations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def network_interface_load_balancers(self): - """Instance depends on the API version: - - * 2017-06-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2017-08-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2017-09-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2017-10-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2017-11-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-01-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-02-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-04-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-06-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-07-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-08-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-10-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-11-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2018-12-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-02-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-04-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-06-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-07-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-08-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-09-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-11-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2019-12-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2020-03-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2020-04-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2020-05-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2020-06-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2020-07-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2020-08-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2020-11-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2021-02-01: :class:`NetworkInterfaceLoadBalancersOperations` - * 2021-03-01: :class:`NetworkInterfaceLoadBalancersOperations` - """ - api_version = self._get_api_version('network_interface_load_balancers') - if api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NetworkInterfaceLoadBalancersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'network_interface_load_balancers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def network_interface_tap_configurations(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2018-10-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2018-11-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2018-12-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-02-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-04-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-06-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-07-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-08-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-09-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-11-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2019-12-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2020-03-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2020-04-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2020-05-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2020-06-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2020-07-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2020-08-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2020-11-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2021-02-01: :class:`NetworkInterfaceTapConfigurationsOperations` - * 2021-03-01: :class:`NetworkInterfaceTapConfigurationsOperations` - """ - api_version = self._get_api_version('network_interface_tap_configurations') - if api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NetworkInterfaceTapConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'network_interface_tap_configurations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def network_interfaces(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`NetworkInterfacesOperations` - * 2016-09-01: :class:`NetworkInterfacesOperations` - * 2016-12-01: :class:`NetworkInterfacesOperations` - * 2017-03-01: :class:`NetworkInterfacesOperations` - * 2017-06-01: :class:`NetworkInterfacesOperations` - * 2017-08-01: :class:`NetworkInterfacesOperations` - * 2017-09-01: :class:`NetworkInterfacesOperations` - * 2017-10-01: :class:`NetworkInterfacesOperations` - * 2017-11-01: :class:`NetworkInterfacesOperations` - * 2018-01-01: :class:`NetworkInterfacesOperations` - * 2018-02-01: :class:`NetworkInterfacesOperations` - * 2018-04-01: :class:`NetworkInterfacesOperations` - * 2018-06-01: :class:`NetworkInterfacesOperations` - * 2018-07-01: :class:`NetworkInterfacesOperations` - * 2018-08-01: :class:`NetworkInterfacesOperations` - * 2018-10-01: :class:`NetworkInterfacesOperations` - * 2018-11-01: :class:`NetworkInterfacesOperations` - * 2018-12-01: :class:`NetworkInterfacesOperations` - * 2019-02-01: :class:`NetworkInterfacesOperations` - * 2019-04-01: :class:`NetworkInterfacesOperations` - * 2019-06-01: :class:`NetworkInterfacesOperations` - * 2019-07-01: :class:`NetworkInterfacesOperations` - * 2019-08-01: :class:`NetworkInterfacesOperations` - * 2019-09-01: :class:`NetworkInterfacesOperations` - * 2019-11-01: :class:`NetworkInterfacesOperations` - * 2019-12-01: :class:`NetworkInterfacesOperations` - * 2020-03-01: :class:`NetworkInterfacesOperations` - * 2020-04-01: :class:`NetworkInterfacesOperations` - * 2020-05-01: :class:`NetworkInterfacesOperations` - * 2020-06-01: :class:`NetworkInterfacesOperations` - * 2020-07-01: :class:`NetworkInterfacesOperations` - * 2020-08-01: :class:`NetworkInterfacesOperations` - * 2020-11-01: :class:`NetworkInterfacesOperations` - * 2021-02-01: :class:`NetworkInterfacesOperations` - * 2021-03-01: :class:`NetworkInterfacesOperations` - """ - api_version = self._get_api_version('network_interfaces') - if api_version == '2015-06-15': - from .v2015_06_15.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NetworkInterfacesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NetworkInterfacesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'network_interfaces'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def network_profiles(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`NetworkProfilesOperations` - * 2018-10-01: :class:`NetworkProfilesOperations` - * 2018-11-01: :class:`NetworkProfilesOperations` - * 2018-12-01: :class:`NetworkProfilesOperations` - * 2019-02-01: :class:`NetworkProfilesOperations` - * 2019-04-01: :class:`NetworkProfilesOperations` - * 2019-06-01: :class:`NetworkProfilesOperations` - * 2019-07-01: :class:`NetworkProfilesOperations` - * 2019-08-01: :class:`NetworkProfilesOperations` - * 2019-09-01: :class:`NetworkProfilesOperations` - * 2019-11-01: :class:`NetworkProfilesOperations` - * 2019-12-01: :class:`NetworkProfilesOperations` - * 2020-03-01: :class:`NetworkProfilesOperations` - * 2020-04-01: :class:`NetworkProfilesOperations` - * 2020-05-01: :class:`NetworkProfilesOperations` - * 2020-06-01: :class:`NetworkProfilesOperations` - * 2020-07-01: :class:`NetworkProfilesOperations` - * 2020-08-01: :class:`NetworkProfilesOperations` - * 2020-11-01: :class:`NetworkProfilesOperations` - * 2021-02-01: :class:`NetworkProfilesOperations` - * 2021-03-01: :class:`NetworkProfilesOperations` - """ - api_version = self._get_api_version('network_profiles') - if api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NetworkProfilesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NetworkProfilesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'network_profiles'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def network_security_groups(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`NetworkSecurityGroupsOperations` - * 2016-09-01: :class:`NetworkSecurityGroupsOperations` - * 2016-12-01: :class:`NetworkSecurityGroupsOperations` - * 2017-03-01: :class:`NetworkSecurityGroupsOperations` - * 2017-06-01: :class:`NetworkSecurityGroupsOperations` - * 2017-08-01: :class:`NetworkSecurityGroupsOperations` - * 2017-09-01: :class:`NetworkSecurityGroupsOperations` - * 2017-10-01: :class:`NetworkSecurityGroupsOperations` - * 2017-11-01: :class:`NetworkSecurityGroupsOperations` - * 2018-01-01: :class:`NetworkSecurityGroupsOperations` - * 2018-02-01: :class:`NetworkSecurityGroupsOperations` - * 2018-04-01: :class:`NetworkSecurityGroupsOperations` - * 2018-06-01: :class:`NetworkSecurityGroupsOperations` - * 2018-07-01: :class:`NetworkSecurityGroupsOperations` - * 2018-08-01: :class:`NetworkSecurityGroupsOperations` - * 2018-10-01: :class:`NetworkSecurityGroupsOperations` - * 2018-11-01: :class:`NetworkSecurityGroupsOperations` - * 2018-12-01: :class:`NetworkSecurityGroupsOperations` - * 2019-02-01: :class:`NetworkSecurityGroupsOperations` - * 2019-04-01: :class:`NetworkSecurityGroupsOperations` - * 2019-06-01: :class:`NetworkSecurityGroupsOperations` - * 2019-07-01: :class:`NetworkSecurityGroupsOperations` - * 2019-08-01: :class:`NetworkSecurityGroupsOperations` - * 2019-09-01: :class:`NetworkSecurityGroupsOperations` - * 2019-11-01: :class:`NetworkSecurityGroupsOperations` - * 2019-12-01: :class:`NetworkSecurityGroupsOperations` - * 2020-03-01: :class:`NetworkSecurityGroupsOperations` - * 2020-04-01: :class:`NetworkSecurityGroupsOperations` - * 2020-05-01: :class:`NetworkSecurityGroupsOperations` - * 2020-06-01: :class:`NetworkSecurityGroupsOperations` - * 2020-07-01: :class:`NetworkSecurityGroupsOperations` - * 2020-08-01: :class:`NetworkSecurityGroupsOperations` - * 2020-11-01: :class:`NetworkSecurityGroupsOperations` - * 2021-02-01: :class:`NetworkSecurityGroupsOperations` - * 2021-03-01: :class:`NetworkSecurityGroupsOperations` - """ - api_version = self._get_api_version('network_security_groups') - if api_version == '2015-06-15': - from .v2015_06_15.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NetworkSecurityGroupsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NetworkSecurityGroupsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'network_security_groups'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def network_virtual_appliances(self): - """Instance depends on the API version: - - * 2019-12-01: :class:`NetworkVirtualAppliancesOperations` - * 2020-03-01: :class:`NetworkVirtualAppliancesOperations` - * 2020-04-01: :class:`NetworkVirtualAppliancesOperations` - * 2020-05-01: :class:`NetworkVirtualAppliancesOperations` - * 2020-06-01: :class:`NetworkVirtualAppliancesOperations` - * 2020-07-01: :class:`NetworkVirtualAppliancesOperations` - * 2020-08-01: :class:`NetworkVirtualAppliancesOperations` - * 2020-11-01: :class:`NetworkVirtualAppliancesOperations` - * 2021-02-01: :class:`NetworkVirtualAppliancesOperations` - * 2021-03-01: :class:`NetworkVirtualAppliancesOperations` - """ - api_version = self._get_api_version('network_virtual_appliances') - if api_version == '2019-12-01': - from .v2019_12_01.operations import NetworkVirtualAppliancesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import NetworkVirtualAppliancesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import NetworkVirtualAppliancesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import NetworkVirtualAppliancesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import NetworkVirtualAppliancesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import NetworkVirtualAppliancesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import NetworkVirtualAppliancesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NetworkVirtualAppliancesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NetworkVirtualAppliancesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NetworkVirtualAppliancesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'network_virtual_appliances'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def network_watchers(self): - """Instance depends on the API version: - - * 2016-09-01: :class:`NetworkWatchersOperations` - * 2016-12-01: :class:`NetworkWatchersOperations` - * 2017-03-01: :class:`NetworkWatchersOperations` - * 2017-06-01: :class:`NetworkWatchersOperations` - * 2017-08-01: :class:`NetworkWatchersOperations` - * 2017-09-01: :class:`NetworkWatchersOperations` - * 2017-10-01: :class:`NetworkWatchersOperations` - * 2017-11-01: :class:`NetworkWatchersOperations` - * 2018-01-01: :class:`NetworkWatchersOperations` - * 2018-02-01: :class:`NetworkWatchersOperations` - * 2018-04-01: :class:`NetworkWatchersOperations` - * 2018-06-01: :class:`NetworkWatchersOperations` - * 2018-07-01: :class:`NetworkWatchersOperations` - * 2018-08-01: :class:`NetworkWatchersOperations` - * 2018-10-01: :class:`NetworkWatchersOperations` - * 2018-11-01: :class:`NetworkWatchersOperations` - * 2018-12-01: :class:`NetworkWatchersOperations` - * 2019-02-01: :class:`NetworkWatchersOperations` - * 2019-04-01: :class:`NetworkWatchersOperations` - * 2019-06-01: :class:`NetworkWatchersOperations` - * 2019-07-01: :class:`NetworkWatchersOperations` - * 2019-08-01: :class:`NetworkWatchersOperations` - * 2019-09-01: :class:`NetworkWatchersOperations` - * 2019-11-01: :class:`NetworkWatchersOperations` - * 2019-12-01: :class:`NetworkWatchersOperations` - * 2020-03-01: :class:`NetworkWatchersOperations` - * 2020-04-01: :class:`NetworkWatchersOperations` - * 2020-05-01: :class:`NetworkWatchersOperations` - * 2020-06-01: :class:`NetworkWatchersOperations` - * 2020-07-01: :class:`NetworkWatchersOperations` - * 2020-08-01: :class:`NetworkWatchersOperations` - * 2020-11-01: :class:`NetworkWatchersOperations` - * 2021-02-01: :class:`NetworkWatchersOperations` - * 2021-03-01: :class:`NetworkWatchersOperations` - """ - api_version = self._get_api_version('network_watchers') - if api_version == '2016-09-01': - from .v2016_09_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import NetworkWatchersOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import NetworkWatchersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'network_watchers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def operations(self): - """Instance depends on the API version: - - * 2017-09-01: :class:`Operations` - * 2017-10-01: :class:`Operations` - * 2017-11-01: :class:`Operations` - * 2018-01-01: :class:`Operations` - * 2018-02-01: :class:`Operations` - * 2018-04-01: :class:`Operations` - * 2018-06-01: :class:`Operations` - * 2018-07-01: :class:`Operations` - * 2018-08-01: :class:`Operations` - * 2018-10-01: :class:`Operations` - * 2018-11-01: :class:`Operations` - * 2018-12-01: :class:`Operations` - * 2019-02-01: :class:`Operations` - * 2019-04-01: :class:`Operations` - * 2019-06-01: :class:`Operations` - * 2019-07-01: :class:`Operations` - * 2019-08-01: :class:`Operations` - * 2019-09-01: :class:`Operations` - * 2019-11-01: :class:`Operations` - * 2019-12-01: :class:`Operations` - * 2020-03-01: :class:`Operations` - * 2020-04-01: :class:`Operations` - * 2020-05-01: :class:`Operations` - * 2020-06-01: :class:`Operations` - * 2020-07-01: :class:`Operations` - * 2020-08-01: :class:`Operations` - * 2020-11-01: :class:`Operations` - * 2021-02-01: :class:`Operations` - * 2021-03-01: :class:`Operations` - """ - api_version = self._get_api_version('operations') - if api_version == '2017-09-01': - from .v2017_09_01.operations import Operations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import Operations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import Operations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import Operations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import Operations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import Operations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import Operations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import Operations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import Operations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import Operations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import Operations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import Operations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import Operations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import Operations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import Operations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import Operations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import Operations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import Operations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import Operations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import Operations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import Operations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import Operations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import Operations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import Operations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import Operations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import Operations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import Operations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import Operations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def p2_svpn_gateways(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`P2SVpnGatewaysOperations` - * 2018-10-01: :class:`P2SVpnGatewaysOperations` - * 2018-11-01: :class:`P2SVpnGatewaysOperations` - * 2018-12-01: :class:`P2SVpnGatewaysOperations` - * 2019-02-01: :class:`P2SVpnGatewaysOperations` - * 2019-04-01: :class:`P2SVpnGatewaysOperations` - * 2019-06-01: :class:`P2SVpnGatewaysOperations` - * 2019-07-01: :class:`P2SVpnGatewaysOperations` - * 2019-08-01: :class:`P2SVpnGatewaysOperations` - * 2019-09-01: :class:`P2SVpnGatewaysOperations` - * 2019-11-01: :class:`P2SVpnGatewaysOperations` - * 2019-12-01: :class:`P2SVpnGatewaysOperations` - * 2020-03-01: :class:`P2SVpnGatewaysOperations` - * 2020-04-01: :class:`P2SVpnGatewaysOperations` - * 2020-05-01: :class:`P2SVpnGatewaysOperations` - * 2020-06-01: :class:`P2SVpnGatewaysOperations` - * 2020-07-01: :class:`P2SVpnGatewaysOperations` - * 2020-08-01: :class:`P2SVpnGatewaysOperations` - * 2020-11-01: :class:`P2SVpnGatewaysOperations` - * 2021-02-01: :class:`P2SVpnGatewaysOperations` - * 2021-03-01: :class:`P2SVpnGatewaysOperations` - """ - api_version = self._get_api_version('p2_svpn_gateways') - if api_version == '2018-08-01': - from .v2018_08_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import P2SVpnGatewaysOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import P2SVpnGatewaysOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'p2_svpn_gateways'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def p2_svpn_server_configurations(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`P2SVpnServerConfigurationsOperations` - * 2018-10-01: :class:`P2SVpnServerConfigurationsOperations` - * 2018-11-01: :class:`P2SVpnServerConfigurationsOperations` - * 2018-12-01: :class:`P2SVpnServerConfigurationsOperations` - * 2019-02-01: :class:`P2SVpnServerConfigurationsOperations` - * 2019-04-01: :class:`P2SVpnServerConfigurationsOperations` - * 2019-06-01: :class:`P2SVpnServerConfigurationsOperations` - * 2019-07-01: :class:`P2SVpnServerConfigurationsOperations` - """ - api_version = self._get_api_version('p2_svpn_server_configurations') - if api_version == '2018-08-01': - from .v2018_08_01.operations import P2SVpnServerConfigurationsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import P2SVpnServerConfigurationsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import P2SVpnServerConfigurationsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import P2SVpnServerConfigurationsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import P2SVpnServerConfigurationsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import P2SVpnServerConfigurationsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import P2SVpnServerConfigurationsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import P2SVpnServerConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'p2_svpn_server_configurations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def packet_captures(self): - """Instance depends on the API version: - - * 2016-09-01: :class:`PacketCapturesOperations` - * 2016-12-01: :class:`PacketCapturesOperations` - * 2017-03-01: :class:`PacketCapturesOperations` - * 2017-06-01: :class:`PacketCapturesOperations` - * 2017-08-01: :class:`PacketCapturesOperations` - * 2017-09-01: :class:`PacketCapturesOperations` - * 2017-10-01: :class:`PacketCapturesOperations` - * 2017-11-01: :class:`PacketCapturesOperations` - * 2018-01-01: :class:`PacketCapturesOperations` - * 2018-02-01: :class:`PacketCapturesOperations` - * 2018-04-01: :class:`PacketCapturesOperations` - * 2018-06-01: :class:`PacketCapturesOperations` - * 2018-07-01: :class:`PacketCapturesOperations` - * 2018-08-01: :class:`PacketCapturesOperations` - * 2018-10-01: :class:`PacketCapturesOperations` - * 2018-11-01: :class:`PacketCapturesOperations` - * 2018-12-01: :class:`PacketCapturesOperations` - * 2019-02-01: :class:`PacketCapturesOperations` - * 2019-04-01: :class:`PacketCapturesOperations` - * 2019-06-01: :class:`PacketCapturesOperations` - * 2019-07-01: :class:`PacketCapturesOperations` - * 2019-08-01: :class:`PacketCapturesOperations` - * 2019-09-01: :class:`PacketCapturesOperations` - * 2019-11-01: :class:`PacketCapturesOperations` - * 2019-12-01: :class:`PacketCapturesOperations` - * 2020-03-01: :class:`PacketCapturesOperations` - * 2020-04-01: :class:`PacketCapturesOperations` - * 2020-05-01: :class:`PacketCapturesOperations` - * 2020-06-01: :class:`PacketCapturesOperations` - * 2020-07-01: :class:`PacketCapturesOperations` - * 2020-08-01: :class:`PacketCapturesOperations` - * 2020-11-01: :class:`PacketCapturesOperations` - * 2021-02-01: :class:`PacketCapturesOperations` - * 2021-03-01: :class:`PacketCapturesOperations` - """ - api_version = self._get_api_version('packet_captures') - if api_version == '2016-09-01': - from .v2016_09_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import PacketCapturesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import PacketCapturesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'packet_captures'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def peer_express_route_circuit_connections(self): - """Instance depends on the API version: - - * 2018-12-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-02-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-04-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-06-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-07-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-08-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-09-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-11-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2019-12-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2020-03-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2020-04-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2020-05-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2020-06-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2020-07-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2020-08-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2020-11-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2021-02-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - * 2021-03-01: :class:`PeerExpressRouteCircuitConnectionsOperations` - """ - api_version = self._get_api_version('peer_express_route_circuit_connections') - if api_version == '2018-12-01': - from .v2018_12_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import PeerExpressRouteCircuitConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'peer_express_route_circuit_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def private_dns_zone_groups(self): - """Instance depends on the API version: - - * 2020-03-01: :class:`PrivateDnsZoneGroupsOperations` - * 2020-04-01: :class:`PrivateDnsZoneGroupsOperations` - * 2020-05-01: :class:`PrivateDnsZoneGroupsOperations` - * 2020-06-01: :class:`PrivateDnsZoneGroupsOperations` - * 2020-07-01: :class:`PrivateDnsZoneGroupsOperations` - * 2020-08-01: :class:`PrivateDnsZoneGroupsOperations` - * 2020-11-01: :class:`PrivateDnsZoneGroupsOperations` - * 2021-02-01: :class:`PrivateDnsZoneGroupsOperations` - * 2021-03-01: :class:`PrivateDnsZoneGroupsOperations` - """ - api_version = self._get_api_version('private_dns_zone_groups') - if api_version == '2020-03-01': - from .v2020_03_01.operations import PrivateDnsZoneGroupsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import PrivateDnsZoneGroupsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import PrivateDnsZoneGroupsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import PrivateDnsZoneGroupsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import PrivateDnsZoneGroupsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import PrivateDnsZoneGroupsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import PrivateDnsZoneGroupsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import PrivateDnsZoneGroupsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import PrivateDnsZoneGroupsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_dns_zone_groups'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def private_endpoints(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`PrivateEndpointsOperations` - * 2019-06-01: :class:`PrivateEndpointsOperations` - * 2019-07-01: :class:`PrivateEndpointsOperations` - * 2019-08-01: :class:`PrivateEndpointsOperations` - * 2019-09-01: :class:`PrivateEndpointsOperations` - * 2019-11-01: :class:`PrivateEndpointsOperations` - * 2019-12-01: :class:`PrivateEndpointsOperations` - * 2020-03-01: :class:`PrivateEndpointsOperations` - * 2020-04-01: :class:`PrivateEndpointsOperations` - * 2020-05-01: :class:`PrivateEndpointsOperations` - * 2020-06-01: :class:`PrivateEndpointsOperations` - * 2020-07-01: :class:`PrivateEndpointsOperations` - * 2020-08-01: :class:`PrivateEndpointsOperations` - * 2020-11-01: :class:`PrivateEndpointsOperations` - * 2021-02-01: :class:`PrivateEndpointsOperations` - * 2021-03-01: :class:`PrivateEndpointsOperations` - """ - api_version = self._get_api_version('private_endpoints') - if api_version == '2019-04-01': - from .v2019_04_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import PrivateEndpointsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import PrivateEndpointsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_endpoints'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def private_link_services(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`PrivateLinkServicesOperations` - * 2019-06-01: :class:`PrivateLinkServicesOperations` - * 2019-07-01: :class:`PrivateLinkServicesOperations` - * 2019-08-01: :class:`PrivateLinkServicesOperations` - * 2019-09-01: :class:`PrivateLinkServicesOperations` - * 2019-11-01: :class:`PrivateLinkServicesOperations` - * 2019-12-01: :class:`PrivateLinkServicesOperations` - * 2020-03-01: :class:`PrivateLinkServicesOperations` - * 2020-04-01: :class:`PrivateLinkServicesOperations` - * 2020-05-01: :class:`PrivateLinkServicesOperations` - * 2020-06-01: :class:`PrivateLinkServicesOperations` - * 2020-07-01: :class:`PrivateLinkServicesOperations` - * 2020-08-01: :class:`PrivateLinkServicesOperations` - * 2020-11-01: :class:`PrivateLinkServicesOperations` - * 2021-02-01: :class:`PrivateLinkServicesOperations` - * 2021-03-01: :class:`PrivateLinkServicesOperations` - """ - api_version = self._get_api_version('private_link_services') - if api_version == '2019-04-01': - from .v2019_04_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import PrivateLinkServicesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import PrivateLinkServicesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'private_link_services'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def public_ip_addresses(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`PublicIPAddressesOperations` - * 2016-09-01: :class:`PublicIPAddressesOperations` - * 2016-12-01: :class:`PublicIPAddressesOperations` - * 2017-03-01: :class:`PublicIPAddressesOperations` - * 2017-06-01: :class:`PublicIPAddressesOperations` - * 2017-08-01: :class:`PublicIPAddressesOperations` - * 2017-09-01: :class:`PublicIPAddressesOperations` - * 2017-10-01: :class:`PublicIPAddressesOperations` - * 2017-11-01: :class:`PublicIPAddressesOperations` - * 2018-01-01: :class:`PublicIPAddressesOperations` - * 2018-02-01: :class:`PublicIPAddressesOperations` - * 2018-04-01: :class:`PublicIPAddressesOperations` - * 2018-06-01: :class:`PublicIPAddressesOperations` - * 2018-07-01: :class:`PublicIPAddressesOperations` - * 2018-08-01: :class:`PublicIPAddressesOperations` - * 2018-10-01: :class:`PublicIPAddressesOperations` - * 2018-11-01: :class:`PublicIPAddressesOperations` - * 2018-12-01: :class:`PublicIPAddressesOperations` - * 2019-02-01: :class:`PublicIPAddressesOperations` - * 2019-04-01: :class:`PublicIPAddressesOperations` - * 2019-06-01: :class:`PublicIPAddressesOperations` - * 2019-07-01: :class:`PublicIPAddressesOperations` - * 2019-08-01: :class:`PublicIPAddressesOperations` - * 2019-09-01: :class:`PublicIPAddressesOperations` - * 2019-11-01: :class:`PublicIPAddressesOperations` - * 2019-12-01: :class:`PublicIPAddressesOperations` - * 2020-03-01: :class:`PublicIPAddressesOperations` - * 2020-04-01: :class:`PublicIPAddressesOperations` - * 2020-05-01: :class:`PublicIPAddressesOperations` - * 2020-06-01: :class:`PublicIPAddressesOperations` - * 2020-07-01: :class:`PublicIPAddressesOperations` - * 2020-08-01: :class:`PublicIPAddressesOperations` - * 2020-11-01: :class:`PublicIPAddressesOperations` - * 2021-02-01: :class:`PublicIPAddressesOperations` - * 2021-03-01: :class:`PublicIPAddressesOperations` - """ - api_version = self._get_api_version('public_ip_addresses') - if api_version == '2015-06-15': - from .v2015_06_15.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import PublicIPAddressesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import PublicIPAddressesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'public_ip_addresses'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def public_ip_prefixes(self): - """Instance depends on the API version: - - * 2018-07-01: :class:`PublicIPPrefixesOperations` - * 2018-08-01: :class:`PublicIPPrefixesOperations` - * 2018-10-01: :class:`PublicIPPrefixesOperations` - * 2018-11-01: :class:`PublicIPPrefixesOperations` - * 2018-12-01: :class:`PublicIPPrefixesOperations` - * 2019-02-01: :class:`PublicIPPrefixesOperations` - * 2019-04-01: :class:`PublicIPPrefixesOperations` - * 2019-06-01: :class:`PublicIPPrefixesOperations` - * 2019-07-01: :class:`PublicIPPrefixesOperations` - * 2019-08-01: :class:`PublicIPPrefixesOperations` - * 2019-09-01: :class:`PublicIPPrefixesOperations` - * 2019-11-01: :class:`PublicIPPrefixesOperations` - * 2019-12-01: :class:`PublicIPPrefixesOperations` - * 2020-03-01: :class:`PublicIPPrefixesOperations` - * 2020-04-01: :class:`PublicIPPrefixesOperations` - * 2020-05-01: :class:`PublicIPPrefixesOperations` - * 2020-06-01: :class:`PublicIPPrefixesOperations` - * 2020-07-01: :class:`PublicIPPrefixesOperations` - * 2020-08-01: :class:`PublicIPPrefixesOperations` - * 2020-11-01: :class:`PublicIPPrefixesOperations` - * 2021-02-01: :class:`PublicIPPrefixesOperations` - * 2021-03-01: :class:`PublicIPPrefixesOperations` - """ - api_version = self._get_api_version('public_ip_prefixes') - if api_version == '2018-07-01': - from .v2018_07_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import PublicIPPrefixesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import PublicIPPrefixesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'public_ip_prefixes'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def resource_navigation_links(self): - """Instance depends on the API version: - - * 2019-02-01: :class:`ResourceNavigationLinksOperations` - * 2019-04-01: :class:`ResourceNavigationLinksOperations` - * 2019-06-01: :class:`ResourceNavigationLinksOperations` - * 2019-07-01: :class:`ResourceNavigationLinksOperations` - * 2019-08-01: :class:`ResourceNavigationLinksOperations` - * 2019-09-01: :class:`ResourceNavigationLinksOperations` - * 2019-11-01: :class:`ResourceNavigationLinksOperations` - * 2019-12-01: :class:`ResourceNavigationLinksOperations` - * 2020-03-01: :class:`ResourceNavigationLinksOperations` - * 2020-04-01: :class:`ResourceNavigationLinksOperations` - * 2020-05-01: :class:`ResourceNavigationLinksOperations` - * 2020-06-01: :class:`ResourceNavigationLinksOperations` - * 2020-07-01: :class:`ResourceNavigationLinksOperations` - * 2020-08-01: :class:`ResourceNavigationLinksOperations` - * 2020-11-01: :class:`ResourceNavigationLinksOperations` - * 2021-02-01: :class:`ResourceNavigationLinksOperations` - * 2021-03-01: :class:`ResourceNavigationLinksOperations` - """ - api_version = self._get_api_version('resource_navigation_links') - if api_version == '2019-02-01': - from .v2019_02_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ResourceNavigationLinksOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ResourceNavigationLinksOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'resource_navigation_links'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def route_filter_rules(self): - """Instance depends on the API version: - - * 2016-12-01: :class:`RouteFilterRulesOperations` - * 2017-03-01: :class:`RouteFilterRulesOperations` - * 2017-06-01: :class:`RouteFilterRulesOperations` - * 2017-08-01: :class:`RouteFilterRulesOperations` - * 2017-09-01: :class:`RouteFilterRulesOperations` - * 2017-10-01: :class:`RouteFilterRulesOperations` - * 2017-11-01: :class:`RouteFilterRulesOperations` - * 2018-01-01: :class:`RouteFilterRulesOperations` - * 2018-02-01: :class:`RouteFilterRulesOperations` - * 2018-04-01: :class:`RouteFilterRulesOperations` - * 2018-06-01: :class:`RouteFilterRulesOperations` - * 2018-07-01: :class:`RouteFilterRulesOperations` - * 2018-08-01: :class:`RouteFilterRulesOperations` - * 2018-10-01: :class:`RouteFilterRulesOperations` - * 2018-11-01: :class:`RouteFilterRulesOperations` - * 2018-12-01: :class:`RouteFilterRulesOperations` - * 2019-02-01: :class:`RouteFilterRulesOperations` - * 2019-04-01: :class:`RouteFilterRulesOperations` - * 2019-06-01: :class:`RouteFilterRulesOperations` - * 2019-07-01: :class:`RouteFilterRulesOperations` - * 2019-08-01: :class:`RouteFilterRulesOperations` - * 2019-09-01: :class:`RouteFilterRulesOperations` - * 2019-11-01: :class:`RouteFilterRulesOperations` - * 2019-12-01: :class:`RouteFilterRulesOperations` - * 2020-03-01: :class:`RouteFilterRulesOperations` - * 2020-04-01: :class:`RouteFilterRulesOperations` - * 2020-05-01: :class:`RouteFilterRulesOperations` - * 2020-06-01: :class:`RouteFilterRulesOperations` - * 2020-07-01: :class:`RouteFilterRulesOperations` - * 2020-08-01: :class:`RouteFilterRulesOperations` - * 2020-11-01: :class:`RouteFilterRulesOperations` - * 2021-02-01: :class:`RouteFilterRulesOperations` - * 2021-03-01: :class:`RouteFilterRulesOperations` - """ - api_version = self._get_api_version('route_filter_rules') - if api_version == '2016-12-01': - from .v2016_12_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import RouteFilterRulesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import RouteFilterRulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'route_filter_rules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def route_filters(self): - """Instance depends on the API version: - - * 2016-12-01: :class:`RouteFiltersOperations` - * 2017-03-01: :class:`RouteFiltersOperations` - * 2017-06-01: :class:`RouteFiltersOperations` - * 2017-08-01: :class:`RouteFiltersOperations` - * 2017-09-01: :class:`RouteFiltersOperations` - * 2017-10-01: :class:`RouteFiltersOperations` - * 2017-11-01: :class:`RouteFiltersOperations` - * 2018-01-01: :class:`RouteFiltersOperations` - * 2018-02-01: :class:`RouteFiltersOperations` - * 2018-04-01: :class:`RouteFiltersOperations` - * 2018-06-01: :class:`RouteFiltersOperations` - * 2018-07-01: :class:`RouteFiltersOperations` - * 2018-08-01: :class:`RouteFiltersOperations` - * 2018-10-01: :class:`RouteFiltersOperations` - * 2018-11-01: :class:`RouteFiltersOperations` - * 2018-12-01: :class:`RouteFiltersOperations` - * 2019-02-01: :class:`RouteFiltersOperations` - * 2019-04-01: :class:`RouteFiltersOperations` - * 2019-06-01: :class:`RouteFiltersOperations` - * 2019-07-01: :class:`RouteFiltersOperations` - * 2019-08-01: :class:`RouteFiltersOperations` - * 2019-09-01: :class:`RouteFiltersOperations` - * 2019-11-01: :class:`RouteFiltersOperations` - * 2019-12-01: :class:`RouteFiltersOperations` - * 2020-03-01: :class:`RouteFiltersOperations` - * 2020-04-01: :class:`RouteFiltersOperations` - * 2020-05-01: :class:`RouteFiltersOperations` - * 2020-06-01: :class:`RouteFiltersOperations` - * 2020-07-01: :class:`RouteFiltersOperations` - * 2020-08-01: :class:`RouteFiltersOperations` - * 2020-11-01: :class:`RouteFiltersOperations` - * 2021-02-01: :class:`RouteFiltersOperations` - * 2021-03-01: :class:`RouteFiltersOperations` - """ - api_version = self._get_api_version('route_filters') - if api_version == '2016-12-01': - from .v2016_12_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import RouteFiltersOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import RouteFiltersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'route_filters'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def route_tables(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`RouteTablesOperations` - * 2016-09-01: :class:`RouteTablesOperations` - * 2016-12-01: :class:`RouteTablesOperations` - * 2017-03-01: :class:`RouteTablesOperations` - * 2017-06-01: :class:`RouteTablesOperations` - * 2017-08-01: :class:`RouteTablesOperations` - * 2017-09-01: :class:`RouteTablesOperations` - * 2017-10-01: :class:`RouteTablesOperations` - * 2017-11-01: :class:`RouteTablesOperations` - * 2018-01-01: :class:`RouteTablesOperations` - * 2018-02-01: :class:`RouteTablesOperations` - * 2018-04-01: :class:`RouteTablesOperations` - * 2018-06-01: :class:`RouteTablesOperations` - * 2018-07-01: :class:`RouteTablesOperations` - * 2018-08-01: :class:`RouteTablesOperations` - * 2018-10-01: :class:`RouteTablesOperations` - * 2018-11-01: :class:`RouteTablesOperations` - * 2018-12-01: :class:`RouteTablesOperations` - * 2019-02-01: :class:`RouteTablesOperations` - * 2019-04-01: :class:`RouteTablesOperations` - * 2019-06-01: :class:`RouteTablesOperations` - * 2019-07-01: :class:`RouteTablesOperations` - * 2019-08-01: :class:`RouteTablesOperations` - * 2019-09-01: :class:`RouteTablesOperations` - * 2019-11-01: :class:`RouteTablesOperations` - * 2019-12-01: :class:`RouteTablesOperations` - * 2020-03-01: :class:`RouteTablesOperations` - * 2020-04-01: :class:`RouteTablesOperations` - * 2020-05-01: :class:`RouteTablesOperations` - * 2020-06-01: :class:`RouteTablesOperations` - * 2020-07-01: :class:`RouteTablesOperations` - * 2020-08-01: :class:`RouteTablesOperations` - * 2020-11-01: :class:`RouteTablesOperations` - * 2021-02-01: :class:`RouteTablesOperations` - * 2021-03-01: :class:`RouteTablesOperations` - """ - api_version = self._get_api_version('route_tables') - if api_version == '2015-06-15': - from .v2015_06_15.operations import RouteTablesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import RouteTablesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import RouteTablesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'route_tables'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def routes(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`RoutesOperations` - * 2016-09-01: :class:`RoutesOperations` - * 2016-12-01: :class:`RoutesOperations` - * 2017-03-01: :class:`RoutesOperations` - * 2017-06-01: :class:`RoutesOperations` - * 2017-08-01: :class:`RoutesOperations` - * 2017-09-01: :class:`RoutesOperations` - * 2017-10-01: :class:`RoutesOperations` - * 2017-11-01: :class:`RoutesOperations` - * 2018-01-01: :class:`RoutesOperations` - * 2018-02-01: :class:`RoutesOperations` - * 2018-04-01: :class:`RoutesOperations` - * 2018-06-01: :class:`RoutesOperations` - * 2018-07-01: :class:`RoutesOperations` - * 2018-08-01: :class:`RoutesOperations` - * 2018-10-01: :class:`RoutesOperations` - * 2018-11-01: :class:`RoutesOperations` - * 2018-12-01: :class:`RoutesOperations` - * 2019-02-01: :class:`RoutesOperations` - * 2019-04-01: :class:`RoutesOperations` - * 2019-06-01: :class:`RoutesOperations` - * 2019-07-01: :class:`RoutesOperations` - * 2019-08-01: :class:`RoutesOperations` - * 2019-09-01: :class:`RoutesOperations` - * 2019-11-01: :class:`RoutesOperations` - * 2019-12-01: :class:`RoutesOperations` - * 2020-03-01: :class:`RoutesOperations` - * 2020-04-01: :class:`RoutesOperations` - * 2020-05-01: :class:`RoutesOperations` - * 2020-06-01: :class:`RoutesOperations` - * 2020-07-01: :class:`RoutesOperations` - * 2020-08-01: :class:`RoutesOperations` - * 2020-11-01: :class:`RoutesOperations` - * 2021-02-01: :class:`RoutesOperations` - * 2021-03-01: :class:`RoutesOperations` - """ - api_version = self._get_api_version('routes') - if api_version == '2015-06-15': - from .v2015_06_15.operations import RoutesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import RoutesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import RoutesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import RoutesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import RoutesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import RoutesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import RoutesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import RoutesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import RoutesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import RoutesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import RoutesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import RoutesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import RoutesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import RoutesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import RoutesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'routes'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def security_partner_providers(self): - """Instance depends on the API version: - - * 2020-03-01: :class:`SecurityPartnerProvidersOperations` - * 2020-04-01: :class:`SecurityPartnerProvidersOperations` - * 2020-05-01: :class:`SecurityPartnerProvidersOperations` - * 2020-06-01: :class:`SecurityPartnerProvidersOperations` - * 2020-07-01: :class:`SecurityPartnerProvidersOperations` - * 2020-08-01: :class:`SecurityPartnerProvidersOperations` - * 2020-11-01: :class:`SecurityPartnerProvidersOperations` - * 2021-02-01: :class:`SecurityPartnerProvidersOperations` - * 2021-03-01: :class:`SecurityPartnerProvidersOperations` - """ - api_version = self._get_api_version('security_partner_providers') - if api_version == '2020-03-01': - from .v2020_03_01.operations import SecurityPartnerProvidersOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import SecurityPartnerProvidersOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import SecurityPartnerProvidersOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import SecurityPartnerProvidersOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import SecurityPartnerProvidersOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import SecurityPartnerProvidersOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import SecurityPartnerProvidersOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import SecurityPartnerProvidersOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import SecurityPartnerProvidersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'security_partner_providers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def security_rules(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`SecurityRulesOperations` - * 2016-09-01: :class:`SecurityRulesOperations` - * 2016-12-01: :class:`SecurityRulesOperations` - * 2017-03-01: :class:`SecurityRulesOperations` - * 2017-06-01: :class:`SecurityRulesOperations` - * 2017-08-01: :class:`SecurityRulesOperations` - * 2017-09-01: :class:`SecurityRulesOperations` - * 2017-10-01: :class:`SecurityRulesOperations` - * 2017-11-01: :class:`SecurityRulesOperations` - * 2018-01-01: :class:`SecurityRulesOperations` - * 2018-02-01: :class:`SecurityRulesOperations` - * 2018-04-01: :class:`SecurityRulesOperations` - * 2018-06-01: :class:`SecurityRulesOperations` - * 2018-07-01: :class:`SecurityRulesOperations` - * 2018-08-01: :class:`SecurityRulesOperations` - * 2018-10-01: :class:`SecurityRulesOperations` - * 2018-11-01: :class:`SecurityRulesOperations` - * 2018-12-01: :class:`SecurityRulesOperations` - * 2019-02-01: :class:`SecurityRulesOperations` - * 2019-04-01: :class:`SecurityRulesOperations` - * 2019-06-01: :class:`SecurityRulesOperations` - * 2019-07-01: :class:`SecurityRulesOperations` - * 2019-08-01: :class:`SecurityRulesOperations` - * 2019-09-01: :class:`SecurityRulesOperations` - * 2019-11-01: :class:`SecurityRulesOperations` - * 2019-12-01: :class:`SecurityRulesOperations` - * 2020-03-01: :class:`SecurityRulesOperations` - * 2020-04-01: :class:`SecurityRulesOperations` - * 2020-05-01: :class:`SecurityRulesOperations` - * 2020-06-01: :class:`SecurityRulesOperations` - * 2020-07-01: :class:`SecurityRulesOperations` - * 2020-08-01: :class:`SecurityRulesOperations` - * 2020-11-01: :class:`SecurityRulesOperations` - * 2021-02-01: :class:`SecurityRulesOperations` - * 2021-03-01: :class:`SecurityRulesOperations` - """ - api_version = self._get_api_version('security_rules') - if api_version == '2015-06-15': - from .v2015_06_15.operations import SecurityRulesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import SecurityRulesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import SecurityRulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'security_rules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def service_association_links(self): - """Instance depends on the API version: - - * 2019-02-01: :class:`ServiceAssociationLinksOperations` - * 2019-04-01: :class:`ServiceAssociationLinksOperations` - * 2019-06-01: :class:`ServiceAssociationLinksOperations` - * 2019-07-01: :class:`ServiceAssociationLinksOperations` - * 2019-08-01: :class:`ServiceAssociationLinksOperations` - * 2019-09-01: :class:`ServiceAssociationLinksOperations` - * 2019-11-01: :class:`ServiceAssociationLinksOperations` - * 2019-12-01: :class:`ServiceAssociationLinksOperations` - * 2020-03-01: :class:`ServiceAssociationLinksOperations` - * 2020-04-01: :class:`ServiceAssociationLinksOperations` - * 2020-05-01: :class:`ServiceAssociationLinksOperations` - * 2020-06-01: :class:`ServiceAssociationLinksOperations` - * 2020-07-01: :class:`ServiceAssociationLinksOperations` - * 2020-08-01: :class:`ServiceAssociationLinksOperations` - * 2020-11-01: :class:`ServiceAssociationLinksOperations` - * 2021-02-01: :class:`ServiceAssociationLinksOperations` - * 2021-03-01: :class:`ServiceAssociationLinksOperations` - """ - api_version = self._get_api_version('service_association_links') - if api_version == '2019-02-01': - from .v2019_02_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ServiceAssociationLinksOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ServiceAssociationLinksOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'service_association_links'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def service_endpoint_policies(self): - """Instance depends on the API version: - - * 2018-07-01: :class:`ServiceEndpointPoliciesOperations` - * 2018-08-01: :class:`ServiceEndpointPoliciesOperations` - * 2018-10-01: :class:`ServiceEndpointPoliciesOperations` - * 2018-11-01: :class:`ServiceEndpointPoliciesOperations` - * 2018-12-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-02-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-04-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-06-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-07-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-08-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-09-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-11-01: :class:`ServiceEndpointPoliciesOperations` - * 2019-12-01: :class:`ServiceEndpointPoliciesOperations` - * 2020-03-01: :class:`ServiceEndpointPoliciesOperations` - * 2020-04-01: :class:`ServiceEndpointPoliciesOperations` - * 2020-05-01: :class:`ServiceEndpointPoliciesOperations` - * 2020-06-01: :class:`ServiceEndpointPoliciesOperations` - * 2020-07-01: :class:`ServiceEndpointPoliciesOperations` - * 2020-08-01: :class:`ServiceEndpointPoliciesOperations` - * 2020-11-01: :class:`ServiceEndpointPoliciesOperations` - * 2021-02-01: :class:`ServiceEndpointPoliciesOperations` - * 2021-03-01: :class:`ServiceEndpointPoliciesOperations` - """ - api_version = self._get_api_version('service_endpoint_policies') - if api_version == '2018-07-01': - from .v2018_07_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ServiceEndpointPoliciesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ServiceEndpointPoliciesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'service_endpoint_policies'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def service_endpoint_policy_definitions(self): - """Instance depends on the API version: - - * 2018-07-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2018-08-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2018-10-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2018-11-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2018-12-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-02-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-04-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-06-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-07-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-08-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-09-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-11-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2019-12-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2020-03-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2020-04-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2020-05-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2020-06-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2020-07-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2020-08-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2020-11-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2021-02-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - * 2021-03-01: :class:`ServiceEndpointPolicyDefinitionsOperations` - """ - api_version = self._get_api_version('service_endpoint_policy_definitions') - if api_version == '2018-07-01': - from .v2018_07_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ServiceEndpointPolicyDefinitionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'service_endpoint_policy_definitions'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def service_tag_information(self): - """Instance depends on the API version: - - * 2021-03-01: :class:`ServiceTagInformationOperations` - """ - api_version = self._get_api_version('service_tag_information') - if api_version == '2021-03-01': - from .v2021_03_01.operations import ServiceTagInformationOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'service_tag_information'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def service_tags(self): - """Instance depends on the API version: - - * 2019-04-01: :class:`ServiceTagsOperations` - * 2019-06-01: :class:`ServiceTagsOperations` - * 2019-07-01: :class:`ServiceTagsOperations` - * 2019-08-01: :class:`ServiceTagsOperations` - * 2019-09-01: :class:`ServiceTagsOperations` - * 2019-11-01: :class:`ServiceTagsOperations` - * 2019-12-01: :class:`ServiceTagsOperations` - * 2020-03-01: :class:`ServiceTagsOperations` - * 2020-04-01: :class:`ServiceTagsOperations` - * 2020-05-01: :class:`ServiceTagsOperations` - * 2020-06-01: :class:`ServiceTagsOperations` - * 2020-07-01: :class:`ServiceTagsOperations` - * 2020-08-01: :class:`ServiceTagsOperations` - * 2020-11-01: :class:`ServiceTagsOperations` - * 2021-02-01: :class:`ServiceTagsOperations` - * 2021-03-01: :class:`ServiceTagsOperations` - """ - api_version = self._get_api_version('service_tags') - if api_version == '2019-04-01': - from .v2019_04_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import ServiceTagsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import ServiceTagsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'service_tags'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def subnets(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`SubnetsOperations` - * 2016-09-01: :class:`SubnetsOperations` - * 2016-12-01: :class:`SubnetsOperations` - * 2017-03-01: :class:`SubnetsOperations` - * 2017-06-01: :class:`SubnetsOperations` - * 2017-08-01: :class:`SubnetsOperations` - * 2017-09-01: :class:`SubnetsOperations` - * 2017-10-01: :class:`SubnetsOperations` - * 2017-11-01: :class:`SubnetsOperations` - * 2018-01-01: :class:`SubnetsOperations` - * 2018-02-01: :class:`SubnetsOperations` - * 2018-04-01: :class:`SubnetsOperations` - * 2018-06-01: :class:`SubnetsOperations` - * 2018-07-01: :class:`SubnetsOperations` - * 2018-08-01: :class:`SubnetsOperations` - * 2018-10-01: :class:`SubnetsOperations` - * 2018-11-01: :class:`SubnetsOperations` - * 2018-12-01: :class:`SubnetsOperations` - * 2019-02-01: :class:`SubnetsOperations` - * 2019-04-01: :class:`SubnetsOperations` - * 2019-06-01: :class:`SubnetsOperations` - * 2019-07-01: :class:`SubnetsOperations` - * 2019-08-01: :class:`SubnetsOperations` - * 2019-09-01: :class:`SubnetsOperations` - * 2019-11-01: :class:`SubnetsOperations` - * 2019-12-01: :class:`SubnetsOperations` - * 2020-03-01: :class:`SubnetsOperations` - * 2020-04-01: :class:`SubnetsOperations` - * 2020-05-01: :class:`SubnetsOperations` - * 2020-06-01: :class:`SubnetsOperations` - * 2020-07-01: :class:`SubnetsOperations` - * 2020-08-01: :class:`SubnetsOperations` - * 2020-11-01: :class:`SubnetsOperations` - * 2021-02-01: :class:`SubnetsOperations` - * 2021-03-01: :class:`SubnetsOperations` - """ - api_version = self._get_api_version('subnets') - if api_version == '2015-06-15': - from .v2015_06_15.operations import SubnetsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import SubnetsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import SubnetsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import SubnetsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import SubnetsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import SubnetsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import SubnetsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import SubnetsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import SubnetsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import SubnetsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import SubnetsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import SubnetsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import SubnetsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import SubnetsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import SubnetsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'subnets'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def usages(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`UsagesOperations` - * 2016-09-01: :class:`UsagesOperations` - * 2016-12-01: :class:`UsagesOperations` - * 2017-03-01: :class:`UsagesOperations` - * 2017-06-01: :class:`UsagesOperations` - * 2017-08-01: :class:`UsagesOperations` - * 2017-09-01: :class:`UsagesOperations` - * 2017-10-01: :class:`UsagesOperations` - * 2017-11-01: :class:`UsagesOperations` - * 2018-01-01: :class:`UsagesOperations` - * 2018-02-01: :class:`UsagesOperations` - * 2018-04-01: :class:`UsagesOperations` - * 2018-06-01: :class:`UsagesOperations` - * 2018-07-01: :class:`UsagesOperations` - * 2018-08-01: :class:`UsagesOperations` - * 2018-10-01: :class:`UsagesOperations` - * 2018-11-01: :class:`UsagesOperations` - * 2018-12-01: :class:`UsagesOperations` - * 2019-02-01: :class:`UsagesOperations` - * 2019-04-01: :class:`UsagesOperations` - * 2019-06-01: :class:`UsagesOperations` - * 2019-07-01: :class:`UsagesOperations` - * 2019-08-01: :class:`UsagesOperations` - * 2019-09-01: :class:`UsagesOperations` - * 2019-11-01: :class:`UsagesOperations` - * 2019-12-01: :class:`UsagesOperations` - * 2020-03-01: :class:`UsagesOperations` - * 2020-04-01: :class:`UsagesOperations` - * 2020-05-01: :class:`UsagesOperations` - * 2020-06-01: :class:`UsagesOperations` - * 2020-07-01: :class:`UsagesOperations` - * 2020-08-01: :class:`UsagesOperations` - * 2020-11-01: :class:`UsagesOperations` - * 2021-02-01: :class:`UsagesOperations` - * 2021-03-01: :class:`UsagesOperations` - """ - api_version = self._get_api_version('usages') - if api_version == '2015-06-15': - from .v2015_06_15.operations import UsagesOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import UsagesOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import UsagesOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import UsagesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import UsagesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import UsagesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import UsagesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import UsagesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import UsagesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import UsagesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import UsagesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import UsagesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import UsagesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import UsagesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import UsagesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'usages'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_appliance_sites(self): - """Instance depends on the API version: - - * 2020-05-01: :class:`VirtualApplianceSitesOperations` - * 2020-06-01: :class:`VirtualApplianceSitesOperations` - * 2020-07-01: :class:`VirtualApplianceSitesOperations` - * 2020-08-01: :class:`VirtualApplianceSitesOperations` - * 2020-11-01: :class:`VirtualApplianceSitesOperations` - * 2021-02-01: :class:`VirtualApplianceSitesOperations` - * 2021-03-01: :class:`VirtualApplianceSitesOperations` - """ - api_version = self._get_api_version('virtual_appliance_sites') - if api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualApplianceSitesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualApplianceSitesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualApplianceSitesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualApplianceSitesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualApplianceSitesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualApplianceSitesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualApplianceSitesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_appliance_sites'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_appliance_skus(self): - """Instance depends on the API version: - - * 2020-05-01: :class:`VirtualApplianceSkusOperations` - * 2020-06-01: :class:`VirtualApplianceSkusOperations` - * 2020-07-01: :class:`VirtualApplianceSkusOperations` - * 2020-08-01: :class:`VirtualApplianceSkusOperations` - * 2020-11-01: :class:`VirtualApplianceSkusOperations` - * 2021-02-01: :class:`VirtualApplianceSkusOperations` - * 2021-03-01: :class:`VirtualApplianceSkusOperations` - """ - api_version = self._get_api_version('virtual_appliance_skus') - if api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualApplianceSkusOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualApplianceSkusOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualApplianceSkusOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualApplianceSkusOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualApplianceSkusOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualApplianceSkusOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualApplianceSkusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_appliance_skus'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_hub_bgp_connection(self): - """Instance depends on the API version: - - * 2020-05-01: :class:`VirtualHubBgpConnectionOperations` - * 2020-06-01: :class:`VirtualHubBgpConnectionOperations` - * 2020-07-01: :class:`VirtualHubBgpConnectionOperations` - * 2020-08-01: :class:`VirtualHubBgpConnectionOperations` - * 2020-11-01: :class:`VirtualHubBgpConnectionOperations` - * 2021-02-01: :class:`VirtualHubBgpConnectionOperations` - * 2021-03-01: :class:`VirtualHubBgpConnectionOperations` - """ - api_version = self._get_api_version('virtual_hub_bgp_connection') - if api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualHubBgpConnectionOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualHubBgpConnectionOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualHubBgpConnectionOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualHubBgpConnectionOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualHubBgpConnectionOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualHubBgpConnectionOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualHubBgpConnectionOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_hub_bgp_connection'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_hub_bgp_connections(self): - """Instance depends on the API version: - - * 2020-05-01: :class:`VirtualHubBgpConnectionsOperations` - * 2020-06-01: :class:`VirtualHubBgpConnectionsOperations` - * 2020-07-01: :class:`VirtualHubBgpConnectionsOperations` - * 2020-08-01: :class:`VirtualHubBgpConnectionsOperations` - * 2020-11-01: :class:`VirtualHubBgpConnectionsOperations` - * 2021-02-01: :class:`VirtualHubBgpConnectionsOperations` - * 2021-03-01: :class:`VirtualHubBgpConnectionsOperations` - """ - api_version = self._get_api_version('virtual_hub_bgp_connections') - if api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualHubBgpConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualHubBgpConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualHubBgpConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualHubBgpConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualHubBgpConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualHubBgpConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualHubBgpConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_hub_bgp_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_hub_ip_configuration(self): - """Instance depends on the API version: - - * 2020-05-01: :class:`VirtualHubIpConfigurationOperations` - * 2020-06-01: :class:`VirtualHubIpConfigurationOperations` - * 2020-07-01: :class:`VirtualHubIpConfigurationOperations` - * 2020-08-01: :class:`VirtualHubIpConfigurationOperations` - * 2020-11-01: :class:`VirtualHubIpConfigurationOperations` - * 2021-02-01: :class:`VirtualHubIpConfigurationOperations` - * 2021-03-01: :class:`VirtualHubIpConfigurationOperations` - """ - api_version = self._get_api_version('virtual_hub_ip_configuration') - if api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualHubIpConfigurationOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualHubIpConfigurationOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualHubIpConfigurationOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualHubIpConfigurationOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualHubIpConfigurationOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualHubIpConfigurationOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualHubIpConfigurationOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_hub_ip_configuration'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_hub_route_table_v2_s(self): - """Instance depends on the API version: - - * 2019-09-01: :class:`VirtualHubRouteTableV2SOperations` - * 2019-11-01: :class:`VirtualHubRouteTableV2SOperations` - * 2019-12-01: :class:`VirtualHubRouteTableV2SOperations` - * 2020-03-01: :class:`VirtualHubRouteTableV2SOperations` - * 2020-04-01: :class:`VirtualHubRouteTableV2SOperations` - * 2020-05-01: :class:`VirtualHubRouteTableV2SOperations` - * 2020-06-01: :class:`VirtualHubRouteTableV2SOperations` - * 2020-07-01: :class:`VirtualHubRouteTableV2SOperations` - * 2020-08-01: :class:`VirtualHubRouteTableV2SOperations` - * 2020-11-01: :class:`VirtualHubRouteTableV2SOperations` - * 2021-02-01: :class:`VirtualHubRouteTableV2SOperations` - * 2021-03-01: :class:`VirtualHubRouteTableV2SOperations` - """ - api_version = self._get_api_version('virtual_hub_route_table_v2_s') - if api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualHubRouteTableV2SOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_hub_route_table_v2_s'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_hubs(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VirtualHubsOperations` - * 2018-06-01: :class:`VirtualHubsOperations` - * 2018-07-01: :class:`VirtualHubsOperations` - * 2018-08-01: :class:`VirtualHubsOperations` - * 2018-10-01: :class:`VirtualHubsOperations` - * 2018-11-01: :class:`VirtualHubsOperations` - * 2018-12-01: :class:`VirtualHubsOperations` - * 2019-02-01: :class:`VirtualHubsOperations` - * 2019-04-01: :class:`VirtualHubsOperations` - * 2019-06-01: :class:`VirtualHubsOperations` - * 2019-07-01: :class:`VirtualHubsOperations` - * 2019-08-01: :class:`VirtualHubsOperations` - * 2019-09-01: :class:`VirtualHubsOperations` - * 2019-11-01: :class:`VirtualHubsOperations` - * 2019-12-01: :class:`VirtualHubsOperations` - * 2020-03-01: :class:`VirtualHubsOperations` - * 2020-04-01: :class:`VirtualHubsOperations` - * 2020-05-01: :class:`VirtualHubsOperations` - * 2020-06-01: :class:`VirtualHubsOperations` - * 2020-07-01: :class:`VirtualHubsOperations` - * 2020-08-01: :class:`VirtualHubsOperations` - * 2020-11-01: :class:`VirtualHubsOperations` - * 2021-02-01: :class:`VirtualHubsOperations` - * 2021-03-01: :class:`VirtualHubsOperations` - """ - api_version = self._get_api_version('virtual_hubs') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualHubsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualHubsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_hubs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_network_gateway_connections(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2016-09-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2016-12-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-03-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-08-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-09-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-10-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2017-11-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-01-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-02-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-07-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-08-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-10-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-11-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2018-12-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-02-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-07-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-08-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-09-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-11-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2019-12-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2020-03-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2020-04-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2020-05-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2020-06-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2020-07-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2020-08-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2020-11-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2021-02-01: :class:`VirtualNetworkGatewayConnectionsOperations` - * 2021-03-01: :class:`VirtualNetworkGatewayConnectionsOperations` - """ - api_version = self._get_api_version('virtual_network_gateway_connections') - if api_version == '2015-06-15': - from .v2015_06_15.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualNetworkGatewayConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_network_gateway_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_network_gateway_nat_rules(self): - """Instance depends on the API version: - - * 2021-02-01: :class:`VirtualNetworkGatewayNatRulesOperations` - * 2021-03-01: :class:`VirtualNetworkGatewayNatRulesOperations` - """ - api_version = self._get_api_version('virtual_network_gateway_nat_rules') - if api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualNetworkGatewayNatRulesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualNetworkGatewayNatRulesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_network_gateway_nat_rules'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_network_gateways(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualNetworkGatewaysOperations` - * 2016-09-01: :class:`VirtualNetworkGatewaysOperations` - * 2016-12-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-03-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-06-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-08-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-09-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-10-01: :class:`VirtualNetworkGatewaysOperations` - * 2017-11-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-01-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-02-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-04-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-06-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-07-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-08-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-10-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-11-01: :class:`VirtualNetworkGatewaysOperations` - * 2018-12-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-02-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-04-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-06-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-07-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-08-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-09-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-11-01: :class:`VirtualNetworkGatewaysOperations` - * 2019-12-01: :class:`VirtualNetworkGatewaysOperations` - * 2020-03-01: :class:`VirtualNetworkGatewaysOperations` - * 2020-04-01: :class:`VirtualNetworkGatewaysOperations` - * 2020-05-01: :class:`VirtualNetworkGatewaysOperations` - * 2020-06-01: :class:`VirtualNetworkGatewaysOperations` - * 2020-07-01: :class:`VirtualNetworkGatewaysOperations` - * 2020-08-01: :class:`VirtualNetworkGatewaysOperations` - * 2020-11-01: :class:`VirtualNetworkGatewaysOperations` - * 2021-02-01: :class:`VirtualNetworkGatewaysOperations` - * 2021-03-01: :class:`VirtualNetworkGatewaysOperations` - """ - api_version = self._get_api_version('virtual_network_gateways') - if api_version == '2015-06-15': - from .v2015_06_15.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualNetworkGatewaysOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualNetworkGatewaysOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_network_gateways'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_network_peerings(self): - """Instance depends on the API version: - - * 2016-09-01: :class:`VirtualNetworkPeeringsOperations` - * 2016-12-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-03-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-06-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-08-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-09-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-10-01: :class:`VirtualNetworkPeeringsOperations` - * 2017-11-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-01-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-02-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-04-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-06-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-07-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-08-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-10-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-11-01: :class:`VirtualNetworkPeeringsOperations` - * 2018-12-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-02-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-04-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-06-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-07-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-08-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-09-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-11-01: :class:`VirtualNetworkPeeringsOperations` - * 2019-12-01: :class:`VirtualNetworkPeeringsOperations` - * 2020-03-01: :class:`VirtualNetworkPeeringsOperations` - * 2020-04-01: :class:`VirtualNetworkPeeringsOperations` - * 2020-05-01: :class:`VirtualNetworkPeeringsOperations` - * 2020-06-01: :class:`VirtualNetworkPeeringsOperations` - * 2020-07-01: :class:`VirtualNetworkPeeringsOperations` - * 2020-08-01: :class:`VirtualNetworkPeeringsOperations` - * 2020-11-01: :class:`VirtualNetworkPeeringsOperations` - * 2021-02-01: :class:`VirtualNetworkPeeringsOperations` - * 2021-03-01: :class:`VirtualNetworkPeeringsOperations` - """ - api_version = self._get_api_version('virtual_network_peerings') - if api_version == '2016-09-01': - from .v2016_09_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualNetworkPeeringsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualNetworkPeeringsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_network_peerings'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_network_taps(self): - """Instance depends on the API version: - - * 2018-08-01: :class:`VirtualNetworkTapsOperations` - * 2018-10-01: :class:`VirtualNetworkTapsOperations` - * 2018-11-01: :class:`VirtualNetworkTapsOperations` - * 2018-12-01: :class:`VirtualNetworkTapsOperations` - * 2019-02-01: :class:`VirtualNetworkTapsOperations` - * 2019-04-01: :class:`VirtualNetworkTapsOperations` - * 2019-06-01: :class:`VirtualNetworkTapsOperations` - * 2019-07-01: :class:`VirtualNetworkTapsOperations` - * 2019-08-01: :class:`VirtualNetworkTapsOperations` - * 2019-09-01: :class:`VirtualNetworkTapsOperations` - * 2019-11-01: :class:`VirtualNetworkTapsOperations` - * 2019-12-01: :class:`VirtualNetworkTapsOperations` - * 2020-03-01: :class:`VirtualNetworkTapsOperations` - * 2020-04-01: :class:`VirtualNetworkTapsOperations` - * 2020-05-01: :class:`VirtualNetworkTapsOperations` - * 2020-06-01: :class:`VirtualNetworkTapsOperations` - * 2020-07-01: :class:`VirtualNetworkTapsOperations` - * 2020-08-01: :class:`VirtualNetworkTapsOperations` - * 2020-11-01: :class:`VirtualNetworkTapsOperations` - * 2021-02-01: :class:`VirtualNetworkTapsOperations` - * 2021-03-01: :class:`VirtualNetworkTapsOperations` - """ - api_version = self._get_api_version('virtual_network_taps') - if api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualNetworkTapsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualNetworkTapsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_network_taps'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_networks(self): - """Instance depends on the API version: - - * 2015-06-15: :class:`VirtualNetworksOperations` - * 2016-09-01: :class:`VirtualNetworksOperations` - * 2016-12-01: :class:`VirtualNetworksOperations` - * 2017-03-01: :class:`VirtualNetworksOperations` - * 2017-06-01: :class:`VirtualNetworksOperations` - * 2017-08-01: :class:`VirtualNetworksOperations` - * 2017-09-01: :class:`VirtualNetworksOperations` - * 2017-10-01: :class:`VirtualNetworksOperations` - * 2017-11-01: :class:`VirtualNetworksOperations` - * 2018-01-01: :class:`VirtualNetworksOperations` - * 2018-02-01: :class:`VirtualNetworksOperations` - * 2018-04-01: :class:`VirtualNetworksOperations` - * 2018-06-01: :class:`VirtualNetworksOperations` - * 2018-07-01: :class:`VirtualNetworksOperations` - * 2018-08-01: :class:`VirtualNetworksOperations` - * 2018-10-01: :class:`VirtualNetworksOperations` - * 2018-11-01: :class:`VirtualNetworksOperations` - * 2018-12-01: :class:`VirtualNetworksOperations` - * 2019-02-01: :class:`VirtualNetworksOperations` - * 2019-04-01: :class:`VirtualNetworksOperations` - * 2019-06-01: :class:`VirtualNetworksOperations` - * 2019-07-01: :class:`VirtualNetworksOperations` - * 2019-08-01: :class:`VirtualNetworksOperations` - * 2019-09-01: :class:`VirtualNetworksOperations` - * 2019-11-01: :class:`VirtualNetworksOperations` - * 2019-12-01: :class:`VirtualNetworksOperations` - * 2020-03-01: :class:`VirtualNetworksOperations` - * 2020-04-01: :class:`VirtualNetworksOperations` - * 2020-05-01: :class:`VirtualNetworksOperations` - * 2020-06-01: :class:`VirtualNetworksOperations` - * 2020-07-01: :class:`VirtualNetworksOperations` - * 2020-08-01: :class:`VirtualNetworksOperations` - * 2020-11-01: :class:`VirtualNetworksOperations` - * 2021-02-01: :class:`VirtualNetworksOperations` - * 2021-03-01: :class:`VirtualNetworksOperations` - """ - api_version = self._get_api_version('virtual_networks') - if api_version == '2015-06-15': - from .v2015_06_15.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2016-09-01': - from .v2016_09_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2016-12-01': - from .v2016_12_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-03-01': - from .v2017_03_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-06-01': - from .v2017_06_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-08-01': - from .v2017_08_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-09-01': - from .v2017_09_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-10-01': - from .v2017_10_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2017-11-01': - from .v2017_11_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-01-01': - from .v2018_01_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-02-01': - from .v2018_02_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualNetworksOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualNetworksOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_networks'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_router_peerings(self): - """Instance depends on the API version: - - * 2019-07-01: :class:`VirtualRouterPeeringsOperations` - * 2019-08-01: :class:`VirtualRouterPeeringsOperations` - * 2019-09-01: :class:`VirtualRouterPeeringsOperations` - * 2019-11-01: :class:`VirtualRouterPeeringsOperations` - * 2019-12-01: :class:`VirtualRouterPeeringsOperations` - * 2020-03-01: :class:`VirtualRouterPeeringsOperations` - * 2020-04-01: :class:`VirtualRouterPeeringsOperations` - * 2020-05-01: :class:`VirtualRouterPeeringsOperations` - * 2020-06-01: :class:`VirtualRouterPeeringsOperations` - * 2020-07-01: :class:`VirtualRouterPeeringsOperations` - * 2020-08-01: :class:`VirtualRouterPeeringsOperations` - * 2020-11-01: :class:`VirtualRouterPeeringsOperations` - * 2021-02-01: :class:`VirtualRouterPeeringsOperations` - * 2021-03-01: :class:`VirtualRouterPeeringsOperations` - """ - api_version = self._get_api_version('virtual_router_peerings') - if api_version == '2019-07-01': - from .v2019_07_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualRouterPeeringsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualRouterPeeringsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_router_peerings'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_routers(self): - """Instance depends on the API version: - - * 2019-07-01: :class:`VirtualRoutersOperations` - * 2019-08-01: :class:`VirtualRoutersOperations` - * 2019-09-01: :class:`VirtualRoutersOperations` - * 2019-11-01: :class:`VirtualRoutersOperations` - * 2019-12-01: :class:`VirtualRoutersOperations` - * 2020-03-01: :class:`VirtualRoutersOperations` - * 2020-04-01: :class:`VirtualRoutersOperations` - * 2020-05-01: :class:`VirtualRoutersOperations` - * 2020-06-01: :class:`VirtualRoutersOperations` - * 2020-07-01: :class:`VirtualRoutersOperations` - * 2020-08-01: :class:`VirtualRoutersOperations` - * 2020-11-01: :class:`VirtualRoutersOperations` - * 2021-02-01: :class:`VirtualRoutersOperations` - * 2021-03-01: :class:`VirtualRoutersOperations` - """ - api_version = self._get_api_version('virtual_routers') - if api_version == '2019-07-01': - from .v2019_07_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualRoutersOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualRoutersOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_routers'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def virtual_wans(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VirtualWANsOperations` - * 2018-06-01: :class:`VirtualWANsOperations` - * 2018-07-01: :class:`VirtualWANsOperations` - * 2018-08-01: :class:`VirtualWansOperations` - * 2018-10-01: :class:`VirtualWansOperations` - * 2018-11-01: :class:`VirtualWansOperations` - * 2018-12-01: :class:`VirtualWansOperations` - * 2019-02-01: :class:`VirtualWansOperations` - * 2019-04-01: :class:`VirtualWansOperations` - * 2019-06-01: :class:`VirtualWansOperations` - * 2019-07-01: :class:`VirtualWansOperations` - * 2019-08-01: :class:`VirtualWansOperations` - * 2019-09-01: :class:`VirtualWansOperations` - * 2019-11-01: :class:`VirtualWansOperations` - * 2019-12-01: :class:`VirtualWansOperations` - * 2020-03-01: :class:`VirtualWansOperations` - * 2020-04-01: :class:`VirtualWansOperations` - * 2020-05-01: :class:`VirtualWansOperations` - * 2020-06-01: :class:`VirtualWansOperations` - * 2020-07-01: :class:`VirtualWansOperations` - * 2020-08-01: :class:`VirtualWansOperations` - * 2020-11-01: :class:`VirtualWansOperations` - * 2021-02-01: :class:`VirtualWansOperations` - * 2021-03-01: :class:`VirtualWansOperations` - """ - api_version = self._get_api_version('virtual_wans') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VirtualWANsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VirtualWANsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VirtualWANsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VirtualWansOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VirtualWansOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'virtual_wans'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def vpn_connections(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VpnConnectionsOperations` - * 2018-06-01: :class:`VpnConnectionsOperations` - * 2018-07-01: :class:`VpnConnectionsOperations` - * 2018-08-01: :class:`VpnConnectionsOperations` - * 2018-10-01: :class:`VpnConnectionsOperations` - * 2018-11-01: :class:`VpnConnectionsOperations` - * 2018-12-01: :class:`VpnConnectionsOperations` - * 2019-02-01: :class:`VpnConnectionsOperations` - * 2019-04-01: :class:`VpnConnectionsOperations` - * 2019-06-01: :class:`VpnConnectionsOperations` - * 2019-07-01: :class:`VpnConnectionsOperations` - * 2019-08-01: :class:`VpnConnectionsOperations` - * 2019-09-01: :class:`VpnConnectionsOperations` - * 2019-11-01: :class:`VpnConnectionsOperations` - * 2019-12-01: :class:`VpnConnectionsOperations` - * 2020-03-01: :class:`VpnConnectionsOperations` - * 2020-04-01: :class:`VpnConnectionsOperations` - * 2020-05-01: :class:`VpnConnectionsOperations` - * 2020-06-01: :class:`VpnConnectionsOperations` - * 2020-07-01: :class:`VpnConnectionsOperations` - * 2020-08-01: :class:`VpnConnectionsOperations` - * 2020-11-01: :class:`VpnConnectionsOperations` - * 2021-02-01: :class:`VpnConnectionsOperations` - * 2021-03-01: :class:`VpnConnectionsOperations` - """ - api_version = self._get_api_version('vpn_connections') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VpnConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VpnConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'vpn_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def vpn_gateways(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VpnGatewaysOperations` - * 2018-06-01: :class:`VpnGatewaysOperations` - * 2018-07-01: :class:`VpnGatewaysOperations` - * 2018-08-01: :class:`VpnGatewaysOperations` - * 2018-10-01: :class:`VpnGatewaysOperations` - * 2018-11-01: :class:`VpnGatewaysOperations` - * 2018-12-01: :class:`VpnGatewaysOperations` - * 2019-02-01: :class:`VpnGatewaysOperations` - * 2019-04-01: :class:`VpnGatewaysOperations` - * 2019-06-01: :class:`VpnGatewaysOperations` - * 2019-07-01: :class:`VpnGatewaysOperations` - * 2019-08-01: :class:`VpnGatewaysOperations` - * 2019-09-01: :class:`VpnGatewaysOperations` - * 2019-11-01: :class:`VpnGatewaysOperations` - * 2019-12-01: :class:`VpnGatewaysOperations` - * 2020-03-01: :class:`VpnGatewaysOperations` - * 2020-04-01: :class:`VpnGatewaysOperations` - * 2020-05-01: :class:`VpnGatewaysOperations` - * 2020-06-01: :class:`VpnGatewaysOperations` - * 2020-07-01: :class:`VpnGatewaysOperations` - * 2020-08-01: :class:`VpnGatewaysOperations` - * 2020-11-01: :class:`VpnGatewaysOperations` - * 2021-02-01: :class:`VpnGatewaysOperations` - * 2021-03-01: :class:`VpnGatewaysOperations` - """ - api_version = self._get_api_version('vpn_gateways') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VpnGatewaysOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VpnGatewaysOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'vpn_gateways'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def vpn_link_connections(self): - """Instance depends on the API version: - - * 2019-06-01: :class:`VpnLinkConnectionsOperations` - * 2019-07-01: :class:`VpnLinkConnectionsOperations` - * 2019-08-01: :class:`VpnLinkConnectionsOperations` - * 2019-09-01: :class:`VpnLinkConnectionsOperations` - * 2019-11-01: :class:`VpnLinkConnectionsOperations` - * 2019-12-01: :class:`VpnLinkConnectionsOperations` - * 2020-03-01: :class:`VpnLinkConnectionsOperations` - * 2020-04-01: :class:`VpnLinkConnectionsOperations` - * 2020-05-01: :class:`VpnLinkConnectionsOperations` - * 2020-06-01: :class:`VpnLinkConnectionsOperations` - * 2020-07-01: :class:`VpnLinkConnectionsOperations` - * 2020-08-01: :class:`VpnLinkConnectionsOperations` - * 2020-11-01: :class:`VpnLinkConnectionsOperations` - * 2021-02-01: :class:`VpnLinkConnectionsOperations` - * 2021-03-01: :class:`VpnLinkConnectionsOperations` - """ - api_version = self._get_api_version('vpn_link_connections') - if api_version == '2019-06-01': - from .v2019_06_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VpnLinkConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VpnLinkConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'vpn_link_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def vpn_server_configurations(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`VpnServerConfigurationsOperations` - * 2019-09-01: :class:`VpnServerConfigurationsOperations` - * 2019-11-01: :class:`VpnServerConfigurationsOperations` - * 2019-12-01: :class:`VpnServerConfigurationsOperations` - * 2020-03-01: :class:`VpnServerConfigurationsOperations` - * 2020-04-01: :class:`VpnServerConfigurationsOperations` - * 2020-05-01: :class:`VpnServerConfigurationsOperations` - * 2020-06-01: :class:`VpnServerConfigurationsOperations` - * 2020-07-01: :class:`VpnServerConfigurationsOperations` - * 2020-08-01: :class:`VpnServerConfigurationsOperations` - * 2020-11-01: :class:`VpnServerConfigurationsOperations` - * 2021-02-01: :class:`VpnServerConfigurationsOperations` - * 2021-03-01: :class:`VpnServerConfigurationsOperations` - """ - api_version = self._get_api_version('vpn_server_configurations') - if api_version == '2019-08-01': - from .v2019_08_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VpnServerConfigurationsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VpnServerConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'vpn_server_configurations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def vpn_server_configurations_associated_with_virtual_wan(self): - """Instance depends on the API version: - - * 2019-08-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2019-09-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2019-11-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2019-12-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2020-03-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2020-04-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2020-05-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2020-06-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2020-07-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2020-08-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2020-11-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2021-02-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - * 2021-03-01: :class:`VpnServerConfigurationsAssociatedWithVirtualWanOperations` - """ - api_version = self._get_api_version('vpn_server_configurations_associated_with_virtual_wan') - if api_version == '2019-08-01': - from .v2019_08_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VpnServerConfigurationsAssociatedWithVirtualWanOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'vpn_server_configurations_associated_with_virtual_wan'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def vpn_site_link_connections(self): - """Instance depends on the API version: - - * 2019-06-01: :class:`VpnSiteLinkConnectionsOperations` - * 2019-07-01: :class:`VpnSiteLinkConnectionsOperations` - * 2019-08-01: :class:`VpnSiteLinkConnectionsOperations` - * 2019-09-01: :class:`VpnSiteLinkConnectionsOperations` - * 2019-11-01: :class:`VpnSiteLinkConnectionsOperations` - * 2019-12-01: :class:`VpnSiteLinkConnectionsOperations` - * 2020-03-01: :class:`VpnSiteLinkConnectionsOperations` - * 2020-04-01: :class:`VpnSiteLinkConnectionsOperations` - * 2020-05-01: :class:`VpnSiteLinkConnectionsOperations` - * 2020-06-01: :class:`VpnSiteLinkConnectionsOperations` - * 2020-07-01: :class:`VpnSiteLinkConnectionsOperations` - * 2020-08-01: :class:`VpnSiteLinkConnectionsOperations` - * 2020-11-01: :class:`VpnSiteLinkConnectionsOperations` - * 2021-02-01: :class:`VpnSiteLinkConnectionsOperations` - * 2021-03-01: :class:`VpnSiteLinkConnectionsOperations` - """ - api_version = self._get_api_version('vpn_site_link_connections') - if api_version == '2019-06-01': - from .v2019_06_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VpnSiteLinkConnectionsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'vpn_site_link_connections'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def vpn_site_links(self): - """Instance depends on the API version: - - * 2019-06-01: :class:`VpnSiteLinksOperations` - * 2019-07-01: :class:`VpnSiteLinksOperations` - * 2019-08-01: :class:`VpnSiteLinksOperations` - * 2019-09-01: :class:`VpnSiteLinksOperations` - * 2019-11-01: :class:`VpnSiteLinksOperations` - * 2019-12-01: :class:`VpnSiteLinksOperations` - * 2020-03-01: :class:`VpnSiteLinksOperations` - * 2020-04-01: :class:`VpnSiteLinksOperations` - * 2020-05-01: :class:`VpnSiteLinksOperations` - * 2020-06-01: :class:`VpnSiteLinksOperations` - * 2020-07-01: :class:`VpnSiteLinksOperations` - * 2020-08-01: :class:`VpnSiteLinksOperations` - * 2020-11-01: :class:`VpnSiteLinksOperations` - * 2021-02-01: :class:`VpnSiteLinksOperations` - * 2021-03-01: :class:`VpnSiteLinksOperations` - """ - api_version = self._get_api_version('vpn_site_links') - if api_version == '2019-06-01': - from .v2019_06_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VpnSiteLinksOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VpnSiteLinksOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'vpn_site_links'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def vpn_sites(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VpnSitesOperations` - * 2018-06-01: :class:`VpnSitesOperations` - * 2018-07-01: :class:`VpnSitesOperations` - * 2018-08-01: :class:`VpnSitesOperations` - * 2018-10-01: :class:`VpnSitesOperations` - * 2018-11-01: :class:`VpnSitesOperations` - * 2018-12-01: :class:`VpnSitesOperations` - * 2019-02-01: :class:`VpnSitesOperations` - * 2019-04-01: :class:`VpnSitesOperations` - * 2019-06-01: :class:`VpnSitesOperations` - * 2019-07-01: :class:`VpnSitesOperations` - * 2019-08-01: :class:`VpnSitesOperations` - * 2019-09-01: :class:`VpnSitesOperations` - * 2019-11-01: :class:`VpnSitesOperations` - * 2019-12-01: :class:`VpnSitesOperations` - * 2020-03-01: :class:`VpnSitesOperations` - * 2020-04-01: :class:`VpnSitesOperations` - * 2020-05-01: :class:`VpnSitesOperations` - * 2020-06-01: :class:`VpnSitesOperations` - * 2020-07-01: :class:`VpnSitesOperations` - * 2020-08-01: :class:`VpnSitesOperations` - * 2020-11-01: :class:`VpnSitesOperations` - * 2021-02-01: :class:`VpnSitesOperations` - * 2021-03-01: :class:`VpnSitesOperations` - """ - api_version = self._get_api_version('vpn_sites') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VpnSitesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VpnSitesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'vpn_sites'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def vpn_sites_configuration(self): - """Instance depends on the API version: - - * 2018-04-01: :class:`VpnSitesConfigurationOperations` - * 2018-06-01: :class:`VpnSitesConfigurationOperations` - * 2018-07-01: :class:`VpnSitesConfigurationOperations` - * 2018-08-01: :class:`VpnSitesConfigurationOperations` - * 2018-10-01: :class:`VpnSitesConfigurationOperations` - * 2018-11-01: :class:`VpnSitesConfigurationOperations` - * 2018-12-01: :class:`VpnSitesConfigurationOperations` - * 2019-02-01: :class:`VpnSitesConfigurationOperations` - * 2019-04-01: :class:`VpnSitesConfigurationOperations` - * 2019-06-01: :class:`VpnSitesConfigurationOperations` - * 2019-07-01: :class:`VpnSitesConfigurationOperations` - * 2019-08-01: :class:`VpnSitesConfigurationOperations` - * 2019-09-01: :class:`VpnSitesConfigurationOperations` - * 2019-11-01: :class:`VpnSitesConfigurationOperations` - * 2019-12-01: :class:`VpnSitesConfigurationOperations` - * 2020-03-01: :class:`VpnSitesConfigurationOperations` - * 2020-04-01: :class:`VpnSitesConfigurationOperations` - * 2020-05-01: :class:`VpnSitesConfigurationOperations` - * 2020-06-01: :class:`VpnSitesConfigurationOperations` - * 2020-07-01: :class:`VpnSitesConfigurationOperations` - * 2020-08-01: :class:`VpnSitesConfigurationOperations` - * 2020-11-01: :class:`VpnSitesConfigurationOperations` - * 2021-02-01: :class:`VpnSitesConfigurationOperations` - * 2021-03-01: :class:`VpnSitesConfigurationOperations` - """ - api_version = self._get_api_version('vpn_sites_configuration') - if api_version == '2018-04-01': - from .v2018_04_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-06-01': - from .v2018_06_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-07-01': - from .v2018_07_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-08-01': - from .v2018_08_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-10-01': - from .v2018_10_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-11-01': - from .v2018_11_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2018-12-01': - from .v2018_12_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import VpnSitesConfigurationOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import VpnSitesConfigurationOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'vpn_sites_configuration'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def web_application_firewall_policies(self): - """Instance depends on the API version: - - * 2018-12-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-02-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-04-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-06-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-07-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-08-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-09-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-11-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2019-12-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2020-03-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2020-04-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2020-05-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2020-06-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2020-07-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2020-08-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2020-11-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2021-02-01: :class:`WebApplicationFirewallPoliciesOperations` - * 2021-03-01: :class:`WebApplicationFirewallPoliciesOperations` - """ - api_version = self._get_api_version('web_application_firewall_policies') - if api_version == '2018-12-01': - from .v2018_12_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-02-01': - from .v2019_02_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-04-01': - from .v2019_04_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-06-01': - from .v2019_06_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-07-01': - from .v2019_07_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-08-01': - from .v2019_08_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-09-01': - from .v2019_09_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-11-01': - from .v2019_11_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2019-12-01': - from .v2019_12_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2020-03-01': - from .v2020_03_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2020-04-01': - from .v2020_04_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2020-05-01': - from .v2020_05_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2020-06-01': - from .v2020_06_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2020-07-01': - from .v2020_07_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebApplicationFirewallPoliciesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'web_application_firewall_policies'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def web_categories(self): - """Instance depends on the API version: - - * 2020-07-01: :class:`WebCategoriesOperations` - * 2020-08-01: :class:`WebCategoriesOperations` - * 2020-11-01: :class:`WebCategoriesOperations` - * 2021-02-01: :class:`WebCategoriesOperations` - * 2021-03-01: :class:`WebCategoriesOperations` - """ - api_version = self._get_api_version('web_categories') - if api_version == '2020-07-01': - from .v2020_07_01.operations import WebCategoriesOperations as OperationClass - elif api_version == '2020-08-01': - from .v2020_08_01.operations import WebCategoriesOperations as OperationClass - elif api_version == '2020-11-01': - from .v2020_11_01.operations import WebCategoriesOperations as OperationClass - elif api_version == '2021-02-01': - from .v2021_02_01.operations import WebCategoriesOperations as OperationClass - elif api_version == '2021-03-01': - from .v2021_03_01.operations import WebCategoriesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'web_categories'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - def close(self): - self._client.close() - def __enter__(self): - self._client.__enter__() - return self - def __exit__(self, *exc_details): - self._client.__exit__(*exc_details) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/__init__.py deleted file mode 100644 index cbe2d6051b9f..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._network_management_client import NetworkManagementClient -from ._version import VERSION - -__version__ = VERSION -__all__ = ['NetworkManagementClient'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_configuration.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_configuration.py deleted file mode 100644 index 02b69458ecf3..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_configuration.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -from ._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - - -class NetworkManagementClientConfiguration(Configuration): - """Configuration for NetworkManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - :type subscription_id: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - super(NetworkManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-network/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_metadata.json b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_metadata.json deleted file mode 100644 index 5823936ee457..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_metadata.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "chosen_version": "2017-08-01", - "total_api_version_list": ["2017-03-30", "2017-08-01"], - "client": { - "name": "NetworkManagementClient", - "filename": "_network_management_client", - "description": "Network Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, - "azure_arm": true, - "has_lro_operations": true, - "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"NetworkManagementClientConfiguration\"], \"._operations_mixin\": [\"NetworkManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"NetworkManagementClientConfiguration\"], \"._operations_mixin\": [\"NetworkManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential: \"AsyncTokenCredential\",", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id: str,", - "description": "The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id", - "service_client_specific": { - "sync": { - "api_version": { - "signature": "api_version=None, # type: Optional[str]", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url=None, # type: Optional[str]", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile=KnownProfiles.default, # type: KnownProfiles", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - }, - "async": { - "api_version": { - "signature": "api_version: Optional[str] = None,", - "description": "API version to use if no profile is provided, or if missing in profile.", - "docstring_type": "str", - "required": false - }, - "base_url": { - "signature": "base_url: Optional[str] = None,", - "description": "Service URL", - "docstring_type": "str", - "required": false - }, - "profile": { - "signature": "profile: KnownProfiles = KnownProfiles.default,", - "description": "A profile definition, from KnownProfiles to dict.", - "docstring_type": "azure.profiles.KnownProfiles", - "required": false - } - } - } - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null, - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" - }, - "operation_groups": { - "application_gateways": "ApplicationGatewaysOperations", - "available_endpoint_services": "AvailableEndpointServicesOperations", - "express_route_circuit_authorizations": "ExpressRouteCircuitAuthorizationsOperations", - "express_route_circuit_peerings": "ExpressRouteCircuitPeeringsOperations", - "express_route_circuits": "ExpressRouteCircuitsOperations", - "express_route_service_providers": "ExpressRouteServiceProvidersOperations", - "load_balancers": "LoadBalancersOperations", - "load_balancer_backend_address_pools": "LoadBalancerBackendAddressPoolsOperations", - "load_balancer_frontend_ip_configurations": "LoadBalancerFrontendIPConfigurationsOperations", - "inbound_nat_rules": "InboundNatRulesOperations", - "load_balancer_load_balancing_rules": "LoadBalancerLoadBalancingRulesOperations", - "load_balancer_network_interfaces": "LoadBalancerNetworkInterfacesOperations", - "load_balancer_probes": "LoadBalancerProbesOperations", - "network_interfaces": "NetworkInterfacesOperations", - "network_interface_ip_configurations": "NetworkInterfaceIPConfigurationsOperations", - "network_interface_load_balancers": "NetworkInterfaceLoadBalancersOperations", - "network_security_groups": "NetworkSecurityGroupsOperations", - "security_rules": "SecurityRulesOperations", - "default_security_rules": "DefaultSecurityRulesOperations", - "network_watchers": "NetworkWatchersOperations", - "packet_captures": "PacketCapturesOperations", - "public_ip_addresses": "PublicIPAddressesOperations", - "route_filters": "RouteFiltersOperations", - "route_filter_rules": "RouteFilterRulesOperations", - "route_tables": "RouteTablesOperations", - "routes": "RoutesOperations", - "bgp_service_communities": "BgpServiceCommunitiesOperations", - "usages": "UsagesOperations", - "virtual_networks": "VirtualNetworksOperations", - "subnets": "SubnetsOperations", - "virtual_network_peerings": "VirtualNetworkPeeringsOperations", - "virtual_network_gateways": "VirtualNetworkGatewaysOperations", - "virtual_network_gateway_connections": "VirtualNetworkGatewayConnectionsOperations", - "local_network_gateways": "LocalNetworkGatewaysOperations" - }, - "operation_mixins": { - "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", - "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", - "operations": { - "check_dns_name_availability" : { - "sync": { - "signature": "def check_dns_name_availability(\n self,\n location, # type: str\n domain_name_label, # type: str\n **kwargs # type: Any\n):\n", - "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2017_08_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "async": { - "coroutine": true, - "signature": "async def check_dns_name_availability(\n self,\n location: str,\n domain_name_label: str,\n **kwargs: Any\n) -\u003e \"_models.DnsNameAvailabilityResult\":\n", - "doc": "\"\"\"Checks whether a domain name in the cloudapp.azure.com zone is available for use.\n\n:param location: The location of the domain name.\n:type location: str\n:param domain_name_label: The domain name to be verified. It must conform to the following\n regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.\n:type domain_name_label: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: DnsNameAvailabilityResult, or the result of cls(response)\n:rtype: ~azure.mgmt.network.v2017_08_01.models.DnsNameAvailabilityResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" - }, - "call": "location, domain_name_label" - } - } - } -} \ No newline at end of file diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_network_management_client.py deleted file mode 100644 index ae7d1c278805..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_network_management_client.py +++ /dev/null @@ -1,255 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - - from azure.core.credentials import TokenCredential - from azure.core.pipeline.transport import HttpRequest, HttpResponse - -from ._configuration import NetworkManagementClientConfiguration -from .operations import ApplicationGatewaysOperations -from .operations import NetworkManagementClientOperationsMixin -from .operations import AvailableEndpointServicesOperations -from .operations import ExpressRouteCircuitAuthorizationsOperations -from .operations import ExpressRouteCircuitPeeringsOperations -from .operations import ExpressRouteCircuitsOperations -from .operations import ExpressRouteServiceProvidersOperations -from .operations import LoadBalancersOperations -from .operations import LoadBalancerBackendAddressPoolsOperations -from .operations import LoadBalancerFrontendIPConfigurationsOperations -from .operations import InboundNatRulesOperations -from .operations import LoadBalancerLoadBalancingRulesOperations -from .operations import LoadBalancerNetworkInterfacesOperations -from .operations import LoadBalancerProbesOperations -from .operations import NetworkInterfacesOperations -from .operations import NetworkInterfaceIPConfigurationsOperations -from .operations import NetworkInterfaceLoadBalancersOperations -from .operations import NetworkSecurityGroupsOperations -from .operations import SecurityRulesOperations -from .operations import DefaultSecurityRulesOperations -from .operations import NetworkWatchersOperations -from .operations import PacketCapturesOperations -from .operations import PublicIPAddressesOperations -from .operations import RouteFiltersOperations -from .operations import RouteFilterRulesOperations -from .operations import RouteTablesOperations -from .operations import RoutesOperations -from .operations import BgpServiceCommunitiesOperations -from .operations import UsagesOperations -from .operations import VirtualNetworksOperations -from .operations import SubnetsOperations -from .operations import VirtualNetworkPeeringsOperations -from .operations import VirtualNetworkGatewaysOperations -from .operations import VirtualNetworkGatewayConnectionsOperations -from .operations import LocalNetworkGatewaysOperations -from . import models - - -class NetworkManagementClient(NetworkManagementClientOperationsMixin): - """Network Client. - - :ivar application_gateways: ApplicationGatewaysOperations operations - :vartype application_gateways: azure.mgmt.network.v2017_08_01.operations.ApplicationGatewaysOperations - :ivar available_endpoint_services: AvailableEndpointServicesOperations operations - :vartype available_endpoint_services: azure.mgmt.network.v2017_08_01.operations.AvailableEndpointServicesOperations - :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations operations - :vartype express_route_circuit_authorizations: azure.mgmt.network.v2017_08_01.operations.ExpressRouteCircuitAuthorizationsOperations - :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations - :vartype express_route_circuit_peerings: azure.mgmt.network.v2017_08_01.operations.ExpressRouteCircuitPeeringsOperations - :ivar express_route_circuits: ExpressRouteCircuitsOperations operations - :vartype express_route_circuits: azure.mgmt.network.v2017_08_01.operations.ExpressRouteCircuitsOperations - :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations - :vartype express_route_service_providers: azure.mgmt.network.v2017_08_01.operations.ExpressRouteServiceProvidersOperations - :ivar load_balancers: LoadBalancersOperations operations - :vartype load_balancers: azure.mgmt.network.v2017_08_01.operations.LoadBalancersOperations - :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations - :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2017_08_01.operations.LoadBalancerBackendAddressPoolsOperations - :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations operations - :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2017_08_01.operations.LoadBalancerFrontendIPConfigurationsOperations - :ivar inbound_nat_rules: InboundNatRulesOperations operations - :vartype inbound_nat_rules: azure.mgmt.network.v2017_08_01.operations.InboundNatRulesOperations - :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations - :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2017_08_01.operations.LoadBalancerLoadBalancingRulesOperations - :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations - :vartype load_balancer_network_interfaces: azure.mgmt.network.v2017_08_01.operations.LoadBalancerNetworkInterfacesOperations - :ivar load_balancer_probes: LoadBalancerProbesOperations operations - :vartype load_balancer_probes: azure.mgmt.network.v2017_08_01.operations.LoadBalancerProbesOperations - :ivar network_interfaces: NetworkInterfacesOperations operations - :vartype network_interfaces: azure.mgmt.network.v2017_08_01.operations.NetworkInterfacesOperations - :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations operations - :vartype network_interface_ip_configurations: azure.mgmt.network.v2017_08_01.operations.NetworkInterfaceIPConfigurationsOperations - :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations - :vartype network_interface_load_balancers: azure.mgmt.network.v2017_08_01.operations.NetworkInterfaceLoadBalancersOperations - :ivar network_security_groups: NetworkSecurityGroupsOperations operations - :vartype network_security_groups: azure.mgmt.network.v2017_08_01.operations.NetworkSecurityGroupsOperations - :ivar security_rules: SecurityRulesOperations operations - :vartype security_rules: azure.mgmt.network.v2017_08_01.operations.SecurityRulesOperations - :ivar default_security_rules: DefaultSecurityRulesOperations operations - :vartype default_security_rules: azure.mgmt.network.v2017_08_01.operations.DefaultSecurityRulesOperations - :ivar network_watchers: NetworkWatchersOperations operations - :vartype network_watchers: azure.mgmt.network.v2017_08_01.operations.NetworkWatchersOperations - :ivar packet_captures: PacketCapturesOperations operations - :vartype packet_captures: azure.mgmt.network.v2017_08_01.operations.PacketCapturesOperations - :ivar public_ip_addresses: PublicIPAddressesOperations operations - :vartype public_ip_addresses: azure.mgmt.network.v2017_08_01.operations.PublicIPAddressesOperations - :ivar route_filters: RouteFiltersOperations operations - :vartype route_filters: azure.mgmt.network.v2017_08_01.operations.RouteFiltersOperations - :ivar route_filter_rules: RouteFilterRulesOperations operations - :vartype route_filter_rules: azure.mgmt.network.v2017_08_01.operations.RouteFilterRulesOperations - :ivar route_tables: RouteTablesOperations operations - :vartype route_tables: azure.mgmt.network.v2017_08_01.operations.RouteTablesOperations - :ivar routes: RoutesOperations operations - :vartype routes: azure.mgmt.network.v2017_08_01.operations.RoutesOperations - :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations - :vartype bgp_service_communities: azure.mgmt.network.v2017_08_01.operations.BgpServiceCommunitiesOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.network.v2017_08_01.operations.UsagesOperations - :ivar virtual_networks: VirtualNetworksOperations operations - :vartype virtual_networks: azure.mgmt.network.v2017_08_01.operations.VirtualNetworksOperations - :ivar subnets: SubnetsOperations operations - :vartype subnets: azure.mgmt.network.v2017_08_01.operations.SubnetsOperations - :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations - :vartype virtual_network_peerings: azure.mgmt.network.v2017_08_01.operations.VirtualNetworkPeeringsOperations - :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations - :vartype virtual_network_gateways: azure.mgmt.network.v2017_08_01.operations.VirtualNetworkGatewaysOperations - :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations operations - :vartype virtual_network_gateway_connections: azure.mgmt.network.v2017_08_01.operations.VirtualNetworkGatewayConnectionsOperations - :ivar local_network_gateways: LocalNetworkGatewaysOperations operations - :vartype local_network_gateways: azure.mgmt.network.v2017_08_01.operations.LocalNetworkGatewaysOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.application_gateways = ApplicationGatewaysOperations( - self._client, self._config, self._serialize, self._deserialize) - self.available_endpoint_services = AvailableEndpointServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.express_route_circuits = ExpressRouteCircuitsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.express_route_service_providers = ExpressRouteServiceProvidersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancers = LoadBalancersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.inbound_nat_rules = InboundNatRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_probes = LoadBalancerProbesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_interfaces = NetworkInterfacesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_security_groups = NetworkSecurityGroupsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.security_rules = SecurityRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.default_security_rules = DefaultSecurityRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_watchers = NetworkWatchersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.packet_captures = PacketCapturesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.public_ip_addresses = PublicIPAddressesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.route_filters = RouteFiltersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.route_filter_rules = RouteFilterRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.route_tables = RouteTablesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.routes = RoutesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.bgp_service_communities = BgpServiceCommunitiesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtual_networks = VirtualNetworksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.subnets = SubnetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_peerings = VirtualNetworkPeeringsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_gateways = VirtualNetworkGatewaysOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.local_network_gateways = LocalNetworkGatewaysOperations( - self._client, self._config, self._serialize, self._deserialize) - - def _send_request(self, http_request, **kwargs): - # type: (HttpRequest, Any) -> HttpResponse - """Runs the network request through the client's chained policies. - - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.HttpResponse - """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> NetworkManagementClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_version.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_version.py deleted file mode 100644 index 5bd246a15fc6..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "19.1.0" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/__init__.py deleted file mode 100644 index 1c78defcf225..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._network_management_client import NetworkManagementClient -__all__ = ['NetworkManagementClient'] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_configuration.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_configuration.py deleted file mode 100644 index 80a5a857085b..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_configuration.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -from .._version import VERSION - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - - -class NetworkManagementClientConfiguration(Configuration): - """Configuration for NetworkManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - :type subscription_id: str - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - super(NetworkManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-network/{}'.format(VERSION)) - self._configure(**kwargs) - - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_network_management_client.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_network_management_client.py deleted file mode 100644 index f513ad88f906..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/_network_management_client.py +++ /dev/null @@ -1,248 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, Optional, TYPE_CHECKING - -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -from ._configuration import NetworkManagementClientConfiguration -from .operations import ApplicationGatewaysOperations -from .operations import NetworkManagementClientOperationsMixin -from .operations import AvailableEndpointServicesOperations -from .operations import ExpressRouteCircuitAuthorizationsOperations -from .operations import ExpressRouteCircuitPeeringsOperations -from .operations import ExpressRouteCircuitsOperations -from .operations import ExpressRouteServiceProvidersOperations -from .operations import LoadBalancersOperations -from .operations import LoadBalancerBackendAddressPoolsOperations -from .operations import LoadBalancerFrontendIPConfigurationsOperations -from .operations import InboundNatRulesOperations -from .operations import LoadBalancerLoadBalancingRulesOperations -from .operations import LoadBalancerNetworkInterfacesOperations -from .operations import LoadBalancerProbesOperations -from .operations import NetworkInterfacesOperations -from .operations import NetworkInterfaceIPConfigurationsOperations -from .operations import NetworkInterfaceLoadBalancersOperations -from .operations import NetworkSecurityGroupsOperations -from .operations import SecurityRulesOperations -from .operations import DefaultSecurityRulesOperations -from .operations import NetworkWatchersOperations -from .operations import PacketCapturesOperations -from .operations import PublicIPAddressesOperations -from .operations import RouteFiltersOperations -from .operations import RouteFilterRulesOperations -from .operations import RouteTablesOperations -from .operations import RoutesOperations -from .operations import BgpServiceCommunitiesOperations -from .operations import UsagesOperations -from .operations import VirtualNetworksOperations -from .operations import SubnetsOperations -from .operations import VirtualNetworkPeeringsOperations -from .operations import VirtualNetworkGatewaysOperations -from .operations import VirtualNetworkGatewayConnectionsOperations -from .operations import LocalNetworkGatewaysOperations -from .. import models - - -class NetworkManagementClient(NetworkManagementClientOperationsMixin): - """Network Client. - - :ivar application_gateways: ApplicationGatewaysOperations operations - :vartype application_gateways: azure.mgmt.network.v2017_08_01.aio.operations.ApplicationGatewaysOperations - :ivar available_endpoint_services: AvailableEndpointServicesOperations operations - :vartype available_endpoint_services: azure.mgmt.network.v2017_08_01.aio.operations.AvailableEndpointServicesOperations - :ivar express_route_circuit_authorizations: ExpressRouteCircuitAuthorizationsOperations operations - :vartype express_route_circuit_authorizations: azure.mgmt.network.v2017_08_01.aio.operations.ExpressRouteCircuitAuthorizationsOperations - :ivar express_route_circuit_peerings: ExpressRouteCircuitPeeringsOperations operations - :vartype express_route_circuit_peerings: azure.mgmt.network.v2017_08_01.aio.operations.ExpressRouteCircuitPeeringsOperations - :ivar express_route_circuits: ExpressRouteCircuitsOperations operations - :vartype express_route_circuits: azure.mgmt.network.v2017_08_01.aio.operations.ExpressRouteCircuitsOperations - :ivar express_route_service_providers: ExpressRouteServiceProvidersOperations operations - :vartype express_route_service_providers: azure.mgmt.network.v2017_08_01.aio.operations.ExpressRouteServiceProvidersOperations - :ivar load_balancers: LoadBalancersOperations operations - :vartype load_balancers: azure.mgmt.network.v2017_08_01.aio.operations.LoadBalancersOperations - :ivar load_balancer_backend_address_pools: LoadBalancerBackendAddressPoolsOperations operations - :vartype load_balancer_backend_address_pools: azure.mgmt.network.v2017_08_01.aio.operations.LoadBalancerBackendAddressPoolsOperations - :ivar load_balancer_frontend_ip_configurations: LoadBalancerFrontendIPConfigurationsOperations operations - :vartype load_balancer_frontend_ip_configurations: azure.mgmt.network.v2017_08_01.aio.operations.LoadBalancerFrontendIPConfigurationsOperations - :ivar inbound_nat_rules: InboundNatRulesOperations operations - :vartype inbound_nat_rules: azure.mgmt.network.v2017_08_01.aio.operations.InboundNatRulesOperations - :ivar load_balancer_load_balancing_rules: LoadBalancerLoadBalancingRulesOperations operations - :vartype load_balancer_load_balancing_rules: azure.mgmt.network.v2017_08_01.aio.operations.LoadBalancerLoadBalancingRulesOperations - :ivar load_balancer_network_interfaces: LoadBalancerNetworkInterfacesOperations operations - :vartype load_balancer_network_interfaces: azure.mgmt.network.v2017_08_01.aio.operations.LoadBalancerNetworkInterfacesOperations - :ivar load_balancer_probes: LoadBalancerProbesOperations operations - :vartype load_balancer_probes: azure.mgmt.network.v2017_08_01.aio.operations.LoadBalancerProbesOperations - :ivar network_interfaces: NetworkInterfacesOperations operations - :vartype network_interfaces: azure.mgmt.network.v2017_08_01.aio.operations.NetworkInterfacesOperations - :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurationsOperations operations - :vartype network_interface_ip_configurations: azure.mgmt.network.v2017_08_01.aio.operations.NetworkInterfaceIPConfigurationsOperations - :ivar network_interface_load_balancers: NetworkInterfaceLoadBalancersOperations operations - :vartype network_interface_load_balancers: azure.mgmt.network.v2017_08_01.aio.operations.NetworkInterfaceLoadBalancersOperations - :ivar network_security_groups: NetworkSecurityGroupsOperations operations - :vartype network_security_groups: azure.mgmt.network.v2017_08_01.aio.operations.NetworkSecurityGroupsOperations - :ivar security_rules: SecurityRulesOperations operations - :vartype security_rules: azure.mgmt.network.v2017_08_01.aio.operations.SecurityRulesOperations - :ivar default_security_rules: DefaultSecurityRulesOperations operations - :vartype default_security_rules: azure.mgmt.network.v2017_08_01.aio.operations.DefaultSecurityRulesOperations - :ivar network_watchers: NetworkWatchersOperations operations - :vartype network_watchers: azure.mgmt.network.v2017_08_01.aio.operations.NetworkWatchersOperations - :ivar packet_captures: PacketCapturesOperations operations - :vartype packet_captures: azure.mgmt.network.v2017_08_01.aio.operations.PacketCapturesOperations - :ivar public_ip_addresses: PublicIPAddressesOperations operations - :vartype public_ip_addresses: azure.mgmt.network.v2017_08_01.aio.operations.PublicIPAddressesOperations - :ivar route_filters: RouteFiltersOperations operations - :vartype route_filters: azure.mgmt.network.v2017_08_01.aio.operations.RouteFiltersOperations - :ivar route_filter_rules: RouteFilterRulesOperations operations - :vartype route_filter_rules: azure.mgmt.network.v2017_08_01.aio.operations.RouteFilterRulesOperations - :ivar route_tables: RouteTablesOperations operations - :vartype route_tables: azure.mgmt.network.v2017_08_01.aio.operations.RouteTablesOperations - :ivar routes: RoutesOperations operations - :vartype routes: azure.mgmt.network.v2017_08_01.aio.operations.RoutesOperations - :ivar bgp_service_communities: BgpServiceCommunitiesOperations operations - :vartype bgp_service_communities: azure.mgmt.network.v2017_08_01.aio.operations.BgpServiceCommunitiesOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.network.v2017_08_01.aio.operations.UsagesOperations - :ivar virtual_networks: VirtualNetworksOperations operations - :vartype virtual_networks: azure.mgmt.network.v2017_08_01.aio.operations.VirtualNetworksOperations - :ivar subnets: SubnetsOperations operations - :vartype subnets: azure.mgmt.network.v2017_08_01.aio.operations.SubnetsOperations - :ivar virtual_network_peerings: VirtualNetworkPeeringsOperations operations - :vartype virtual_network_peerings: azure.mgmt.network.v2017_08_01.aio.operations.VirtualNetworkPeeringsOperations - :ivar virtual_network_gateways: VirtualNetworkGatewaysOperations operations - :vartype virtual_network_gateways: azure.mgmt.network.v2017_08_01.aio.operations.VirtualNetworkGatewaysOperations - :ivar virtual_network_gateway_connections: VirtualNetworkGatewayConnectionsOperations operations - :vartype virtual_network_gateway_connections: azure.mgmt.network.v2017_08_01.aio.operations.VirtualNetworkGatewayConnectionsOperations - :ivar local_network_gateways: LocalNetworkGatewaysOperations operations - :vartype local_network_gateways: azure.mgmt.network.v2017_08_01.aio.operations.LocalNetworkGatewaysOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - :type subscription_id: str - :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = NetworkManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.application_gateways = ApplicationGatewaysOperations( - self._client, self._config, self._serialize, self._deserialize) - self.available_endpoint_services = AvailableEndpointServicesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.express_route_circuits = ExpressRouteCircuitsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.express_route_service_providers = ExpressRouteServiceProvidersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancers = LoadBalancersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_backend_address_pools = LoadBalancerBackendAddressPoolsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_frontend_ip_configurations = LoadBalancerFrontendIPConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.inbound_nat_rules = InboundNatRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_load_balancing_rules = LoadBalancerLoadBalancingRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_network_interfaces = LoadBalancerNetworkInterfacesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.load_balancer_probes = LoadBalancerProbesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_interfaces = NetworkInterfacesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_interface_ip_configurations = NetworkInterfaceIPConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_interface_load_balancers = NetworkInterfaceLoadBalancersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_security_groups = NetworkSecurityGroupsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.security_rules = SecurityRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.default_security_rules = DefaultSecurityRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.network_watchers = NetworkWatchersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.packet_captures = PacketCapturesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.public_ip_addresses = PublicIPAddressesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.route_filters = RouteFiltersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.route_filter_rules = RouteFilterRulesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.route_tables = RouteTablesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.routes = RoutesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.bgp_service_communities = BgpServiceCommunitiesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtual_networks = VirtualNetworksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.subnets = SubnetsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_peerings = VirtualNetworkPeeringsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_gateways = VirtualNetworkGatewaysOperations( - self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.local_network_gateways = LocalNetworkGatewaysOperations( - self._client, self._config, self._serialize, self._deserialize) - - async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: - """Runs the network request through the client's chained policies. - - :param http_request: The network request you want to make. Required. - :type http_request: ~azure.core.pipeline.transport.HttpRequest - :keyword bool stream: Whether the response payload will be streamed. Defaults to True. - :return: The response of your network call. Does not do error handling on your response. - :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse - """ - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - http_request.url = self._client.format_url(http_request.url, **path_format_arguments) - stream = kwargs.pop("stream", True) - pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) - return pipeline_response.http_response - - async def close(self) -> None: - await self._client.close() - - async def __aenter__(self) -> "NetworkManagementClient": - await self._client.__aenter__() - return self - - async def __aexit__(self, *exc_details) -> None: - await self._client.__aexit__(*exc_details) diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/__init__.py deleted file mode 100644 index cca1cde6acc2..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/__init__.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._application_gateways_operations import ApplicationGatewaysOperations -from ._network_management_client_operations import NetworkManagementClientOperationsMixin -from ._available_endpoint_services_operations import AvailableEndpointServicesOperations -from ._express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations -from ._express_route_circuit_peerings_operations import ExpressRouteCircuitPeeringsOperations -from ._express_route_circuits_operations import ExpressRouteCircuitsOperations -from ._express_route_service_providers_operations import ExpressRouteServiceProvidersOperations -from ._load_balancers_operations import LoadBalancersOperations -from ._load_balancer_backend_address_pools_operations import LoadBalancerBackendAddressPoolsOperations -from ._load_balancer_frontend_ip_configurations_operations import LoadBalancerFrontendIPConfigurationsOperations -from ._inbound_nat_rules_operations import InboundNatRulesOperations -from ._load_balancer_load_balancing_rules_operations import LoadBalancerLoadBalancingRulesOperations -from ._load_balancer_network_interfaces_operations import LoadBalancerNetworkInterfacesOperations -from ._load_balancer_probes_operations import LoadBalancerProbesOperations -from ._network_interfaces_operations import NetworkInterfacesOperations -from ._network_interface_ip_configurations_operations import NetworkInterfaceIPConfigurationsOperations -from ._network_interface_load_balancers_operations import NetworkInterfaceLoadBalancersOperations -from ._network_security_groups_operations import NetworkSecurityGroupsOperations -from ._security_rules_operations import SecurityRulesOperations -from ._default_security_rules_operations import DefaultSecurityRulesOperations -from ._network_watchers_operations import NetworkWatchersOperations -from ._packet_captures_operations import PacketCapturesOperations -from ._public_ip_addresses_operations import PublicIPAddressesOperations -from ._route_filters_operations import RouteFiltersOperations -from ._route_filter_rules_operations import RouteFilterRulesOperations -from ._route_tables_operations import RouteTablesOperations -from ._routes_operations import RoutesOperations -from ._bgp_service_communities_operations import BgpServiceCommunitiesOperations -from ._usages_operations import UsagesOperations -from ._virtual_networks_operations import VirtualNetworksOperations -from ._subnets_operations import SubnetsOperations -from ._virtual_network_peerings_operations import VirtualNetworkPeeringsOperations -from ._virtual_network_gateways_operations import VirtualNetworkGatewaysOperations -from ._virtual_network_gateway_connections_operations import VirtualNetworkGatewayConnectionsOperations -from ._local_network_gateways_operations import LocalNetworkGatewaysOperations - -__all__ = [ - 'ApplicationGatewaysOperations', - 'NetworkManagementClientOperationsMixin', - 'AvailableEndpointServicesOperations', - 'ExpressRouteCircuitAuthorizationsOperations', - 'ExpressRouteCircuitPeeringsOperations', - 'ExpressRouteCircuitsOperations', - 'ExpressRouteServiceProvidersOperations', - 'LoadBalancersOperations', - 'LoadBalancerBackendAddressPoolsOperations', - 'LoadBalancerFrontendIPConfigurationsOperations', - 'InboundNatRulesOperations', - 'LoadBalancerLoadBalancingRulesOperations', - 'LoadBalancerNetworkInterfacesOperations', - 'LoadBalancerProbesOperations', - 'NetworkInterfacesOperations', - 'NetworkInterfaceIPConfigurationsOperations', - 'NetworkInterfaceLoadBalancersOperations', - 'NetworkSecurityGroupsOperations', - 'SecurityRulesOperations', - 'DefaultSecurityRulesOperations', - 'NetworkWatchersOperations', - 'PacketCapturesOperations', - 'PublicIPAddressesOperations', - 'RouteFiltersOperations', - 'RouteFilterRulesOperations', - 'RouteTablesOperations', - 'RoutesOperations', - 'BgpServiceCommunitiesOperations', - 'UsagesOperations', - 'VirtualNetworksOperations', - 'SubnetsOperations', - 'VirtualNetworkPeeringsOperations', - 'VirtualNetworkGatewaysOperations', - 'VirtualNetworkGatewayConnectionsOperations', - 'LocalNetworkGatewaysOperations', -] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_application_gateways_operations.py deleted file mode 100644 index d7815b474347..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_application_gateways_operations.py +++ /dev/null @@ -1,1027 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ApplicationGatewaysOperations: - """ApplicationGatewaysOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - application_gateway_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - application_gateway_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified application gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - application_gateway_name: str, - **kwargs: Any - ) -> "_models.ApplicationGateway": - """Gets the specified application gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGateway - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - application_gateway_name: str, - parameters: "_models.ApplicationGateway", - **kwargs: Any - ) -> "_models.ApplicationGateway": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ApplicationGateway') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ApplicationGateway', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ApplicationGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - application_gateway_name: str, - parameters: "_models.ApplicationGateway", - **kwargs: Any - ) -> AsyncLROPoller["_models.ApplicationGateway"]: - """Creates or updates the specified application gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :param parameters: Parameters supplied to the create or update application gateway operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ApplicationGateway - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ApplicationGateway or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ApplicationGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ApplicationGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: - """Lists all application gateways in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGatewayListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationGatewayListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} # type: ignore - - def list_all( - self, - **kwargs: Any - ) -> AsyncIterable["_models.ApplicationGatewayListResult"]: - """Gets all the application gateways in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGatewayListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationGatewayListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} # type: ignore - - async def _start_initial( - self, - resource_group_name: str, - application_gateway_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} # type: ignore - - async def begin_start( - self, - resource_group_name: str, - application_gateway_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Starts the specified application gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._start_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} # type: ignore - - async def _stop_initial( - self, - resource_group_name: str, - application_gateway_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} # type: ignore - - async def begin_stop( - self, - resource_group_name: str, - application_gateway_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Stops the specified application gateway in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} # type: ignore - - async def _backend_health_initial( - self, - resource_group_name: str, - application_gateway_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> Optional["_models.ApplicationGatewayBackendHealth"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self._backend_health_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ApplicationGatewayBackendHealth', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _backend_health_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} # type: ignore - - async def begin_backend_health( - self, - resource_group_name: str, - application_gateway_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.ApplicationGatewayBackendHealth"]: - """Gets the backend health of the specified application gateway in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :param expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealth] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._backend_health_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - expand=expand, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ApplicationGatewayBackendHealth', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} # type: ignore - - async def list_available_waf_rule_sets( - self, - **kwargs: Any - ) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult": - """Lists all available web application firewall rule sets. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGatewayAvailableWafRuleSetsResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableWafRuleSetsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.list_available_waf_rule_sets.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGatewayAvailableWafRuleSetsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} # type: ignore - - async def list_available_ssl_options( - self, - **kwargs: Any - ) -> "_models.ApplicationGatewayAvailableSslOptions": - """Lists available Ssl options for configuring Ssl policy. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGatewayAvailableSslOptions, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableSslOptions - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.list_available_ssl_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGatewayAvailableSslOptions', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} # type: ignore - - def list_available_ssl_predefined_policies( - self, - **kwargs: Any - ) -> AsyncIterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"]: - """Lists all SSL predefined policies for configuring Ssl policy. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGatewayAvailableSslPredefinedPolicies or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationGatewayAvailableSslPredefinedPolicies', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} # type: ignore - - async def get_ssl_predefined_policy( - self, - predefined_policy_name: str, - **kwargs: Any - ) -> "_models.ApplicationGatewaySslPredefinedPolicy": - """Gets Ssl predefined policy with the specified policy name. - - :param predefined_policy_name: Name of Ssl predefined policy. - :type predefined_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGatewaySslPredefinedPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPredefinedPolicy - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.get_ssl_predefined_policy.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGatewaySslPredefinedPolicy', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_available_endpoint_services_operations.py deleted file mode 100644 index 9d2ed04cd32a..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_available_endpoint_services_operations.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class AvailableEndpointServicesOperations: - """AvailableEndpointServicesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.EndpointServicesListResult"]: - """List what values of endpoint services are available for use. - - :param location: The location to check available endpoint services. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointServicesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.EndpointServicesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('EndpointServicesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_bgp_service_communities_operations.py deleted file mode 100644 index 9b0d420dae6d..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_bgp_service_communities_operations.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class BgpServiceCommunitiesOperations: - """BgpServiceCommunitiesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.BgpServiceCommunityListResult"]: - """Gets all the available bgp service communities. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BgpServiceCommunityListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.BgpServiceCommunityListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('BgpServiceCommunityListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_default_security_rules_operations.py deleted file mode 100644 index 1789f1345921..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_default_security_rules_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class DefaultSecurityRulesOperations: - """DefaultSecurityRulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - network_security_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.SecurityRuleListResult"]: - """Gets all default security rules in a network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SecurityRuleListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.SecurityRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SecurityRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} # type: ignore - - async def get( - self, - resource_group_name: str, - network_security_group_name: str, - default_security_rule_name: str, - **kwargs: Any - ) -> "_models.SecurityRule": - """Get the specified default network security rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param default_security_rule_name: The name of the default security rule. - :type default_security_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'defaultSecurityRuleName': self._serialize.url("default_security_rule_name", default_security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_authorizations_operations.py deleted file mode 100644 index 4e43bb24941d..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_authorizations_operations.py +++ /dev/null @@ -1,429 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ExpressRouteCircuitAuthorizationsOperations: - """ExpressRouteCircuitAuthorizationsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - circuit_name: str, - authorization_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - circuit_name: str, - authorization_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified authorization from the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param authorization_name: The name of the authorization. - :type authorization_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - authorization_name=authorization_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - circuit_name: str, - authorization_name: str, - **kwargs: Any - ) -> "_models.ExpressRouteCircuitAuthorization": - """Gets the specified authorization from the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param authorization_name: The name of the authorization. - :type authorization_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - circuit_name: str, - authorization_name: str, - authorization_parameters: "_models.ExpressRouteCircuitAuthorization", - **kwargs: Any - ) -> "_models.ExpressRouteCircuitAuthorization": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - circuit_name: str, - authorization_name: str, - authorization_parameters: "_models.ExpressRouteCircuitAuthorization", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExpressRouteCircuitAuthorization"]: - """Creates or updates an authorization in the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param authorization_name: The name of the authorization. - :type authorization_name: str - :param authorization_parameters: Parameters supplied to the create or update express route - circuit authorization operation. - :type authorization_parameters: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - authorization_name=authorization_name, - authorization_parameters=authorization_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - def list( - self, - resource_group_name: str, - circuit_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AuthorizationListResult"]: - """Gets all authorizations in an express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AuthorizationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.AuthorizationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('AuthorizationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_peerings_operations.py deleted file mode 100644 index e4f0b578e2d1..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuit_peerings_operations.py +++ /dev/null @@ -1,429 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ExpressRouteCircuitPeeringsOperations: - """ExpressRouteCircuitPeeringsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified peering from the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - **kwargs: Any - ) -> "_models.ExpressRouteCircuitPeering": - """Gets the specified authorization from the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - peering_parameters: "_models.ExpressRouteCircuitPeering", - **kwargs: Any - ) -> "_models.ExpressRouteCircuitPeering": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - peering_parameters: "_models.ExpressRouteCircuitPeering", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExpressRouteCircuitPeering"]: - """Creates or updates a peering in the specified express route circuits. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :param peering_parameters: Parameters supplied to the create or update express route circuit - peering operation. - :type peering_parameters: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - peering_parameters=peering_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - def list( - self, - resource_group_name: str, - circuit_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ExpressRouteCircuitPeeringListResult"]: - """Gets all peerings in a specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressRouteCircuitPeeringListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitPeeringListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuits_operations.py deleted file mode 100644 index e1005906b974..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_circuits_operations.py +++ /dev/null @@ -1,985 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ExpressRouteCircuitsOperations: - """ExpressRouteCircuitsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - circuit_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - circuit_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - circuit_name: str, - **kwargs: Any - ) -> "_models.ExpressRouteCircuit": - """Gets information about the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of express route circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - circuit_name: str, - parameters: "_models.ExpressRouteCircuit", - **kwargs: Any - ) -> "_models.ExpressRouteCircuit": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - circuit_name: str, - parameters: "_models.ExpressRouteCircuit", - **kwargs: Any - ) -> AsyncLROPoller["_models.ExpressRouteCircuit"]: - """Creates or updates an express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the circuit. - :type circuit_name: str - :param parameters: Parameters supplied to the create or update express route circuit operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuit or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - async def _list_arp_table_initial( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - device_path: str, - **kwargs: Any - ) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._list_arp_table_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _list_arp_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore - - async def begin_list_arp_table( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - device_path: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.ExpressRouteCircuitsArpTableListResult"]: - """Gets the currently advertised ARP table associated with the express route circuit in a resource - group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :param device_path: The path of the device. - :type device_path: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsArpTableListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._list_arp_table_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - device_path=device_path, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore - - async def _list_routes_table_initial( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - device_path: str, - **kwargs: Any - ) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._list_routes_table_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _list_routes_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore - - async def begin_list_routes_table( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - device_path: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"]: - """Gets the currently advertised routes table associated with the express route circuit in a - resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :param device_path: The path of the device. - :type device_path: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._list_routes_table_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - device_path=device_path, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore - - async def _list_routes_table_summary_initial( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - device_path: str, - **kwargs: Any - ) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._list_routes_table_summary_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _list_routes_table_summary_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore - - async def begin_list_routes_table_summary( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - device_path: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]: - """Gets the currently advertised routes table summary associated with the express route circuit in - a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :param device_path: The path of the device. - :type device_path: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._list_routes_table_summary_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - device_path=device_path, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore - - async def get_stats( - self, - resource_group_name: str, - circuit_name: str, - **kwargs: Any - ) -> "_models.ExpressRouteCircuitStats": - """Gets all the stats from an express route circuit in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuitStats, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get_stats.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuitStats', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} # type: ignore - - async def get_peering_stats( - self, - resource_group_name: str, - circuit_name: str, - peering_name: str, - **kwargs: Any - ) -> "_models.ExpressRouteCircuitStats": - """Gets all stats from an express route circuit in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuitStats, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get_peering_stats.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuitStats', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: - """Gets all the express route circuits in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressRouteCircuitListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} # type: ignore - - def list_all( - self, - **kwargs: Any - ) -> AsyncIterable["_models.ExpressRouteCircuitListResult"]: - """Gets all the express route circuits in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressRouteCircuitListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_service_providers_operations.py deleted file mode 100644 index 89d9f7a3f4b9..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_express_route_service_providers_operations.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ExpressRouteServiceProvidersOperations: - """ExpressRouteServiceProvidersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.ExpressRouteServiceProviderListResult"]: - """Gets all the available express route service providers. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressRouteServiceProviderListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteServiceProviderListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('ExpressRouteServiceProviderListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_inbound_nat_rules_operations.py deleted file mode 100644 index af2ed81ff44f..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_inbound_nat_rules_operations.py +++ /dev/null @@ -1,434 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class InboundNatRulesOperations: - """InboundNatRulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - load_balancer_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.InboundNatRuleListResult"]: - """Gets all the inbound nat rules in a load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InboundNatRuleListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.InboundNatRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('InboundNatRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - load_balancer_name: str, - inbound_nat_rule_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - load_balancer_name: str, - inbound_nat_rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified load balancer inbound nat rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param inbound_nat_rule_name: The name of the inbound nat rule. - :type inbound_nat_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - load_balancer_name=load_balancer_name, - inbound_nat_rule_name=inbound_nat_rule_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - load_balancer_name: str, - inbound_nat_rule_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.InboundNatRule": - """Gets the specified load balancer inbound nat rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param inbound_nat_rule_name: The name of the inbound nat rule. - :type inbound_nat_rule_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.InboundNatRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InboundNatRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - load_balancer_name: str, - inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "_models.InboundNatRule", - **kwargs: Any - ) -> "_models.InboundNatRule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('InboundNatRule', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('InboundNatRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - load_balancer_name: str, - inbound_nat_rule_name: str, - inbound_nat_rule_parameters: "_models.InboundNatRule", - **kwargs: Any - ) -> AsyncLROPoller["_models.InboundNatRule"]: - """Creates or updates a load balancer inbound nat rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param inbound_nat_rule_name: The name of the inbound nat rule. - :type inbound_nat_rule_name: str - :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound nat - rule operation. - :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.InboundNatRule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either InboundNatRule or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - load_balancer_name=load_balancer_name, - inbound_nat_rule_name=inbound_nat_rule_name, - inbound_nat_rule_parameters=inbound_nat_rule_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('InboundNatRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py deleted file mode 100644 index 5221191e2b34..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_backend_address_pools_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerBackendAddressPoolsOperations: - """LoadBalancerBackendAddressPoolsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - load_balancer_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.LoadBalancerBackendAddressPoolListResult"]: - """Gets all the load balancer backed address pools. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerBackendAddressPoolListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerBackendAddressPoolListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerBackendAddressPoolListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} # type: ignore - - async def get( - self, - resource_group_name: str, - load_balancer_name: str, - backend_address_pool_name: str, - **kwargs: Any - ) -> "_models.BackendAddressPool": - """Gets load balancer backend address pool. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param backend_address_pool_name: The name of the backend address pool. - :type backend_address_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BackendAddressPool, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.BackendAddressPool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BackendAddressPool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py deleted file mode 100644 index 09f3439e932e..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerFrontendIPConfigurationsOperations: - """LoadBalancerFrontendIPConfigurationsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - load_balancer_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.LoadBalancerFrontendIPConfigurationListResult"]: - """Gets all the load balancer frontend IP configurations. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerFrontendIPConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerFrontendIPConfigurationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerFrontendIPConfigurationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} # type: ignore - - async def get( - self, - resource_group_name: str, - load_balancer_name: str, - frontend_ip_configuration_name: str, - **kwargs: Any - ) -> "_models.FrontendIPConfiguration": - """Gets load balancer frontend IP configuration. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param frontend_ip_configuration_name: The name of the frontend IP configuration. - :type frontend_ip_configuration_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FrontendIPConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.FrontendIPConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'frontendIPConfigurationName': self._serialize.url("frontend_ip_configuration_name", frontend_ip_configuration_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FrontendIPConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py deleted file mode 100644 index b3a51d519278..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_load_balancing_rules_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerLoadBalancingRulesOperations: - """LoadBalancerLoadBalancingRulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - load_balancer_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.LoadBalancerLoadBalancingRuleListResult"]: - """Gets all the load balancing rules in a load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerLoadBalancingRuleListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerLoadBalancingRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerLoadBalancingRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} # type: ignore - - async def get( - self, - resource_group_name: str, - load_balancer_name: str, - load_balancing_rule_name: str, - **kwargs: Any - ) -> "_models.LoadBalancingRule": - """Gets the specified load balancer load balancing rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param load_balancing_rule_name: The name of the load balancing rule. - :type load_balancing_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LoadBalancingRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.LoadBalancingRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'loadBalancingRuleName': self._serialize.url("load_balancing_rule_name", load_balancing_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LoadBalancingRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_network_interfaces_operations.py deleted file mode 100644 index 951adf93ca5d..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_network_interfaces_operations.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerNetworkInterfacesOperations: - """LoadBalancerNetworkInterfacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - load_balancer_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: - """Gets associated load balancer network interfaces. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_probes_operations.py deleted file mode 100644 index 6741a39c7600..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancer_probes_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerProbesOperations: - """LoadBalancerProbesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - load_balancer_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.LoadBalancerProbeListResult"]: - """Gets all the load balancer probes. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerProbeListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerProbeListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerProbeListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} # type: ignore - - async def get( - self, - resource_group_name: str, - load_balancer_name: str, - probe_name: str, - **kwargs: Any - ) -> "_models.Probe": - """Gets load balancer probe. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param probe_name: The name of the probe. - :type probe_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Probe, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Probe - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'probeName': self._serialize.url("probe_name", probe_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Probe', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancers_operations.py deleted file mode 100644 index 9139ed5bb08e..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_load_balancers_operations.py +++ /dev/null @@ -1,477 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancersOperations: - """LoadBalancersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - load_balancer_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - load_balancer_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - load_balancer_name=load_balancer_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - load_balancer_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.LoadBalancer": - """Gets the specified load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.LoadBalancer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LoadBalancer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - load_balancer_name: str, - parameters: "_models.LoadBalancer", - **kwargs: Any - ) -> "_models.LoadBalancer": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'LoadBalancer') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('LoadBalancer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('LoadBalancer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - load_balancer_name: str, - parameters: "_models.LoadBalancer", - **kwargs: Any - ) -> AsyncLROPoller["_models.LoadBalancer"]: - """Creates or updates a load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param parameters: Parameters supplied to the create or update load balancer operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.LoadBalancer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LoadBalancer or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.LoadBalancer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - load_balancer_name=load_balancer_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('LoadBalancer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - def list_all( - self, - **kwargs: Any - ) -> AsyncIterable["_models.LoadBalancerListResult"]: - """Gets all the load balancers in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.LoadBalancerListResult"]: - """Gets all the load balancers in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_local_network_gateways_operations.py deleted file mode 100644 index 2f24f98481eb..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_local_network_gateways_operations.py +++ /dev/null @@ -1,406 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LocalNetworkGatewaysOperations: - """LocalNetworkGatewaysOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _create_or_update_initial( - self, - resource_group_name: str, - local_network_gateway_name: str, - parameters: "_models.LocalNetworkGateway", - **kwargs: Any - ) -> "_models.LocalNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'LocalNetworkGateway') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - local_network_gateway_name: str, - parameters: "_models.LocalNetworkGateway", - **kwargs: Any - ) -> AsyncLROPoller["_models.LocalNetworkGateway"]: - """Creates or updates a local network gateway in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param local_network_gateway_name: The name of the local network gateway. - :type local_network_gateway_name: str - :param parameters: Parameters supplied to the create or update local network gateway operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either LocalNetworkGateway or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - local_network_gateway_name=local_network_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - local_network_gateway_name: str, - **kwargs: Any - ) -> "_models.LocalNetworkGateway": - """Gets the specified local network gateway in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param local_network_gateway_name: The name of the local network gateway. - :type local_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - local_network_gateway_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - local_network_gateway_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified local network gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param local_network_gateway_name: The name of the local network gateway. - :type local_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - local_network_gateway_name=local_network_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.LocalNetworkGatewayListResult"]: - """Gets all the local network gateways in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LocalNetworkGatewayListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGatewayListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('LocalNetworkGatewayListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_ip_configurations_operations.py deleted file mode 100644 index e057efda6b1c..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_ip_configurations_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkInterfaceIPConfigurationsOperations: - """NetworkInterfaceIPConfigurationsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - network_interface_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkInterfaceIPConfigurationListResult"]: - """Get all ip configurations in a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceIPConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfigurationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceIPConfigurationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} # type: ignore - - async def get( - self, - resource_group_name: str, - network_interface_name: str, - ip_configuration_name: str, - **kwargs: Any - ) -> "_models.NetworkInterfaceIPConfiguration": - """Gets the specified network interface ip configuration. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param ip_configuration_name: The name of the ip configuration name. - :type ip_configuration_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkInterfaceIPConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkInterfaceIPConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_load_balancers_operations.py deleted file mode 100644 index ae7ff7ad721e..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interface_load_balancers_operations.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkInterfaceLoadBalancersOperations: - """NetworkInterfaceLoadBalancersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - network_interface_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkInterfaceLoadBalancerListResult"]: - """List all load balancers in a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceLoadBalancerListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceLoadBalancerListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceLoadBalancerListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interfaces_operations.py deleted file mode 100644 index 11faf037f414..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_interfaces_operations.py +++ /dev/null @@ -1,933 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkInterfacesOperations: - """NetworkInterfacesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - network_interface_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - network_interface_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - network_interface_name=network_interface_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - network_interface_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.NetworkInterface": - """Gets information about the specified network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - network_interface_name: str, - parameters: "_models.NetworkInterface", - **kwargs: Any - ) -> "_models.NetworkInterface": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NetworkInterface') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - network_interface_name: str, - parameters: "_models.NetworkInterface", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkInterface"]: - """Creates or updates a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param parameters: Parameters supplied to the create or update network interface operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkInterface or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - network_interface_name=network_interface_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - def list_all( - self, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: - """Gets all network interfaces in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: - """Gets all network interfaces in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} # type: ignore - - async def _get_effective_route_table_initial( - self, - resource_group_name: str, - network_interface_name: str, - **kwargs: Any - ) -> Optional["_models.EffectiveRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_effective_route_table_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EffectiveRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_effective_route_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} # type: ignore - - async def begin_get_effective_route_table( - self, - resource_group_name: str, - network_interface_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.EffectiveRouteListResult"]: - """Gets all route tables applied to a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EffectiveRouteListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.EffectiveRouteListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_effective_route_table_initial( - resource_group_name=resource_group_name, - network_interface_name=network_interface_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('EffectiveRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} # type: ignore - - async def _list_effective_network_security_groups_initial( - self, - resource_group_name: str, - network_interface_name: str, - **kwargs: Any - ) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._list_effective_network_security_groups_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _list_effective_network_security_groups_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} # type: ignore - - async def begin_list_effective_network_security_groups( - self, - resource_group_name: str, - network_interface_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.EffectiveNetworkSecurityGroupListResult"]: - """Gets all network security groups applied to a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroupListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._list_effective_network_security_groups_initial( - resource_group_name=resource_group_name, - network_interface_name=network_interface_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} # type: ignore - - def list_virtual_machine_scale_set_vm_network_interfaces( - self, - resource_group_name: str, - virtual_machine_scale_set_name: str, - virtualmachine_index: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: - """Gets information about all network interfaces in a virtual machine in a virtual machine scale - set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :param virtualmachine_index: The virtual machine index. - :type virtualmachine_index: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} # type: ignore - - def list_virtual_machine_scale_set_network_interfaces( - self, - resource_group_name: str, - virtual_machine_scale_set_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkInterfaceListResult"]: - """Gets all network interfaces in a virtual machine scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} # type: ignore - - async def get_virtual_machine_scale_set_network_interface( - self, - resource_group_name: str, - virtual_machine_scale_set_name: str, - virtualmachine_index: str, - network_interface_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.NetworkInterface": - """Get the specified network interface in a virtual machine scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :param virtualmachine_index: The virtual machine index. - :type virtualmachine_index: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - # Construct URL - url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_management_client_operations.py deleted file mode 100644 index d8167eda1a79..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_management_client_operations.py +++ /dev/null @@ -1,80 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkManagementClientOperationsMixin: - - async def check_dns_name_availability( - self, - location: str, - domain_name_label: str, - **kwargs: Any - ) -> "_models.DnsNameAvailabilityResult": - """Checks whether a domain name in the cloudapp.azure.com zone is available for use. - - :param location: The location of the domain name. - :type location: str - :param domain_name_label: The domain name to be verified. It must conform to the following - regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - :type domain_name_label: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DnsNameAvailabilityResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.DnsNameAvailabilityResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.check_dns_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['domainNameLabel'] = self._serialize.query("domain_name_label", domain_name_label, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DnsNameAvailabilityResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_security_groups_operations.py deleted file mode 100644 index 20bdfafa829b..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_security_groups_operations.py +++ /dev/null @@ -1,478 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkSecurityGroupsOperations: - """NetworkSecurityGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - network_security_group_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - network_security_group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - network_security_group_name=network_security_group_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - network_security_group_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.NetworkSecurityGroup": - """Gets the specified network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - network_security_group_name: str, - parameters: "_models.NetworkSecurityGroup", - **kwargs: Any - ) -> "_models.NetworkSecurityGroup": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - network_security_group_name: str, - parameters: "_models.NetworkSecurityGroup", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkSecurityGroup"]: - """Creates or updates a network security group in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param parameters: Parameters supplied to the create or update network security group - operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkSecurityGroup or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - network_security_group_name=network_security_group_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - def list_all( - self, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: - """Gets all network security groups in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkSecurityGroupListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroupListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkSecurityGroupListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkSecurityGroupListResult"]: - """Gets all network security groups in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkSecurityGroupListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroupListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkSecurityGroupListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_watchers_operations.py deleted file mode 100644 index 0aec719f7f4b..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_network_watchers_operations.py +++ /dev/null @@ -1,1505 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkWatchersOperations: - """NetworkWatchersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def create_or_update( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.NetworkWatcher", - **kwargs: Any - ) -> "_models.NetworkWatcher": - """Creates or updates a network watcher in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the network watcher resource. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkWatcher, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NetworkWatcher') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkWatcher', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkWatcher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - network_watcher_name: str, - **kwargs: Any - ) -> "_models.NetworkWatcher": - """Gets the specified network watcher by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkWatcher, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkWatcher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - network_watcher_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - network_watcher_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified network watcher resource. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkWatcherListResult"]: - """Gets all network watchers by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkWatcherListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkWatcherListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkWatcherListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} # type: ignore - - def list_all( - self, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkWatcherListResult"]: - """Gets all network watchers by subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkWatcherListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkWatcherListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkWatcherListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} # type: ignore - - async def get_topology( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.TopologyParameters", - **kwargs: Any - ) -> "_models.Topology": - """Gets the current network topology by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the representation of topology. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.TopologyParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Topology, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Topology - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.get_topology.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TopologyParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Topology', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} # type: ignore - - async def _verify_ip_flow_initial( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.VerificationIPFlowParameters", - **kwargs: Any - ) -> "_models.VerificationIPFlowResult": - cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._verify_ip_flow_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _verify_ip_flow_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} # type: ignore - - async def begin_verify_ip_flow( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.VerificationIPFlowParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.VerificationIPFlowResult"]: - """Verify IP flow from the specified VM to a location given the currently configured NSG rules. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the IP flow to be verified. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VerificationIPFlowParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either VerificationIPFlowResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VerificationIPFlowResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._verify_ip_flow_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} # type: ignore - - async def _get_next_hop_initial( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.NextHopParameters", - **kwargs: Any - ) -> "_models.NextHopResult": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_next_hop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NextHopParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NextHopResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('NextHopResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_next_hop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} # type: ignore - - async def begin_get_next_hop( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.NextHopParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.NextHopResult"]: - """Gets the next hop from the specified VM. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the source and destination endpoint. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.NextHopParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NextHopResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.NextHopResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_next_hop_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NextHopResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} # type: ignore - - async def _get_vm_security_rules_initial( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.SecurityGroupViewParameters", - **kwargs: Any - ) -> "_models.SecurityGroupViewResult": - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_vm_security_rules_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_vm_security_rules_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} # type: ignore - - async def begin_get_vm_security_rules( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.SecurityGroupViewParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.SecurityGroupViewResult"]: - """Gets the configured and effective security group rules on the specified VM. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the VM to check security groups for. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.SecurityGroupViewParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either SecurityGroupViewResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.SecurityGroupViewResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_vm_security_rules_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} # type: ignore - - async def _get_troubleshooting_initial( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.TroubleshootingParameters", - **kwargs: Any - ) -> "_models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_troubleshooting_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TroubleshootingParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_troubleshooting_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} # type: ignore - - async def begin_get_troubleshooting( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.TroubleshootingParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.TroubleshootingResult"]: - """Initiate troubleshooting on a specified resource. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that define the resource to troubleshoot. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.TroubleshootingParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_troubleshooting_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} # type: ignore - - async def _get_troubleshooting_result_initial( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.QueryTroubleshootingParameters", - **kwargs: Any - ) -> "_models.TroubleshootingResult": - cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_troubleshooting_result_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_troubleshooting_result_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} # type: ignore - - async def begin_get_troubleshooting_result( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.QueryTroubleshootingParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.TroubleshootingResult"]: - """Get the last completed troubleshooting result on a specified resource. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that define the resource to query the troubleshooting result. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.QueryTroubleshootingParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either TroubleshootingResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_troubleshooting_result_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} # type: ignore - - async def _set_flow_log_configuration_initial( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.FlowLogInformation", - **kwargs: Any - ) -> "_models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._set_flow_log_configuration_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'FlowLogInformation') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _set_flow_log_configuration_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} # type: ignore - - async def begin_set_flow_log_configuration( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.FlowLogInformation", - **kwargs: Any - ) -> AsyncLROPoller["_models.FlowLogInformation"]: - """Configures flow log on a specified resource. - - :param resource_group_name: The name of the network watcher resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that define the configuration of flow log. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.FlowLogInformation - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._set_flow_log_configuration_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} # type: ignore - - async def _get_flow_log_status_initial( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.FlowLogStatusParameters", - **kwargs: Any - ) -> "_models.FlowLogInformation": - cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_flow_log_status_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_flow_log_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} # type: ignore - - async def begin_get_flow_log_status( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.FlowLogStatusParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.FlowLogInformation"]: - """Queries status of flow log on a specified resource. - - :param resource_group_name: The name of the network watcher resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that define a resource to query flow log status. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.FlowLogStatusParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either FlowLogInformation or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_flow_log_status_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} # type: ignore - - async def _check_connectivity_initial( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.ConnectivityParameters", - **kwargs: Any - ) -> "_models.ConnectivityInformation": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._check_connectivity_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ConnectivityParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ConnectivityInformation', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('ConnectivityInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _check_connectivity_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} # type: ignore - - async def begin_check_connectivity( - self, - resource_group_name: str, - network_watcher_name: str, - parameters: "_models.ConnectivityParameters", - **kwargs: Any - ) -> AsyncLROPoller["_models.ConnectivityInformation"]: - """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a - given endpoint including another VM or an arbitrary remote server. - - :param resource_group_name: The name of the network watcher resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that determine how the connectivity check will be performed. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ConnectivityParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ConnectivityInformation or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ConnectivityInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._check_connectivity_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ConnectivityInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_packet_captures_operations.py deleted file mode 100644 index d7a9e998cb87..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_packet_captures_operations.py +++ /dev/null @@ -1,662 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PacketCapturesOperations: - """PacketCapturesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _create_initial( - self, - resource_group_name: str, - network_watcher_name: str, - packet_capture_name: str, - parameters: "_models.PacketCapture", - **kwargs: Any - ) -> "_models.PacketCaptureResult": - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PacketCapture') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PacketCaptureResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - async def begin_create( - self, - resource_group_name: str, - network_watcher_name: str, - packet_capture_name: str, - parameters: "_models.PacketCapture", - **kwargs: Any - ) -> AsyncLROPoller["_models.PacketCaptureResult"]: - """Create and start a packet capture on the specified VM. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param packet_capture_name: The name of the packet capture session. - :type packet_capture_name: str - :param parameters: Parameters that define the create packet capture operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.PacketCapture - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PacketCaptureResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - packet_capture_name=packet_capture_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PacketCaptureResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - network_watcher_name: str, - packet_capture_name: str, - **kwargs: Any - ) -> "_models.PacketCaptureResult": - """Gets a packet capture session by name. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param packet_capture_name: The name of the packet capture session. - :type packet_capture_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PacketCaptureResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - network_watcher_name: str, - packet_capture_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - network_watcher_name: str, - packet_capture_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified packet capture session. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param packet_capture_name: The name of the packet capture session. - :type packet_capture_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - packet_capture_name=packet_capture_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - async def _stop_initial( - self, - resource_group_name: str, - network_watcher_name: str, - packet_capture_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} # type: ignore - - async def begin_stop( - self, - resource_group_name: str, - network_watcher_name: str, - packet_capture_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Stops a specified packet capture session. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param packet_capture_name: The name of the packet capture session. - :type packet_capture_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._stop_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - packet_capture_name=packet_capture_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} # type: ignore - - async def _get_status_initial( - self, - resource_group_name: str, - network_watcher_name: str, - packet_capture_name: str, - **kwargs: Any - ) -> "_models.PacketCaptureQueryStatusResult": - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_status_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} # type: ignore - - async def begin_get_status( - self, - resource_group_name: str, - network_watcher_name: str, - packet_capture_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.PacketCaptureQueryStatusResult"]: - """Query the status of a running packet capture session. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the Network Watcher resource. - :type network_watcher_name: str - :param packet_capture_name: The name given to the packet capture session. - :type packet_capture_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.PacketCaptureQueryStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_status_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - packet_capture_name=packet_capture_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} # type: ignore - - def list( - self, - resource_group_name: str, - network_watcher_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PacketCaptureListResult"]: - """Lists all packet capture sessions within the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the Network Watcher resource. - :type network_watcher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PacketCaptureListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PacketCaptureListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PacketCaptureListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_public_ip_addresses_operations.py deleted file mode 100644 index e07c3cb946f6..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_public_ip_addresses_operations.py +++ /dev/null @@ -1,717 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PublicIPAddressesOperations: - """PublicIPAddressesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - public_ip_address_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - public_ip_address_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified public IP address. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param public_ip_address_name: The name of the subnet. - :type public_ip_address_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - public_ip_address_name=public_ip_address_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - public_ip_address_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.PublicIPAddress": - """Gets the specified public IP address in a specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param public_ip_address_name: The name of the subnet. - :type public_ip_address_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - public_ip_address_name: str, - parameters: "_models.PublicIPAddress", - **kwargs: Any - ) -> "_models.PublicIPAddress": - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PublicIPAddress') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - public_ip_address_name: str, - parameters: "_models.PublicIPAddress", - **kwargs: Any - ) -> AsyncLROPoller["_models.PublicIPAddress"]: - """Creates or updates a static or dynamic public IP address. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param public_ip_address_name: The name of the public IP address. - :type public_ip_address_name: str - :param parameters: Parameters supplied to the create or update public IP address operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PublicIPAddress or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.PublicIPAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - public_ip_address_name=public_ip_address_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - def list_all( - self, - **kwargs: Any - ) -> AsyncIterable["_models.PublicIPAddressListResult"]: - """Gets all the public IP addresses in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PublicIPAddressListResult"]: - """Gets all public IP addresses in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} # type: ignore - - def list_virtual_machine_scale_set_public_ip_addresses( - self, - resource_group_name: str, - virtual_machine_scale_set_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PublicIPAddressListResult"]: - """Gets information about all public IP addresses on a virtual machine scale set level. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} # type: ignore - - def list_virtual_machine_scale_set_vm_public_ip_addresses( - self, - resource_group_name: str, - virtual_machine_scale_set_name: str, - virtualmachine_index: str, - network_interface_name: str, - ip_configuration_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PublicIPAddressListResult"]: - """Gets information about all public IP addresses in a virtual machine IP configuration in a - virtual machine scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :param virtualmachine_index: The virtual machine index. - :type virtualmachine_index: str - :param network_interface_name: The network interface name. - :type network_interface_name: str - :param ip_configuration_name: The IP configuration name. - :type ip_configuration_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} # type: ignore - - async def get_virtual_machine_scale_set_public_ip_address( - self, - resource_group_name: str, - virtual_machine_scale_set_name: str, - virtualmachine_index: str, - network_interface_name: str, - ip_configuration_name: str, - public_ip_address_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.PublicIPAddress": - """Get the specified public IP address in a virtual machine scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :param virtualmachine_index: The virtual machine index. - :type virtualmachine_index: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param ip_configuration_name: The name of the IP configuration. - :type ip_configuration_name: str - :param public_ip_address_name: The name of the public IP Address. - :type public_ip_address_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - # Construct URL - url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filter_rules_operations.py deleted file mode 100644 index 82fe87ce4062..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filter_rules_operations.py +++ /dev/null @@ -1,561 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RouteFilterRulesOperations: - """RouteFilterRulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - route_filter_name: str, - rule_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - route_filter_name: str, - rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified rule from a route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param rule_name: The name of the rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - rule_name=rule_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - route_filter_name: str, - rule_name: str, - **kwargs: Any - ) -> "_models.RouteFilterRule": - """Gets the specified rule from a route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param rule_name: The name of the rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilterRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - route_filter_name: str, - rule_name: str, - route_filter_rule_parameters: "_models.RouteFilterRule", - **kwargs: Any - ) -> "_models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - route_filter_name: str, - rule_name: str, - route_filter_rule_parameters: "_models.RouteFilterRule", - **kwargs: Any - ) -> AsyncLROPoller["_models.RouteFilterRule"]: - """Creates or updates a route in the specified route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param rule_name: The name of the route filter rule. - :type rule_name: str - :param route_filter_rule_parameters: Parameters supplied to the create or update route filter - rule operation. - :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.RouteFilterRule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - rule_name=rule_name, - route_filter_rule_parameters=route_filter_rule_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - route_filter_name: str, - rule_name: str, - route_filter_rule_parameters: "_models.PatchRouteFilterRule", - **kwargs: Any - ) -> "_models.RouteFilterRule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - async def begin_update( - self, - resource_group_name: str, - route_filter_name: str, - rule_name: str, - route_filter_rule_parameters: "_models.PatchRouteFilterRule", - **kwargs: Any - ) -> AsyncLROPoller["_models.RouteFilterRule"]: - """Updates a route in the specified route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param rule_name: The name of the route filter rule. - :type rule_name: str - :param route_filter_rule_parameters: Parameters supplied to the update route filter rule - operation. - :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.PatchRouteFilterRule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RouteFilterRule or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - rule_name=rule_name, - route_filter_rule_parameters=route_filter_rule_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - def list_by_route_filter( - self, - resource_group_name: str, - route_filter_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RouteFilterRuleListResult"]: - """Gets all RouteFilterRules in a route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteFilterRuleListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_route_filter.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('RouteFilterRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filters_operations.py deleted file mode 100644 index 268136315aa6..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_filters_operations.py +++ /dev/null @@ -1,602 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RouteFiltersOperations: - """RouteFiltersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - route_filter_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - route_filter_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - route_filter_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.RouteFilter": - """Gets the specified route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param expand: Expands referenced express route bgp peering resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilter - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - route_filter_name: str, - route_filter_parameters: "_models.RouteFilter", - **kwargs: Any - ) -> "_models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - route_filter_name: str, - route_filter_parameters: "_models.RouteFilter", - **kwargs: Any - ) -> AsyncLROPoller["_models.RouteFilter"]: - """Creates or updates a route filter in a specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param route_filter_parameters: Parameters supplied to the create or update route filter - operation. - :type route_filter_parameters: ~azure.mgmt.network.v2017_08_01.models.RouteFilter - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilter] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - route_filter_parameters=route_filter_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - route_filter_name: str, - route_filter_parameters: "_models.PatchRouteFilter", - **kwargs: Any - ) -> "_models.RouteFilter": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - async def begin_update( - self, - resource_group_name: str, - route_filter_name: str, - route_filter_parameters: "_models.PatchRouteFilter", - **kwargs: Any - ) -> AsyncLROPoller["_models.RouteFilter"]: - """Updates a route filter in a specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param route_filter_parameters: Parameters supplied to the update route filter operation. - :type route_filter_parameters: ~azure.mgmt.network.v2017_08_01.models.PatchRouteFilter - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RouteFilter or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilter] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - route_filter_parameters=route_filter_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RouteFilterListResult"]: - """Gets all route filters in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteFilterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('RouteFilterListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} # type: ignore - - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.RouteFilterListResult"]: - """Gets all route filters in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteFilterListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('RouteFilterListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_tables_operations.py deleted file mode 100644 index 7b51e7f54b09..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_route_tables_operations.py +++ /dev/null @@ -1,477 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RouteTablesOperations: - """RouteTablesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - route_table_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - route_table_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - route_table_name=route_table_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - route_table_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.RouteTable": - """Gets the specified route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteTable - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteTable', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - route_table_name: str, - parameters: "_models.RouteTable", - **kwargs: Any - ) -> "_models.RouteTable": - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'RouteTable') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RouteTable', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RouteTable', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - route_table_name: str, - parameters: "_models.RouteTable", - **kwargs: Any - ) -> AsyncLROPoller["_models.RouteTable"]: - """Create or updates a route table in a specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param parameters: Parameters supplied to the create or update route table operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.RouteTable - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either RouteTable or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.RouteTable] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - route_table_name=route_table_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteTable', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RouteTableListResult"]: - """Gets all route tables in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteTableListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteTableListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('RouteTableListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} # type: ignore - - def list_all( - self, - **kwargs: Any - ) -> AsyncIterable["_models.RouteTableListResult"]: - """Gets all route tables in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteTableListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteTableListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('RouteTableListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_routes_operations.py deleted file mode 100644 index 8302468ed492..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_routes_operations.py +++ /dev/null @@ -1,428 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class RoutesOperations: - """RoutesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - route_table_name: str, - route_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - route_table_name: str, - route_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified route from a route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param route_name: The name of the route. - :type route_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - route_table_name=route_table_name, - route_name=route_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - route_table_name: str, - route_name: str, - **kwargs: Any - ) -> "_models.Route": - """Gets the specified route from a route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param route_name: The name of the route. - :type route_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Route - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Route', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - route_table_name: str, - route_name: str, - route_parameters: "_models.Route", - **kwargs: Any - ) -> "_models.Route": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_parameters, 'Route') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Route', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Route', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - route_table_name: str, - route_name: str, - route_parameters: "_models.Route", - **kwargs: Any - ) -> AsyncLROPoller["_models.Route"]: - """Creates or updates a route in the specified route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param route_name: The name of the route. - :type route_name: str - :param route_parameters: Parameters supplied to the create or update route operation. - :type route_parameters: ~azure.mgmt.network.v2017_08_01.models.Route - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Route or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.Route] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - route_table_name=route_table_name, - route_name=route_name, - route_parameters=route_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Route', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - def list( - self, - resource_group_name: str, - route_table_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RouteListResult"]: - """Gets all routes in a route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('RouteListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_security_rules_operations.py deleted file mode 100644 index f2a2b63d9188..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_security_rules_operations.py +++ /dev/null @@ -1,429 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SecurityRulesOperations: - """SecurityRulesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - network_security_group_name: str, - security_rule_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - network_security_group_name: str, - security_rule_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified network security rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param security_rule_name: The name of the security rule. - :type security_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - network_security_group_name=network_security_group_name, - security_rule_name=security_rule_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - network_security_group_name: str, - security_rule_name: str, - **kwargs: Any - ) -> "_models.SecurityRule": - """Get the specified network security rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param security_rule_name: The name of the security rule. - :type security_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - network_security_group_name: str, - security_rule_name: str, - security_rule_parameters: "_models.SecurityRule", - **kwargs: Any - ) -> "_models.SecurityRule": - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - network_security_group_name: str, - security_rule_name: str, - security_rule_parameters: "_models.SecurityRule", - **kwargs: Any - ) -> AsyncLROPoller["_models.SecurityRule"]: - """Creates or updates a security rule in the specified network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param security_rule_name: The name of the security rule. - :type security_rule_name: str - :param security_rule_parameters: Parameters supplied to the create or update network security - rule operation. - :type security_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.SecurityRule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either SecurityRule or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - network_security_group_name=network_security_group_name, - security_rule_name=security_rule_name, - security_rule_parameters=security_rule_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - def list( - self, - resource_group_name: str, - network_security_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.SecurityRuleListResult"]: - """Gets all security rules in a network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SecurityRuleListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.SecurityRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SecurityRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_subnets_operations.py deleted file mode 100644 index 1e30aaa6325f..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_subnets_operations.py +++ /dev/null @@ -1,433 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SubnetsOperations: - """SubnetsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - virtual_network_name: str, - subnet_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - virtual_network_name: str, - subnet_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified subnet. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param subnet_name: The name of the subnet. - :type subnet_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - subnet_name=subnet_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - virtual_network_name: str, - subnet_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.Subnet": - """Gets the specified subnet by virtual network and resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param subnet_name: The name of the subnet. - :type subnet_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Subnet - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Subnet', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - virtual_network_name: str, - subnet_name: str, - subnet_parameters: "_models.Subnet", - **kwargs: Any - ) -> "_models.Subnet": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(subnet_parameters, 'Subnet') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Subnet', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Subnet', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - virtual_network_name: str, - subnet_name: str, - subnet_parameters: "_models.Subnet", - **kwargs: Any - ) -> AsyncLROPoller["_models.Subnet"]: - """Creates or updates a subnet in the specified virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param subnet_name: The name of the subnet. - :type subnet_name: str - :param subnet_parameters: Parameters supplied to the create or update subnet operation. - :type subnet_parameters: ~azure.mgmt.network.v2017_08_01.models.Subnet - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Subnet or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.Subnet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - subnet_name=subnet_name, - subnet_parameters=subnet_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Subnet', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - def list( - self, - resource_group_name: str, - virtual_network_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.SubnetListResult"]: - """Gets all subnets in a virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SubnetListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.SubnetListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('SubnetListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_usages_operations.py deleted file mode 100644 index 70ff633786e3..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_usages_operations.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations: - """UsagesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.UsagesListResult"]: - """List network usages for a subscription. - - :param location: The location where resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UsagesListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.UsagesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('UsagesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateway_connections_operations.py deleted file mode 100644 index 1b2eb22d3079..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateway_connections_operations.py +++ /dev/null @@ -1,732 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualNetworkGatewayConnectionsOperations: - """VirtualNetworkGatewayConnectionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _create_or_update_initial( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - parameters: "_models.VirtualNetworkGatewayConnection", - **kwargs: Any - ) -> "_models.VirtualNetworkGatewayConnection": - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - parameters: "_models.VirtualNetworkGatewayConnection", - **kwargs: Any - ) -> AsyncLROPoller["_models.VirtualNetworkGatewayConnection"]: - """Creates or updates a virtual network gateway connection in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The name of the virtual network gateway - connection. - :type virtual_network_gateway_connection_name: str - :param parameters: Parameters supplied to the create or update virtual network gateway - connection operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - **kwargs: Any - ) -> "_models.VirtualNetworkGatewayConnection": - """Gets the specified virtual network gateway connection by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The name of the virtual network gateway - connection. - :type virtual_network_gateway_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified virtual network Gateway connection. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The name of the virtual network gateway - connection. - :type virtual_network_gateway_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - async def _set_shared_key_initial( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - parameters: "_models.ConnectionSharedKey", - **kwargs: Any - ) -> "_models.ConnectionSharedKey": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._set_shared_key_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ConnectionSharedKey') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _set_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore - - async def begin_set_shared_key( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - parameters: "_models.ConnectionSharedKey", - **kwargs: Any - ) -> AsyncLROPoller["_models.ConnectionSharedKey"]: - """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway - connection shared key for passed virtual network gateway connection in the specified resource - group through Network resource provider. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The virtual network gateway connection name. - :type virtual_network_gateway_connection_name: str - :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection - Shared key operation throughNetwork resource provider. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ConnectionSharedKey or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._set_shared_key_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore - - async def get_shared_key( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - **kwargs: Any - ) -> "_models.ConnectionSharedKey": - """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the - specified virtual network gateway connection shared key through Network resource provider. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The virtual network gateway connection shared - key name. - :type virtual_network_gateway_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get_shared_key.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.VirtualNetworkGatewayConnectionListResult"]: - """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways - connections created. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkGatewayConnectionListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGatewayConnectionListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} # type: ignore - - async def _reset_shared_key_initial( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - parameters: "_models.ConnectionResetSharedKey", - **kwargs: Any - ) -> Optional["_models.ConnectionResetSharedKey"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._reset_shared_key_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _reset_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} # type: ignore - - async def begin_reset_shared_key( - self, - resource_group_name: str, - virtual_network_gateway_connection_name: str, - parameters: "_models.ConnectionResetSharedKey", - **kwargs: Any - ) -> AsyncLROPoller["_models.ConnectionResetSharedKey"]: - """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway - connection shared key for passed virtual network gateway connection in the specified resource - group through Network resource provider. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The virtual network gateway connection reset - shared key Name. - :type virtual_network_gateway_connection_name: str - :param parameters: Parameters supplied to the begin reset virtual network gateway connection - shared key operation through network resource provider. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ConnectionResetSharedKey - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ConnectionResetSharedKey or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.ConnectionResetSharedKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._reset_shared_key_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateways_operations.py deleted file mode 100644 index 289f1ddbaad0..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_gateways_operations.py +++ /dev/null @@ -1,1340 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualNetworkGatewaysOperations: - """VirtualNetworkGatewaysOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _create_or_update_initial( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - parameters: "_models.VirtualNetworkGateway", - **kwargs: Any - ) -> "_models.VirtualNetworkGateway": - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - parameters: "_models.VirtualNetworkGateway", - **kwargs: Any - ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: - """Creates or updates a virtual network gateway in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to create or update virtual network gateway operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - **kwargs: Any - ) -> "_models.VirtualNetworkGateway": - """Gets the specified virtual network gateway by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - async def _delete_initial( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified virtual network gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.VirtualNetworkGatewayListResult"]: - """Gets all virtual network gateways by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkGatewayListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGatewayListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} # type: ignore - - def list_connections( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.VirtualNetworkGatewayListConnectionsResult"]: - """Gets all the connections in a virtual network gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkGatewayListConnectionsResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayListConnectionsResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_connections.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGatewayListConnectionsResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} # type: ignore - - async def _reset_initial( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - gateway_vip: Optional[str] = None, - **kwargs: Any - ) -> Optional["_models.VirtualNetworkGateway"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._reset_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if gateway_vip is not None: - query_parameters['gatewayVip'] = self._serialize.query("gateway_vip", gateway_vip, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _reset_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} # type: ignore - - async def begin_reset( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - gateway_vip: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.VirtualNetworkGateway"]: - """Resets the primary of the virtual network gateway in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param gateway_vip: Virtual network gateway vip address supplied to the begin reset of the - active-active feature enabled gateway. - :type gateway_vip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either VirtualNetworkGateway or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._reset_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - gateway_vip=gateway_vip, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} # type: ignore - - async def _generatevpnclientpackage_initial( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - parameters: "_models.VpnClientParameters", - **kwargs: Any - ) -> Optional[str]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._generatevpnclientpackage_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VpnClientParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _generatevpnclientpackage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} # type: ignore - - async def begin_generatevpnclientpackage( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - parameters: "_models.VpnClientParameters", - **kwargs: Any - ) -> AsyncLROPoller[str]: - """Generates VPN client package for P2S client of the virtual network gateway in the specified - resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network gateway VPN client - package operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VpnClientParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[str] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._generatevpnclientpackage_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} # type: ignore - - async def _generate_vpn_profile_initial( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - parameters: "_models.VpnClientParameters", - **kwargs: Any - ) -> Optional[str]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._generate_vpn_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VpnClientParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _generate_vpn_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} # type: ignore - - async def begin_generate_vpn_profile( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - parameters: "_models.VpnClientParameters", - **kwargs: Any - ) -> AsyncLROPoller[str]: - """Generates VPN profile for P2S client of the virtual network gateway in the specified resource - group. Used for IKEV2 and radius based authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network gateway VPN client - package operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VpnClientParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[str] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} # type: ignore - - async def _get_vpn_profile_package_url_initial( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - **kwargs: Any - ) -> Optional[str]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_vpn_profile_package_url_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_vpn_profile_package_url_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} # type: ignore - - async def begin_get_vpn_profile_package_url( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - **kwargs: Any - ) -> AsyncLROPoller[str]: - """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified - resource group. The profile needs to be generated first using generateVpnProfile. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either str or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[str] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_vpn_profile_package_url_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_vpn_profile_package_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} # type: ignore - - async def _get_bgp_peer_status_initial( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - peer: Optional[str] = None, - **kwargs: Any - ) -> Optional["_models.BgpPeerStatusListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_bgp_peer_status_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if peer is not None: - query_parameters['peer'] = self._serialize.query("peer", peer, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('BgpPeerStatusListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_bgp_peer_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} # type: ignore - - async def begin_get_bgp_peer_status( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - peer: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.BgpPeerStatusListResult"]: - """The GetBgpPeerStatus operation retrieves the status of all BGP peers. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param peer: The IP address of the peer to retrieve the status of. - :type peer: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either BgpPeerStatusListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.BgpPeerStatusListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_bgp_peer_status_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - peer=peer, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('BgpPeerStatusListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} # type: ignore - - async def _get_learned_routes_initial( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - **kwargs: Any - ) -> Optional["_models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_learned_routes_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_learned_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} # type: ignore - - async def begin_get_learned_routes( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: - """This operation retrieves a list of routes the virtual network gateway has learned, including - routes learned from BGP peers. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_learned_routes_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} # type: ignore - - async def _get_advertised_routes_initial( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - peer: str, - **kwargs: Any - ) -> Optional["_models.GatewayRouteListResult"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_advertised_routes_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['peer'] = self._serialize.query("peer", peer, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_advertised_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} # type: ignore - - async def begin_get_advertised_routes( - self, - resource_group_name: str, - virtual_network_gateway_name: str, - peer: str, - **kwargs: Any - ) -> AsyncLROPoller["_models.GatewayRouteListResult"]: - """This operation retrieves a list of routes the virtual network gateway is advertising to the - specified peer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param peer: The IP address of the peer. - :type peer: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either GatewayRouteListResult or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._get_advertised_routes_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - peer=peer, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_peerings_operations.py deleted file mode 100644 index 983fbf211d95..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_network_peerings_operations.py +++ /dev/null @@ -1,429 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualNetworkPeeringsOperations: - """VirtualNetworkPeeringsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - virtual_network_name: str, - virtual_network_peering_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - virtual_network_name: str, - virtual_network_peering_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified virtual network peering. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param virtual_network_peering_name: The name of the virtual network peering. - :type virtual_network_peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - virtual_network_peering_name=virtual_network_peering_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - virtual_network_name: str, - virtual_network_peering_name: str, - **kwargs: Any - ) -> "_models.VirtualNetworkPeering": - """Gets the specified virtual network peering. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param virtual_network_peering_name: The name of the virtual network peering. - :type virtual_network_peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - virtual_network_name: str, - virtual_network_peering_name: str, - virtual_network_peering_parameters: "_models.VirtualNetworkPeering", - **kwargs: Any - ) -> "_models.VirtualNetworkPeering": - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - virtual_network_name: str, - virtual_network_peering_name: str, - virtual_network_peering_parameters: "_models.VirtualNetworkPeering", - **kwargs: Any - ) -> AsyncLROPoller["_models.VirtualNetworkPeering"]: - """Creates or updates a peering in the specified virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param virtual_network_peering_name: The name of the peering. - :type virtual_network_peering_name: str - :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual - network peering operation. - :type virtual_network_peering_parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either VirtualNetworkPeering or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - virtual_network_peering_name=virtual_network_peering_name, - virtual_network_peering_parameters=virtual_network_peering_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - def list( - self, - resource_group_name: str, - virtual_network_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.VirtualNetworkPeeringListResult"]: - """Gets all virtual network peerings in a virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkPeeringListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeeringListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkPeeringListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_networks_operations.py deleted file mode 100644 index 5f2c25c20220..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/aio/operations/_virtual_networks_operations.py +++ /dev/null @@ -1,614 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class VirtualNetworksOperations: - """VirtualNetworksOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( - self, - resource_group_name: str, - virtual_network_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - async def begin_delete( - self, - resource_group_name: str, - virtual_network_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - virtual_network_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> "_models.VirtualNetwork": - """Gets the specified virtual network by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetwork - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualNetwork', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - virtual_network_name: str, - parameters: "_models.VirtualNetwork", - **kwargs: Any - ) -> "_models.VirtualNetwork": - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VirtualNetwork') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetwork', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetwork', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - async def begin_create_or_update( - self, - resource_group_name: str, - virtual_network_name: str, - parameters: "_models.VirtualNetwork", - **kwargs: Any - ) -> AsyncLROPoller["_models.VirtualNetwork"]: - """Creates or updates a virtual network in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param parameters: Parameters supplied to the create or update virtual network operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetwork - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either VirtualNetwork or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetwork', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - def list_all( - self, - **kwargs: Any - ) -> AsyncIterable["_models.VirtualNetworkListResult"]: - """Gets all virtual networks in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} # type: ignore - - def list( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.VirtualNetworkListResult"]: - """Gets all virtual networks in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} # type: ignore - - async def check_ip_address_availability( - self, - resource_group_name: str, - virtual_network_name: str, - ip_address: Optional[str] = None, - **kwargs: Any - ) -> "_models.IPAddressAvailabilityResult": - """Checks whether a private IP address is available for use. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param ip_address: The private IP address to be verified. - :type ip_address: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IPAddressAvailabilityResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.IPAddressAvailabilityResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.check_ip_address_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if ip_address is not None: - query_parameters['ipAddress'] = self._serialize.query("ip_address", ip_address, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IPAddressAvailabilityResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} # type: ignore - - def list_usage( - self, - resource_group_name: str, - virtual_network_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.VirtualNetworkListUsageResult"]: - """Lists usage stats. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkListUsageResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListUsageResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_usage.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkListUsageResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/__init__.py deleted file mode 100644 index e23134cb0203..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/__init__.py +++ /dev/null @@ -1,717 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AddressSpace - from ._models_py3 import ApplicationGateway - from ._models_py3 import ApplicationGatewayAuthenticationCertificate - from ._models_py3 import ApplicationGatewayAvailableSslOptions - from ._models_py3 import ApplicationGatewayAvailableSslPredefinedPolicies - from ._models_py3 import ApplicationGatewayAvailableWafRuleSetsResult - from ._models_py3 import ApplicationGatewayBackendAddress - from ._models_py3 import ApplicationGatewayBackendAddressPool - from ._models_py3 import ApplicationGatewayBackendHealth - from ._models_py3 import ApplicationGatewayBackendHealthHttpSettings - from ._models_py3 import ApplicationGatewayBackendHealthPool - from ._models_py3 import ApplicationGatewayBackendHealthServer - from ._models_py3 import ApplicationGatewayBackendHttpSettings - from ._models_py3 import ApplicationGatewayConnectionDraining - from ._models_py3 import ApplicationGatewayFirewallDisabledRuleGroup - from ._models_py3 import ApplicationGatewayFirewallRule - from ._models_py3 import ApplicationGatewayFirewallRuleGroup - from ._models_py3 import ApplicationGatewayFirewallRuleSet - from ._models_py3 import ApplicationGatewayFrontendIPConfiguration - from ._models_py3 import ApplicationGatewayFrontendPort - from ._models_py3 import ApplicationGatewayHttpListener - from ._models_py3 import ApplicationGatewayIPConfiguration - from ._models_py3 import ApplicationGatewayListResult - from ._models_py3 import ApplicationGatewayPathRule - from ._models_py3 import ApplicationGatewayProbe - from ._models_py3 import ApplicationGatewayProbeHealthResponseMatch - from ._models_py3 import ApplicationGatewayRedirectConfiguration - from ._models_py3 import ApplicationGatewayRequestRoutingRule - from ._models_py3 import ApplicationGatewaySku - from ._models_py3 import ApplicationGatewaySslCertificate - from ._models_py3 import ApplicationGatewaySslPolicy - from ._models_py3 import ApplicationGatewaySslPredefinedPolicy - from ._models_py3 import ApplicationGatewayUrlPathMap - from ._models_py3 import ApplicationGatewayWebApplicationFirewallConfiguration - from ._models_py3 import AuthorizationListResult - from ._models_py3 import AzureAsyncOperationResult - from ._models_py3 import BGPCommunity - from ._models_py3 import BackendAddressPool - from ._models_py3 import BgpPeerStatus - from ._models_py3 import BgpPeerStatusListResult - from ._models_py3 import BgpServiceCommunity - from ._models_py3 import BgpServiceCommunityListResult - from ._models_py3 import BgpSettings - from ._models_py3 import ConnectionResetSharedKey - from ._models_py3 import ConnectionSharedKey - from ._models_py3 import ConnectivityDestination - from ._models_py3 import ConnectivityHop - from ._models_py3 import ConnectivityInformation - from ._models_py3 import ConnectivityIssue - from ._models_py3 import ConnectivityParameters - from ._models_py3 import ConnectivitySource - from ._models_py3 import DhcpOptions - from ._models_py3 import DnsNameAvailabilityResult - from ._models_py3 import EffectiveNetworkSecurityGroup - from ._models_py3 import EffectiveNetworkSecurityGroupAssociation - from ._models_py3 import EffectiveNetworkSecurityGroupListResult - from ._models_py3 import EffectiveNetworkSecurityRule - from ._models_py3 import EffectiveRoute - from ._models_py3 import EffectiveRouteListResult - from ._models_py3 import EndpointServiceResult - from ._models_py3 import EndpointServicesListResult - from ._models_py3 import Error - from ._models_py3 import ErrorDetails - from ._models_py3 import ExpressRouteCircuit - from ._models_py3 import ExpressRouteCircuitArpTable - from ._models_py3 import ExpressRouteCircuitAuthorization - from ._models_py3 import ExpressRouteCircuitListResult - from ._models_py3 import ExpressRouteCircuitPeering - from ._models_py3 import ExpressRouteCircuitPeeringConfig - from ._models_py3 import ExpressRouteCircuitPeeringListResult - from ._models_py3 import ExpressRouteCircuitRoutesTable - from ._models_py3 import ExpressRouteCircuitRoutesTableSummary - from ._models_py3 import ExpressRouteCircuitServiceProviderProperties - from ._models_py3 import ExpressRouteCircuitSku - from ._models_py3 import ExpressRouteCircuitStats - from ._models_py3 import ExpressRouteCircuitsArpTableListResult - from ._models_py3 import ExpressRouteCircuitsRoutesTableListResult - from ._models_py3 import ExpressRouteCircuitsRoutesTableSummaryListResult - from ._models_py3 import ExpressRouteServiceProvider - from ._models_py3 import ExpressRouteServiceProviderBandwidthsOffered - from ._models_py3 import ExpressRouteServiceProviderListResult - from ._models_py3 import FlowLogInformation - from ._models_py3 import FlowLogStatusParameters - from ._models_py3 import FrontendIPConfiguration - from ._models_py3 import GatewayRoute - from ._models_py3 import GatewayRouteListResult - from ._models_py3 import IPAddressAvailabilityResult - from ._models_py3 import IPConfiguration - from ._models_py3 import InboundNatPool - from ._models_py3 import InboundNatRule - from ._models_py3 import InboundNatRuleListResult - from ._models_py3 import IpsecPolicy - from ._models_py3 import Ipv6ExpressRouteCircuitPeeringConfig - from ._models_py3 import LoadBalancer - from ._models_py3 import LoadBalancerBackendAddressPoolListResult - from ._models_py3 import LoadBalancerFrontendIPConfigurationListResult - from ._models_py3 import LoadBalancerListResult - from ._models_py3 import LoadBalancerLoadBalancingRuleListResult - from ._models_py3 import LoadBalancerProbeListResult - from ._models_py3 import LoadBalancerSku - from ._models_py3 import LoadBalancingRule - from ._models_py3 import LocalNetworkGateway - from ._models_py3 import LocalNetworkGatewayListResult - from ._models_py3 import NetworkInterface - from ._models_py3 import NetworkInterfaceAssociation - from ._models_py3 import NetworkInterfaceDnsSettings - from ._models_py3 import NetworkInterfaceIPConfiguration - from ._models_py3 import NetworkInterfaceIPConfigurationListResult - from ._models_py3 import NetworkInterfaceListResult - from ._models_py3 import NetworkInterfaceLoadBalancerListResult - from ._models_py3 import NetworkSecurityGroup - from ._models_py3 import NetworkSecurityGroupListResult - from ._models_py3 import NetworkWatcher - from ._models_py3 import NetworkWatcherListResult - from ._models_py3 import NextHopParameters - from ._models_py3 import NextHopResult - from ._models_py3 import OutboundNatRule - from ._models_py3 import PacketCapture - from ._models_py3 import PacketCaptureFilter - from ._models_py3 import PacketCaptureListResult - from ._models_py3 import PacketCaptureParameters - from ._models_py3 import PacketCaptureQueryStatusResult - from ._models_py3 import PacketCaptureResult - from ._models_py3 import PacketCaptureResultProperties - from ._models_py3 import PacketCaptureStorageLocation - from ._models_py3 import PatchRouteFilter - from ._models_py3 import PatchRouteFilterRule - from ._models_py3 import Probe - from ._models_py3 import PublicIPAddress - from ._models_py3 import PublicIPAddressDnsSettings - from ._models_py3 import PublicIPAddressListResult - from ._models_py3 import PublicIPAddressSku - from ._models_py3 import QueryTroubleshootingParameters - from ._models_py3 import Resource - from ._models_py3 import ResourceNavigationLink - from ._models_py3 import RetentionPolicyParameters - from ._models_py3 import Route - from ._models_py3 import RouteFilter - from ._models_py3 import RouteFilterListResult - from ._models_py3 import RouteFilterRule - from ._models_py3 import RouteFilterRuleListResult - from ._models_py3 import RouteListResult - from ._models_py3 import RouteTable - from ._models_py3 import RouteTableListResult - from ._models_py3 import SecurityGroupNetworkInterface - from ._models_py3 import SecurityGroupViewParameters - from ._models_py3 import SecurityGroupViewResult - from ._models_py3 import SecurityRule - from ._models_py3 import SecurityRuleAssociations - from ._models_py3 import SecurityRuleListResult - from ._models_py3 import ServiceEndpointPropertiesFormat - from ._models_py3 import SubResource - from ._models_py3 import Subnet - from ._models_py3 import SubnetAssociation - from ._models_py3 import SubnetListResult - from ._models_py3 import Topology - from ._models_py3 import TopologyAssociation - from ._models_py3 import TopologyParameters - from ._models_py3 import TopologyResource - from ._models_py3 import TroubleshootingDetails - from ._models_py3 import TroubleshootingParameters - from ._models_py3 import TroubleshootingRecommendedActions - from ._models_py3 import TroubleshootingResult - from ._models_py3 import TunnelConnectionHealth - from ._models_py3 import Usage - from ._models_py3 import UsageName - from ._models_py3 import UsagesListResult - from ._models_py3 import VerificationIPFlowParameters - from ._models_py3 import VerificationIPFlowResult - from ._models_py3 import VirtualNetwork - from ._models_py3 import VirtualNetworkConnectionGatewayReference - from ._models_py3 import VirtualNetworkGateway - from ._models_py3 import VirtualNetworkGatewayConnection - from ._models_py3 import VirtualNetworkGatewayConnectionListEntity - from ._models_py3 import VirtualNetworkGatewayConnectionListResult - from ._models_py3 import VirtualNetworkGatewayIPConfiguration - from ._models_py3 import VirtualNetworkGatewayListConnectionsResult - from ._models_py3 import VirtualNetworkGatewayListResult - from ._models_py3 import VirtualNetworkGatewaySku - from ._models_py3 import VirtualNetworkListResult - from ._models_py3 import VirtualNetworkListUsageResult - from ._models_py3 import VirtualNetworkPeering - from ._models_py3 import VirtualNetworkPeeringListResult - from ._models_py3 import VirtualNetworkUsage - from ._models_py3 import VirtualNetworkUsageName - from ._models_py3 import VpnClientConfiguration - from ._models_py3 import VpnClientParameters - from ._models_py3 import VpnClientRevokedCertificate - from ._models_py3 import VpnClientRootCertificate -except (SyntaxError, ImportError): - from ._models import AddressSpace # type: ignore - from ._models import ApplicationGateway # type: ignore - from ._models import ApplicationGatewayAuthenticationCertificate # type: ignore - from ._models import ApplicationGatewayAvailableSslOptions # type: ignore - from ._models import ApplicationGatewayAvailableSslPredefinedPolicies # type: ignore - from ._models import ApplicationGatewayAvailableWafRuleSetsResult # type: ignore - from ._models import ApplicationGatewayBackendAddress # type: ignore - from ._models import ApplicationGatewayBackendAddressPool # type: ignore - from ._models import ApplicationGatewayBackendHealth # type: ignore - from ._models import ApplicationGatewayBackendHealthHttpSettings # type: ignore - from ._models import ApplicationGatewayBackendHealthPool # type: ignore - from ._models import ApplicationGatewayBackendHealthServer # type: ignore - from ._models import ApplicationGatewayBackendHttpSettings # type: ignore - from ._models import ApplicationGatewayConnectionDraining # type: ignore - from ._models import ApplicationGatewayFirewallDisabledRuleGroup # type: ignore - from ._models import ApplicationGatewayFirewallRule # type: ignore - from ._models import ApplicationGatewayFirewallRuleGroup # type: ignore - from ._models import ApplicationGatewayFirewallRuleSet # type: ignore - from ._models import ApplicationGatewayFrontendIPConfiguration # type: ignore - from ._models import ApplicationGatewayFrontendPort # type: ignore - from ._models import ApplicationGatewayHttpListener # type: ignore - from ._models import ApplicationGatewayIPConfiguration # type: ignore - from ._models import ApplicationGatewayListResult # type: ignore - from ._models import ApplicationGatewayPathRule # type: ignore - from ._models import ApplicationGatewayProbe # type: ignore - from ._models import ApplicationGatewayProbeHealthResponseMatch # type: ignore - from ._models import ApplicationGatewayRedirectConfiguration # type: ignore - from ._models import ApplicationGatewayRequestRoutingRule # type: ignore - from ._models import ApplicationGatewaySku # type: ignore - from ._models import ApplicationGatewaySslCertificate # type: ignore - from ._models import ApplicationGatewaySslPolicy # type: ignore - from ._models import ApplicationGatewaySslPredefinedPolicy # type: ignore - from ._models import ApplicationGatewayUrlPathMap # type: ignore - from ._models import ApplicationGatewayWebApplicationFirewallConfiguration # type: ignore - from ._models import AuthorizationListResult # type: ignore - from ._models import AzureAsyncOperationResult # type: ignore - from ._models import BGPCommunity # type: ignore - from ._models import BackendAddressPool # type: ignore - from ._models import BgpPeerStatus # type: ignore - from ._models import BgpPeerStatusListResult # type: ignore - from ._models import BgpServiceCommunity # type: ignore - from ._models import BgpServiceCommunityListResult # type: ignore - from ._models import BgpSettings # type: ignore - from ._models import ConnectionResetSharedKey # type: ignore - from ._models import ConnectionSharedKey # type: ignore - from ._models import ConnectivityDestination # type: ignore - from ._models import ConnectivityHop # type: ignore - from ._models import ConnectivityInformation # type: ignore - from ._models import ConnectivityIssue # type: ignore - from ._models import ConnectivityParameters # type: ignore - from ._models import ConnectivitySource # type: ignore - from ._models import DhcpOptions # type: ignore - from ._models import DnsNameAvailabilityResult # type: ignore - from ._models import EffectiveNetworkSecurityGroup # type: ignore - from ._models import EffectiveNetworkSecurityGroupAssociation # type: ignore - from ._models import EffectiveNetworkSecurityGroupListResult # type: ignore - from ._models import EffectiveNetworkSecurityRule # type: ignore - from ._models import EffectiveRoute # type: ignore - from ._models import EffectiveRouteListResult # type: ignore - from ._models import EndpointServiceResult # type: ignore - from ._models import EndpointServicesListResult # type: ignore - from ._models import Error # type: ignore - from ._models import ErrorDetails # type: ignore - from ._models import ExpressRouteCircuit # type: ignore - from ._models import ExpressRouteCircuitArpTable # type: ignore - from ._models import ExpressRouteCircuitAuthorization # type: ignore - from ._models import ExpressRouteCircuitListResult # type: ignore - from ._models import ExpressRouteCircuitPeering # type: ignore - from ._models import ExpressRouteCircuitPeeringConfig # type: ignore - from ._models import ExpressRouteCircuitPeeringListResult # type: ignore - from ._models import ExpressRouteCircuitRoutesTable # type: ignore - from ._models import ExpressRouteCircuitRoutesTableSummary # type: ignore - from ._models import ExpressRouteCircuitServiceProviderProperties # type: ignore - from ._models import ExpressRouteCircuitSku # type: ignore - from ._models import ExpressRouteCircuitStats # type: ignore - from ._models import ExpressRouteCircuitsArpTableListResult # type: ignore - from ._models import ExpressRouteCircuitsRoutesTableListResult # type: ignore - from ._models import ExpressRouteCircuitsRoutesTableSummaryListResult # type: ignore - from ._models import ExpressRouteServiceProvider # type: ignore - from ._models import ExpressRouteServiceProviderBandwidthsOffered # type: ignore - from ._models import ExpressRouteServiceProviderListResult # type: ignore - from ._models import FlowLogInformation # type: ignore - from ._models import FlowLogStatusParameters # type: ignore - from ._models import FrontendIPConfiguration # type: ignore - from ._models import GatewayRoute # type: ignore - from ._models import GatewayRouteListResult # type: ignore - from ._models import IPAddressAvailabilityResult # type: ignore - from ._models import IPConfiguration # type: ignore - from ._models import InboundNatPool # type: ignore - from ._models import InboundNatRule # type: ignore - from ._models import InboundNatRuleListResult # type: ignore - from ._models import IpsecPolicy # type: ignore - from ._models import Ipv6ExpressRouteCircuitPeeringConfig # type: ignore - from ._models import LoadBalancer # type: ignore - from ._models import LoadBalancerBackendAddressPoolListResult # type: ignore - from ._models import LoadBalancerFrontendIPConfigurationListResult # type: ignore - from ._models import LoadBalancerListResult # type: ignore - from ._models import LoadBalancerLoadBalancingRuleListResult # type: ignore - from ._models import LoadBalancerProbeListResult # type: ignore - from ._models import LoadBalancerSku # type: ignore - from ._models import LoadBalancingRule # type: ignore - from ._models import LocalNetworkGateway # type: ignore - from ._models import LocalNetworkGatewayListResult # type: ignore - from ._models import NetworkInterface # type: ignore - from ._models import NetworkInterfaceAssociation # type: ignore - from ._models import NetworkInterfaceDnsSettings # type: ignore - from ._models import NetworkInterfaceIPConfiguration # type: ignore - from ._models import NetworkInterfaceIPConfigurationListResult # type: ignore - from ._models import NetworkInterfaceListResult # type: ignore - from ._models import NetworkInterfaceLoadBalancerListResult # type: ignore - from ._models import NetworkSecurityGroup # type: ignore - from ._models import NetworkSecurityGroupListResult # type: ignore - from ._models import NetworkWatcher # type: ignore - from ._models import NetworkWatcherListResult # type: ignore - from ._models import NextHopParameters # type: ignore - from ._models import NextHopResult # type: ignore - from ._models import OutboundNatRule # type: ignore - from ._models import PacketCapture # type: ignore - from ._models import PacketCaptureFilter # type: ignore - from ._models import PacketCaptureListResult # type: ignore - from ._models import PacketCaptureParameters # type: ignore - from ._models import PacketCaptureQueryStatusResult # type: ignore - from ._models import PacketCaptureResult # type: ignore - from ._models import PacketCaptureResultProperties # type: ignore - from ._models import PacketCaptureStorageLocation # type: ignore - from ._models import PatchRouteFilter # type: ignore - from ._models import PatchRouteFilterRule # type: ignore - from ._models import Probe # type: ignore - from ._models import PublicIPAddress # type: ignore - from ._models import PublicIPAddressDnsSettings # type: ignore - from ._models import PublicIPAddressListResult # type: ignore - from ._models import PublicIPAddressSku # type: ignore - from ._models import QueryTroubleshootingParameters # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceNavigationLink # type: ignore - from ._models import RetentionPolicyParameters # type: ignore - from ._models import Route # type: ignore - from ._models import RouteFilter # type: ignore - from ._models import RouteFilterListResult # type: ignore - from ._models import RouteFilterRule # type: ignore - from ._models import RouteFilterRuleListResult # type: ignore - from ._models import RouteListResult # type: ignore - from ._models import RouteTable # type: ignore - from ._models import RouteTableListResult # type: ignore - from ._models import SecurityGroupNetworkInterface # type: ignore - from ._models import SecurityGroupViewParameters # type: ignore - from ._models import SecurityGroupViewResult # type: ignore - from ._models import SecurityRule # type: ignore - from ._models import SecurityRuleAssociations # type: ignore - from ._models import SecurityRuleListResult # type: ignore - from ._models import ServiceEndpointPropertiesFormat # type: ignore - from ._models import SubResource # type: ignore - from ._models import Subnet # type: ignore - from ._models import SubnetAssociation # type: ignore - from ._models import SubnetListResult # type: ignore - from ._models import Topology # type: ignore - from ._models import TopologyAssociation # type: ignore - from ._models import TopologyParameters # type: ignore - from ._models import TopologyResource # type: ignore - from ._models import TroubleshootingDetails # type: ignore - from ._models import TroubleshootingParameters # type: ignore - from ._models import TroubleshootingRecommendedActions # type: ignore - from ._models import TroubleshootingResult # type: ignore - from ._models import TunnelConnectionHealth # type: ignore - from ._models import Usage # type: ignore - from ._models import UsageName # type: ignore - from ._models import UsagesListResult # type: ignore - from ._models import VerificationIPFlowParameters # type: ignore - from ._models import VerificationIPFlowResult # type: ignore - from ._models import VirtualNetwork # type: ignore - from ._models import VirtualNetworkConnectionGatewayReference # type: ignore - from ._models import VirtualNetworkGateway # type: ignore - from ._models import VirtualNetworkGatewayConnection # type: ignore - from ._models import VirtualNetworkGatewayConnectionListEntity # type: ignore - from ._models import VirtualNetworkGatewayConnectionListResult # type: ignore - from ._models import VirtualNetworkGatewayIPConfiguration # type: ignore - from ._models import VirtualNetworkGatewayListConnectionsResult # type: ignore - from ._models import VirtualNetworkGatewayListResult # type: ignore - from ._models import VirtualNetworkGatewaySku # type: ignore - from ._models import VirtualNetworkListResult # type: ignore - from ._models import VirtualNetworkListUsageResult # type: ignore - from ._models import VirtualNetworkPeering # type: ignore - from ._models import VirtualNetworkPeeringListResult # type: ignore - from ._models import VirtualNetworkUsage # type: ignore - from ._models import VirtualNetworkUsageName # type: ignore - from ._models import VpnClientConfiguration # type: ignore - from ._models import VpnClientParameters # type: ignore - from ._models import VpnClientRevokedCertificate # type: ignore - from ._models import VpnClientRootCertificate # type: ignore - -from ._network_management_client_enums import ( - Access, - ApplicationGatewayBackendHealthServerHealth, - ApplicationGatewayCookieBasedAffinity, - ApplicationGatewayFirewallMode, - ApplicationGatewayOperationalState, - ApplicationGatewayProtocol, - ApplicationGatewayRedirectType, - ApplicationGatewayRequestRoutingRuleType, - ApplicationGatewaySkuName, - ApplicationGatewaySslCipherSuite, - ApplicationGatewaySslPolicyName, - ApplicationGatewaySslPolicyType, - ApplicationGatewaySslProtocol, - ApplicationGatewayTier, - AssociationType, - AuthenticationMethod, - AuthorizationUseStatus, - BgpPeerState, - ConnectionStatus, - DhGroup, - Direction, - EffectiveRouteSource, - EffectiveRouteState, - EffectiveSecurityRuleProtocol, - ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, - ExpressRouteCircuitPeeringState, - ExpressRouteCircuitPeeringType, - ExpressRouteCircuitSkuFamily, - ExpressRouteCircuitSkuTier, - IPAllocationMethod, - IPVersion, - IkeEncryption, - IkeIntegrity, - IpsecEncryption, - IpsecIntegrity, - IssueType, - LoadBalancerSkuName, - LoadDistribution, - NetworkOperationStatus, - NextHopType, - Origin, - PcError, - PcProtocol, - PcStatus, - PfsGroup, - ProbeProtocol, - ProcessorArchitecture, - Protocol, - ProvisioningState, - PublicIPAddressSkuName, - RouteFilterRuleType, - RouteNextHopType, - SecurityRuleAccess, - SecurityRuleDirection, - SecurityRuleProtocol, - ServiceProviderProvisioningState, - Severity, - TransportProtocol, - UsageUnit, - VirtualNetworkGatewayConnectionStatus, - VirtualNetworkGatewayConnectionType, - VirtualNetworkGatewaySkuName, - VirtualNetworkGatewaySkuTier, - VirtualNetworkGatewayType, - VirtualNetworkPeeringState, - VpnClientProtocol, - VpnType, -) - -__all__ = [ - 'AddressSpace', - 'ApplicationGateway', - 'ApplicationGatewayAuthenticationCertificate', - 'ApplicationGatewayAvailableSslOptions', - 'ApplicationGatewayAvailableSslPredefinedPolicies', - 'ApplicationGatewayAvailableWafRuleSetsResult', - 'ApplicationGatewayBackendAddress', - 'ApplicationGatewayBackendAddressPool', - 'ApplicationGatewayBackendHealth', - 'ApplicationGatewayBackendHealthHttpSettings', - 'ApplicationGatewayBackendHealthPool', - 'ApplicationGatewayBackendHealthServer', - 'ApplicationGatewayBackendHttpSettings', - 'ApplicationGatewayConnectionDraining', - 'ApplicationGatewayFirewallDisabledRuleGroup', - 'ApplicationGatewayFirewallRule', - 'ApplicationGatewayFirewallRuleGroup', - 'ApplicationGatewayFirewallRuleSet', - 'ApplicationGatewayFrontendIPConfiguration', - 'ApplicationGatewayFrontendPort', - 'ApplicationGatewayHttpListener', - 'ApplicationGatewayIPConfiguration', - 'ApplicationGatewayListResult', - 'ApplicationGatewayPathRule', - 'ApplicationGatewayProbe', - 'ApplicationGatewayProbeHealthResponseMatch', - 'ApplicationGatewayRedirectConfiguration', - 'ApplicationGatewayRequestRoutingRule', - 'ApplicationGatewaySku', - 'ApplicationGatewaySslCertificate', - 'ApplicationGatewaySslPolicy', - 'ApplicationGatewaySslPredefinedPolicy', - 'ApplicationGatewayUrlPathMap', - 'ApplicationGatewayWebApplicationFirewallConfiguration', - 'AuthorizationListResult', - 'AzureAsyncOperationResult', - 'BGPCommunity', - 'BackendAddressPool', - 'BgpPeerStatus', - 'BgpPeerStatusListResult', - 'BgpServiceCommunity', - 'BgpServiceCommunityListResult', - 'BgpSettings', - 'ConnectionResetSharedKey', - 'ConnectionSharedKey', - 'ConnectivityDestination', - 'ConnectivityHop', - 'ConnectivityInformation', - 'ConnectivityIssue', - 'ConnectivityParameters', - 'ConnectivitySource', - 'DhcpOptions', - 'DnsNameAvailabilityResult', - 'EffectiveNetworkSecurityGroup', - 'EffectiveNetworkSecurityGroupAssociation', - 'EffectiveNetworkSecurityGroupListResult', - 'EffectiveNetworkSecurityRule', - 'EffectiveRoute', - 'EffectiveRouteListResult', - 'EndpointServiceResult', - 'EndpointServicesListResult', - 'Error', - 'ErrorDetails', - 'ExpressRouteCircuit', - 'ExpressRouteCircuitArpTable', - 'ExpressRouteCircuitAuthorization', - 'ExpressRouteCircuitListResult', - 'ExpressRouteCircuitPeering', - 'ExpressRouteCircuitPeeringConfig', - 'ExpressRouteCircuitPeeringListResult', - 'ExpressRouteCircuitRoutesTable', - 'ExpressRouteCircuitRoutesTableSummary', - 'ExpressRouteCircuitServiceProviderProperties', - 'ExpressRouteCircuitSku', - 'ExpressRouteCircuitStats', - 'ExpressRouteCircuitsArpTableListResult', - 'ExpressRouteCircuitsRoutesTableListResult', - 'ExpressRouteCircuitsRoutesTableSummaryListResult', - 'ExpressRouteServiceProvider', - 'ExpressRouteServiceProviderBandwidthsOffered', - 'ExpressRouteServiceProviderListResult', - 'FlowLogInformation', - 'FlowLogStatusParameters', - 'FrontendIPConfiguration', - 'GatewayRoute', - 'GatewayRouteListResult', - 'IPAddressAvailabilityResult', - 'IPConfiguration', - 'InboundNatPool', - 'InboundNatRule', - 'InboundNatRuleListResult', - 'IpsecPolicy', - 'Ipv6ExpressRouteCircuitPeeringConfig', - 'LoadBalancer', - 'LoadBalancerBackendAddressPoolListResult', - 'LoadBalancerFrontendIPConfigurationListResult', - 'LoadBalancerListResult', - 'LoadBalancerLoadBalancingRuleListResult', - 'LoadBalancerProbeListResult', - 'LoadBalancerSku', - 'LoadBalancingRule', - 'LocalNetworkGateway', - 'LocalNetworkGatewayListResult', - 'NetworkInterface', - 'NetworkInterfaceAssociation', - 'NetworkInterfaceDnsSettings', - 'NetworkInterfaceIPConfiguration', - 'NetworkInterfaceIPConfigurationListResult', - 'NetworkInterfaceListResult', - 'NetworkInterfaceLoadBalancerListResult', - 'NetworkSecurityGroup', - 'NetworkSecurityGroupListResult', - 'NetworkWatcher', - 'NetworkWatcherListResult', - 'NextHopParameters', - 'NextHopResult', - 'OutboundNatRule', - 'PacketCapture', - 'PacketCaptureFilter', - 'PacketCaptureListResult', - 'PacketCaptureParameters', - 'PacketCaptureQueryStatusResult', - 'PacketCaptureResult', - 'PacketCaptureResultProperties', - 'PacketCaptureStorageLocation', - 'PatchRouteFilter', - 'PatchRouteFilterRule', - 'Probe', - 'PublicIPAddress', - 'PublicIPAddressDnsSettings', - 'PublicIPAddressListResult', - 'PublicIPAddressSku', - 'QueryTroubleshootingParameters', - 'Resource', - 'ResourceNavigationLink', - 'RetentionPolicyParameters', - 'Route', - 'RouteFilter', - 'RouteFilterListResult', - 'RouteFilterRule', - 'RouteFilterRuleListResult', - 'RouteListResult', - 'RouteTable', - 'RouteTableListResult', - 'SecurityGroupNetworkInterface', - 'SecurityGroupViewParameters', - 'SecurityGroupViewResult', - 'SecurityRule', - 'SecurityRuleAssociations', - 'SecurityRuleListResult', - 'ServiceEndpointPropertiesFormat', - 'SubResource', - 'Subnet', - 'SubnetAssociation', - 'SubnetListResult', - 'Topology', - 'TopologyAssociation', - 'TopologyParameters', - 'TopologyResource', - 'TroubleshootingDetails', - 'TroubleshootingParameters', - 'TroubleshootingRecommendedActions', - 'TroubleshootingResult', - 'TunnelConnectionHealth', - 'Usage', - 'UsageName', - 'UsagesListResult', - 'VerificationIPFlowParameters', - 'VerificationIPFlowResult', - 'VirtualNetwork', - 'VirtualNetworkConnectionGatewayReference', - 'VirtualNetworkGateway', - 'VirtualNetworkGatewayConnection', - 'VirtualNetworkGatewayConnectionListEntity', - 'VirtualNetworkGatewayConnectionListResult', - 'VirtualNetworkGatewayIPConfiguration', - 'VirtualNetworkGatewayListConnectionsResult', - 'VirtualNetworkGatewayListResult', - 'VirtualNetworkGatewaySku', - 'VirtualNetworkListResult', - 'VirtualNetworkListUsageResult', - 'VirtualNetworkPeering', - 'VirtualNetworkPeeringListResult', - 'VirtualNetworkUsage', - 'VirtualNetworkUsageName', - 'VpnClientConfiguration', - 'VpnClientParameters', - 'VpnClientRevokedCertificate', - 'VpnClientRootCertificate', - 'Access', - 'ApplicationGatewayBackendHealthServerHealth', - 'ApplicationGatewayCookieBasedAffinity', - 'ApplicationGatewayFirewallMode', - 'ApplicationGatewayOperationalState', - 'ApplicationGatewayProtocol', - 'ApplicationGatewayRedirectType', - 'ApplicationGatewayRequestRoutingRuleType', - 'ApplicationGatewaySkuName', - 'ApplicationGatewaySslCipherSuite', - 'ApplicationGatewaySslPolicyName', - 'ApplicationGatewaySslPolicyType', - 'ApplicationGatewaySslProtocol', - 'ApplicationGatewayTier', - 'AssociationType', - 'AuthenticationMethod', - 'AuthorizationUseStatus', - 'BgpPeerState', - 'ConnectionStatus', - 'DhGroup', - 'Direction', - 'EffectiveRouteSource', - 'EffectiveRouteState', - 'EffectiveSecurityRuleProtocol', - 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixState', - 'ExpressRouteCircuitPeeringState', - 'ExpressRouteCircuitPeeringType', - 'ExpressRouteCircuitSkuFamily', - 'ExpressRouteCircuitSkuTier', - 'IPAllocationMethod', - 'IPVersion', - 'IkeEncryption', - 'IkeIntegrity', - 'IpsecEncryption', - 'IpsecIntegrity', - 'IssueType', - 'LoadBalancerSkuName', - 'LoadDistribution', - 'NetworkOperationStatus', - 'NextHopType', - 'Origin', - 'PcError', - 'PcProtocol', - 'PcStatus', - 'PfsGroup', - 'ProbeProtocol', - 'ProcessorArchitecture', - 'Protocol', - 'ProvisioningState', - 'PublicIPAddressSkuName', - 'RouteFilterRuleType', - 'RouteNextHopType', - 'SecurityRuleAccess', - 'SecurityRuleDirection', - 'SecurityRuleProtocol', - 'ServiceProviderProvisioningState', - 'Severity', - 'TransportProtocol', - 'UsageUnit', - 'VirtualNetworkGatewayConnectionStatus', - 'VirtualNetworkGatewayConnectionType', - 'VirtualNetworkGatewaySkuName', - 'VirtualNetworkGatewaySkuTier', - 'VirtualNetworkGatewayType', - 'VirtualNetworkPeeringState', - 'VpnClientProtocol', - 'VpnType', -] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_models.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_models.py deleted file mode 100644 index 29c83c05824f..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_models.py +++ /dev/null @@ -1,7796 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import msrest.serialization - - -class AddressSpace(msrest.serialization.Model): - """AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. - - :param address_prefixes: A list of address blocks reserved for this virtual network in CIDR - notation. - :type address_prefixes: list[str] - """ - - _attribute_map = { - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(AddressSpace, self).__init__(**kwargs) - self.address_prefixes = kwargs.get('address_prefixes', None) - - -class Resource(msrest.serialization.Model): - """Common resource representation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - - -class ApplicationGateway(Resource): - """Application gateway resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param sku: SKU of the application gateway resource. - :type sku: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySku - :param ssl_policy: SSL policy of the application gateway resource. - :type ssl_policy: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicy - :ivar operational_state: Operational state of the application gateway resource. Possible values - include: "Stopped", "Starting", "Running", "Stopping". - :vartype operational_state: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayOperationalState - :param gateway_ip_configurations: Subnets of application the gateway resource. - :type gateway_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayIPConfiguration] - :param authentication_certificates: Authentication certificates of the application gateway - resource. - :type authentication_certificates: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAuthenticationCertificate] - :param ssl_certificates: SSL certificates of the application gateway resource. - :type ssl_certificates: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCertificate] - :param frontend_ip_configurations: Frontend IP addresses of the application gateway resource. - :type frontend_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFrontendIPConfiguration] - :param frontend_ports: Frontend ports of the application gateway resource. - :type frontend_ports: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFrontendPort] - :param probes: Probes of the application gateway resource. - :type probes: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProbe] - :param backend_address_pools: Backend address pool of the application gateway resource. - :type backend_address_pools: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddressPool] - :param backend_http_settings_collection: Backend http settings of the application gateway - resource. - :type backend_http_settings_collection: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHttpSettings] - :param http_listeners: Http listeners of the application gateway resource. - :type http_listeners: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayHttpListener] - :param url_path_maps: URL path map of the application gateway resource. - :type url_path_maps: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayUrlPathMap] - :param request_routing_rules: Request routing rules of the application gateway resource. - :type request_routing_rules: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRequestRoutingRule] - :param redirect_configurations: Redirect configurations of the application gateway resource. - :type redirect_configurations: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRedirectConfiguration] - :param web_application_firewall_configuration: Web application firewall configuration. - :type web_application_firewall_configuration: - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayWebApplicationFirewallConfiguration - :param resource_guid: Resource GUID property of the application gateway resource. - :type resource_guid: str - :param provisioning_state: Provisioning state of the application gateway resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'operational_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, - 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, - 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, - 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, - 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, - 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, - 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, - 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, - 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, - 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, - 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, - 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, - 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, - 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, - 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, - 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGateway, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.sku = kwargs.get('sku', None) - self.ssl_policy = kwargs.get('ssl_policy', None) - self.operational_state = None - self.gateway_ip_configurations = kwargs.get('gateway_ip_configurations', None) - self.authentication_certificates = kwargs.get('authentication_certificates', None) - self.ssl_certificates = kwargs.get('ssl_certificates', None) - self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) - self.frontend_ports = kwargs.get('frontend_ports', None) - self.probes = kwargs.get('probes', None) - self.backend_address_pools = kwargs.get('backend_address_pools', None) - self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) - self.http_listeners = kwargs.get('http_listeners', None) - self.url_path_maps = kwargs.get('url_path_maps', None) - self.request_routing_rules = kwargs.get('request_routing_rules', None) - self.redirect_configurations = kwargs.get('redirect_configurations', None) - self.web_application_firewall_configuration = kwargs.get('web_application_firewall_configuration', None) - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - :param id: Resource ID. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SubResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class ApplicationGatewayAuthenticationCertificate(SubResource): - """Authentication certificates of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param data: Certificate public data. - :type data: str - :param provisioning_state: Provisioning state of the authentication certificate resource. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'data': {'key': 'properties.data', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.data = kwargs.get('data', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayAvailableSslOptions(Resource): - """Response for ApplicationGatewayAvailableSslOptions API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param predefined_policies: List of available Ssl predefined policy. - :type predefined_policies: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param default_policy: Name of the Ssl predefined policy applied by default to application - gateway. Possible values include: "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", - "AppGwSslPolicy20170401S". - :type default_policy: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicyName - :param available_cipher_suites: List of available Ssl cipher suites. - :type available_cipher_suites: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCipherSuite] - :param available_protocols: List of available Ssl protocols. - :type available_protocols: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol] - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, - 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, - 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, - 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayAvailableSslOptions, self).__init__(**kwargs) - self.predefined_policies = kwargs.get('predefined_policies', None) - self.default_policy = kwargs.get('default_policy', None) - self.available_cipher_suites = kwargs.get('available_cipher_suites', None) - self.available_protocols = kwargs.get('available_protocols', None) - - -class ApplicationGatewayAvailableSslPredefinedPolicies(msrest.serialization.Model): - """Response for ApplicationGatewayAvailableSslOptions API service call. - - :param value: List of available Ssl predefined policy. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPredefinedPolicy] - :param next_link: URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationGatewaySslPredefinedPolicy]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayAvailableSslPredefinedPolicies, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ApplicationGatewayAvailableWafRuleSetsResult(msrest.serialization.Model): - """Response for ApplicationGatewayAvailableWafRuleSets API service call. - - :param value: The list of application gateway rule sets. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRuleSet] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class ApplicationGatewayBackendAddress(msrest.serialization.Model): - """Backend address of an application gateway. - - :param fqdn: Fully qualified domain name (FQDN). - :type fqdn: str - :param ip_address: IP address. - :type ip_address: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) - self.fqdn = kwargs.get('fqdn', None) - self.ip_address = kwargs.get('ip_address', None) - - -class ApplicationGatewayBackendAddressPool(SubResource): - """Backend Address Pool of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Resource that is unique within a resource group. This name can be used to access - the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param backend_ip_configurations: Collection of references to IPs defined in network - interfaces. - :type backend_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] - :param backend_addresses: Backend addresses. - :type backend_addresses: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddress] - :param provisioning_state: Provisioning state of the backend address pool resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, - 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayBackendAddressPool, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.backend_ip_configurations = kwargs.get('backend_ip_configurations', None) - self.backend_addresses = kwargs.get('backend_addresses', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayBackendHealth(msrest.serialization.Model): - """List of ApplicationGatewayBackendHealthPool resources. - - :param backend_address_pools: - :type backend_address_pools: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthPool] - """ - - _attribute_map = { - 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) - self.backend_address_pools = kwargs.get('backend_address_pools', None) - - -class ApplicationGatewayBackendHealthHttpSettings(msrest.serialization.Model): - """Application gateway BackendHealthHttp settings. - - :param backend_http_settings: Reference of an ApplicationGatewayBackendHttpSettings resource. - :type backend_http_settings: - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHttpSettings - :param servers: List of ApplicationGatewayBackendHealthServer resources. - :type servers: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthServer] - """ - - _attribute_map = { - 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, - 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) - self.backend_http_settings = kwargs.get('backend_http_settings', None) - self.servers = kwargs.get('servers', None) - - -class ApplicationGatewayBackendHealthPool(msrest.serialization.Model): - """Application gateway BackendHealth pool. - - :param backend_address_pool: Reference of an ApplicationGatewayBackendAddressPool resource. - :type backend_address_pool: - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddressPool - :param backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings - resources. - :type backend_http_settings_collection: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthHttpSettings] - """ - - _attribute_map = { - 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, - 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) - self.backend_address_pool = kwargs.get('backend_address_pool', None) - self.backend_http_settings_collection = kwargs.get('backend_http_settings_collection', None) - - -class ApplicationGatewayBackendHealthServer(msrest.serialization.Model): - """Application gateway backendhealth http settings. - - :param address: IP address or FQDN of backend server. - :type address: str - :param ip_configuration: Reference of IP configuration of backend server. - :type ip_configuration: ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration - :param health: Health of backend server. Possible values include: "Unknown", "Up", "Down", - "Partial", "Draining". - :type health: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthServerHealth - """ - - _attribute_map = { - 'address': {'key': 'address', 'type': 'str'}, - 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, - 'health': {'key': 'health', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) - self.address = kwargs.get('address', None) - self.ip_configuration = kwargs.get('ip_configuration', None) - self.health = kwargs.get('health', None) - - -class ApplicationGatewayBackendHttpSettings(SubResource): - """Backend address pool settings of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param port: Port. - :type port: int - :param protocol: Protocol. Possible values include: "Http", "Https". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProtocol - :param cookie_based_affinity: Cookie based affinity. Possible values include: "Enabled", - "Disabled". - :type cookie_based_affinity: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayCookieBasedAffinity - :param request_timeout: Request timeout in seconds. Application Gateway will fail the request - if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 - seconds. - :type request_timeout: int - :param probe: Probe resource of an application gateway. - :type probe: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param authentication_certificates: Array of references to application gateway authentication - certificates. - :type authentication_certificates: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param connection_draining: Connection draining of the backend http settings resource. - :type connection_draining: - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayConnectionDraining - :param host_name: Host header to be sent to the backend servers. - :type host_name: str - :param pick_host_name_from_backend_address: Whether to pick host header should be picked from - the host name of the backend server. Default value is false. - :type pick_host_name_from_backend_address: bool - :param affinity_cookie_name: Cookie name to use for the affinity cookie. - :type affinity_cookie_name: str - :param probe_enabled: Whether the probe is enabled. Default value is false. - :type probe_enabled: bool - :param path: Path which should be used as a prefix for all HTTP requests. Null means no path - will be prefixed. Default value is null. - :type path: str - :param provisioning_state: Provisioning state of the backend http settings resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'port': {'key': 'properties.port', 'type': 'int'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, - 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, - 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, - 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, - 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, - 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, - 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, - 'path': {'key': 'properties.path', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayBackendHttpSettings, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.port = kwargs.get('port', None) - self.protocol = kwargs.get('protocol', None) - self.cookie_based_affinity = kwargs.get('cookie_based_affinity', None) - self.request_timeout = kwargs.get('request_timeout', None) - self.probe = kwargs.get('probe', None) - self.authentication_certificates = kwargs.get('authentication_certificates', None) - self.connection_draining = kwargs.get('connection_draining', None) - self.host_name = kwargs.get('host_name', None) - self.pick_host_name_from_backend_address = kwargs.get('pick_host_name_from_backend_address', None) - self.affinity_cookie_name = kwargs.get('affinity_cookie_name', None) - self.probe_enabled = kwargs.get('probe_enabled', None) - self.path = kwargs.get('path', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayConnectionDraining(msrest.serialization.Model): - """Connection draining allows open connections to a backend server to be active for a specified time after the backend server got removed from the configuration. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether connection draining is enabled or not. - :type enabled: bool - :param drain_timeout_in_sec: Required. The number of seconds connection draining is active. - Acceptable values are from 1 second to 3600 seconds. - :type drain_timeout_in_sec: int - """ - - _validation = { - 'enabled': {'required': True}, - 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.drain_timeout_in_sec = kwargs['drain_timeout_in_sec'] - - -class ApplicationGatewayFirewallDisabledRuleGroup(msrest.serialization.Model): - """Allows to disable rules within a rule group or an entire rule group. - - All required parameters must be populated in order to send to Azure. - - :param rule_group_name: Required. The name of the rule group that will be disabled. - :type rule_group_name: str - :param rules: The list of rules that will be disabled. If null, all rules of the rule group - will be disabled. - :type rules: list[int] - """ - - _validation = { - 'rule_group_name': {'required': True}, - } - - _attribute_map = { - 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[int]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) - self.rule_group_name = kwargs['rule_group_name'] - self.rules = kwargs.get('rules', None) - - -class ApplicationGatewayFirewallRule(msrest.serialization.Model): - """A web application firewall rule. - - All required parameters must be populated in order to send to Azure. - - :param rule_id: Required. The identifier of the web application firewall rule. - :type rule_id: int - :param description: The description of the web application firewall rule. - :type description: str - """ - - _validation = { - 'rule_id': {'required': True}, - } - - _attribute_map = { - 'rule_id': {'key': 'ruleId', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) - self.rule_id = kwargs['rule_id'] - self.description = kwargs.get('description', None) - - -class ApplicationGatewayFirewallRuleGroup(msrest.serialization.Model): - """A web application firewall rule group. - - All required parameters must be populated in order to send to Azure. - - :param rule_group_name: Required. The name of the web application firewall rule group. - :type rule_group_name: str - :param description: The description of the web application firewall rule group. - :type description: str - :param rules: Required. The rules of the web application firewall rule group. - :type rules: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRule] - """ - - _validation = { - 'rule_group_name': {'required': True}, - 'rules': {'required': True}, - } - - _attribute_map = { - 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) - self.rule_group_name = kwargs['rule_group_name'] - self.description = kwargs.get('description', None) - self.rules = kwargs['rules'] - - -class ApplicationGatewayFirewallRuleSet(Resource): - """A web application firewall rule set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param provisioning_state: The provisioning state of the web application firewall rule set. - :type provisioning_state: str - :param rule_set_type: The type of the web application firewall rule set. - :type rule_set_type: str - :param rule_set_version: The version of the web application firewall rule set type. - :type rule_set_version: str - :param rule_groups: The rule groups of the web application firewall rule set. - :type rule_groups: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRuleGroup] - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, - 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, - 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayFirewallRuleSet, self).__init__(**kwargs) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.rule_set_type = kwargs.get('rule_set_type', None) - self.rule_set_version = kwargs.get('rule_set_version', None) - self.rule_groups = kwargs.get('rule_groups', None) - - -class ApplicationGatewayFrontendIPConfiguration(SubResource): - """Frontend IP configuration of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param private_ip_address: PrivateIPAddress of the network interface IP Configuration. - :type private_ip_address: str - :param private_ip_allocation_method: PrivateIP allocation method. Possible values include: - "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param subnet: Reference of the subnet resource. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param public_ip_address: Reference of the PublicIP resource. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Provisioning state of the public IP resource. Possible values are: - 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.private_ip_address = kwargs.get('private_ip_address', None) - self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) - self.subnet = kwargs.get('subnet', None) - self.public_ip_address = kwargs.get('public_ip_address', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayFrontendPort(SubResource): - """Frontend port of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param port: Frontend port. - :type port: int - :param provisioning_state: Provisioning state of the frontend port resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'port': {'key': 'properties.port', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayFrontendPort, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.port = kwargs.get('port', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayHttpListener(SubResource): - """Http listener of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param frontend_ip_configuration: Frontend IP configuration resource of an application gateway. - :type frontend_ip_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param frontend_port: Frontend port resource of an application gateway. - :type frontend_port: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param protocol: Protocol. Possible values include: "Http", "Https". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProtocol - :param host_name: Host name of HTTP listener. - :type host_name: str - :param ssl_certificate: SSL certificate resource of an application gateway. - :type ssl_certificate: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param require_server_name_indication: Applicable only if protocol is https. Enables SNI for - multi-hosting. - :type require_server_name_indication: bool - :param provisioning_state: Provisioning state of the HTTP listener resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, - 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, - 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayHttpListener, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) - self.frontend_port = kwargs.get('frontend_port', None) - self.protocol = kwargs.get('protocol', None) - self.host_name = kwargs.get('host_name', None) - self.ssl_certificate = kwargs.get('ssl_certificate', None) - self.require_server_name_indication = kwargs.get('require_server_name_indication', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayIPConfiguration(SubResource): - """IP configuration of an application gateway. Currently 1 public and 1 private IP configuration is allowed. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param subnet: Reference of the subnet resource. A subnet from where application gateway gets - its private address. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Provisioning state of the application gateway subnet resource. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayIPConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.subnet = kwargs.get('subnet', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayListResult(msrest.serialization.Model): - """Response for ListApplicationGateways API service call. - - :param value: List of an application gateways in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGateway] - :param next_link: URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationGateway]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ApplicationGatewayPathRule(SubResource): - """Path rule of URL path map of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param paths: Path rules of URL path map. - :type paths: list[str] - :param backend_address_pool: Backend address pool resource of URL path map path rule. - :type backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param backend_http_settings: Backend http settings resource of URL path map path rule. - :type backend_http_settings: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param redirect_configuration: Redirect configuration resource of URL path map path rule. - :type redirect_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Path rule of URL path map resource. Possible values are: 'Updating', - 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'paths': {'key': 'properties.paths', 'type': '[str]'}, - 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, - 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, - 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayPathRule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.paths = kwargs.get('paths', None) - self.backend_address_pool = kwargs.get('backend_address_pool', None) - self.backend_http_settings = kwargs.get('backend_http_settings', None) - self.redirect_configuration = kwargs.get('redirect_configuration', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayProbe(SubResource): - """Probe of the application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param protocol: Protocol. Possible values include: "Http", "Https". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProtocol - :param host: Host name to send the probe to. - :type host: str - :param path: Relative path of probe. Valid path starts from '/'. Probe is sent to - :code:``://:code:``::code:``:code:``. - :type path: str - :param interval: The probing interval in seconds. This is the time interval between two - consecutive probes. Acceptable values are from 1 second to 86400 seconds. - :type interval: int - :param timeout: the probe timeout in seconds. Probe marked as failed if valid response is not - received with this timeout period. Acceptable values are from 1 second to 86400 seconds. - :type timeout: int - :param unhealthy_threshold: The probe retry count. Backend server is marked down after - consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second - to 20. - :type unhealthy_threshold: int - :param pick_host_name_from_backend_http_settings: Whether the host header should be picked from - the backend http settings. Default value is false. - :type pick_host_name_from_backend_http_settings: bool - :param min_servers: Minimum number of servers that are always marked healthy. Default value is - 0. - :type min_servers: int - :param match: Criterion for classifying a healthy probe response. - :type match: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProbeHealthResponseMatch - :param provisioning_state: Provisioning state of the backend http settings resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'host': {'key': 'properties.host', 'type': 'str'}, - 'path': {'key': 'properties.path', 'type': 'str'}, - 'interval': {'key': 'properties.interval', 'type': 'int'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, - 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, - 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, - 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayProbe, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.protocol = kwargs.get('protocol', None) - self.host = kwargs.get('host', None) - self.path = kwargs.get('path', None) - self.interval = kwargs.get('interval', None) - self.timeout = kwargs.get('timeout', None) - self.unhealthy_threshold = kwargs.get('unhealthy_threshold', None) - self.pick_host_name_from_backend_http_settings = kwargs.get('pick_host_name_from_backend_http_settings', None) - self.min_servers = kwargs.get('min_servers', None) - self.match = kwargs.get('match', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayProbeHealthResponseMatch(msrest.serialization.Model): - """Application gateway probe health response match. - - :param body: Body that must be contained in the health response. Default value is empty. - :type body: str - :param status_codes: Allowed ranges of healthy status codes. Default range of healthy status - codes is 200-399. - :type status_codes: list[str] - """ - - _attribute_map = { - 'body': {'key': 'body', 'type': 'str'}, - 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) - self.body = kwargs.get('body', None) - self.status_codes = kwargs.get('status_codes', None) - - -class ApplicationGatewayRedirectConfiguration(SubResource): - """Redirect configuration of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param redirect_type: Supported http redirection types - Permanent, Temporary, Found, SeeOther. - Possible values include: "Permanent", "Found", "SeeOther", "Temporary". - :type redirect_type: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRedirectType - :param target_listener: Reference to a listener to redirect the request to. - :type target_listener: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param target_url: Url to redirect the request to. - :type target_url: str - :param include_path: Include path in the redirected url. - :type include_path: bool - :param include_query_string: Include query string in the redirected url. - :type include_query_string: bool - :param request_routing_rules: Request routing specifying redirect configuration. - :type request_routing_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param url_path_maps: Url path maps specifying default redirect configuration. - :type url_path_maps: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param path_rules: Path rules specifying redirect configuration. - :type path_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, - 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, - 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, - 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, - 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, - 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, - 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, - 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayRedirectConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.redirect_type = kwargs.get('redirect_type', None) - self.target_listener = kwargs.get('target_listener', None) - self.target_url = kwargs.get('target_url', None) - self.include_path = kwargs.get('include_path', None) - self.include_query_string = kwargs.get('include_query_string', None) - self.request_routing_rules = kwargs.get('request_routing_rules', None) - self.url_path_maps = kwargs.get('url_path_maps', None) - self.path_rules = kwargs.get('path_rules', None) - - -class ApplicationGatewayRequestRoutingRule(SubResource): - """Request routing rule of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param rule_type: Rule type. Possible values include: "Basic", "PathBasedRouting". - :type rule_type: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRequestRoutingRuleType - :param backend_address_pool: Backend address pool resource of the application gateway. - :type backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param backend_http_settings: Frontend port resource of the application gateway. - :type backend_http_settings: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param http_listener: Http listener resource of the application gateway. - :type http_listener: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param url_path_map: URL path map resource of the application gateway. - :type url_path_map: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param redirect_configuration: Redirect configuration resource of the application gateway. - :type redirect_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Provisioning state of the request routing rule resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, - 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, - 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, - 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, - 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, - 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayRequestRoutingRule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.rule_type = kwargs.get('rule_type', None) - self.backend_address_pool = kwargs.get('backend_address_pool', None) - self.backend_http_settings = kwargs.get('backend_http_settings', None) - self.http_listener = kwargs.get('http_listener', None) - self.url_path_map = kwargs.get('url_path_map', None) - self.redirect_configuration = kwargs.get('redirect_configuration', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewaySku(msrest.serialization.Model): - """SKU of an application gateway. - - :param name: Name of an application gateway SKU. Possible values include: "Standard_Small", - "Standard_Medium", "Standard_Large", "WAF_Medium", "WAF_Large". - :type name: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySkuName - :param tier: Tier of an application gateway. Possible values include: "Standard", "WAF". - :type tier: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayTier - :param capacity: Capacity (instance count) of an application gateway. - :type capacity: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewaySku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - self.capacity = kwargs.get('capacity', None) - - -class ApplicationGatewaySslCertificate(SubResource): - """SSL certificates of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param data: Base-64 encoded pfx certificate. Only applicable in PUT Request. - :type data: str - :param password: Password for the pfx file specified in data. Only applicable in PUT request. - :type password: str - :param public_cert_data: Base-64 encoded Public cert data corresponding to pfx specified in - data. Only applicable in GET request. - :type public_cert_data: str - :param provisioning_state: Provisioning state of the SSL certificate resource Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'data': {'key': 'properties.data', 'type': 'str'}, - 'password': {'key': 'properties.password', 'type': 'str'}, - 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewaySslCertificate, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.data = kwargs.get('data', None) - self.password = kwargs.get('password', None) - self.public_cert_data = kwargs.get('public_cert_data', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewaySslPolicy(msrest.serialization.Model): - """Application Gateway Ssl policy. - - :param disabled_ssl_protocols: Ssl protocols to be disabled on application gateway. - :type disabled_ssl_protocols: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol] - :param policy_type: Type of Ssl Policy. Possible values include: "Predefined", "Custom". - :type policy_type: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicyType - :param policy_name: Name of Ssl predefined policy. Possible values include: - "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", "AppGwSslPolicy20170401S". - :type policy_name: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicyName - :param cipher_suites: Ssl cipher suites to be enabled in the specified order to application - gateway. - :type cipher_suites: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCipherSuite] - :param min_protocol_version: Minimum version of Ssl protocol to be supported on application - gateway. Possible values include: "TLSv1_0", "TLSv1_1", "TLSv1_2". - :type min_protocol_version: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol - """ - - _attribute_map = { - 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'policy_name': {'key': 'policyName', 'type': 'str'}, - 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, - 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) - self.disabled_ssl_protocols = kwargs.get('disabled_ssl_protocols', None) - self.policy_type = kwargs.get('policy_type', None) - self.policy_name = kwargs.get('policy_name', None) - self.cipher_suites = kwargs.get('cipher_suites', None) - self.min_protocol_version = kwargs.get('min_protocol_version', None) - - -class ApplicationGatewaySslPredefinedPolicy(SubResource): - """An Ssl predefined policy. - - :param id: Resource ID. - :type id: str - :param name: Name of Ssl predefined policy. - :type name: str - :param cipher_suites: Ssl cipher suites to be enabled in the specified order for application - gateway. - :type cipher_suites: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCipherSuite] - :param min_protocol_version: Minimum version of Ssl protocol to be supported on application - gateway. Possible values include: "TLSv1_0", "TLSv1_1", "TLSv1_2". - :type min_protocol_version: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, - 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewaySslPredefinedPolicy, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.cipher_suites = kwargs.get('cipher_suites', None) - self.min_protocol_version = kwargs.get('min_protocol_version', None) - - -class ApplicationGatewayUrlPathMap(SubResource): - """UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param default_backend_address_pool: Default backend address pool resource of URL path map. - :type default_backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param default_backend_http_settings: Default backend http settings resource of URL path map. - :type default_backend_http_settings: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param default_redirect_configuration: Default redirect configuration resource of URL path map. - :type default_redirect_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param path_rules: Path rule of URL path map resource. - :type path_rules: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayPathRule] - :param provisioning_state: Provisioning state of the backend http settings resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, - 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, - 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, - 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayUrlPathMap, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.type = kwargs.get('type', None) - self.default_backend_address_pool = kwargs.get('default_backend_address_pool', None) - self.default_backend_http_settings = kwargs.get('default_backend_http_settings', None) - self.default_redirect_configuration = kwargs.get('default_redirect_configuration', None) - self.path_rules = kwargs.get('path_rules', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ApplicationGatewayWebApplicationFirewallConfiguration(msrest.serialization.Model): - """Application gateway web application firewall configuration. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether the web application firewall is enabled or not. - :type enabled: bool - :param firewall_mode: Required. Web application firewall mode. Possible values include: - "Detection", "Prevention". - :type firewall_mode: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallMode - :param rule_set_type: Required. The type of the web application firewall rule set. Possible - values are: 'OWASP'. - :type rule_set_type: str - :param rule_set_version: Required. The version of the rule set type. - :type rule_set_version: str - :param disabled_rule_groups: The disabled rule groups. - :type disabled_rule_groups: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallDisabledRuleGroup] - """ - - _validation = { - 'enabled': {'required': True}, - 'firewall_mode': {'required': True}, - 'rule_set_type': {'required': True}, - 'rule_set_version': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, - 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, - 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, - 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) - self.enabled = kwargs['enabled'] - self.firewall_mode = kwargs['firewall_mode'] - self.rule_set_type = kwargs['rule_set_type'] - self.rule_set_version = kwargs['rule_set_version'] - self.disabled_rule_groups = kwargs.get('disabled_rule_groups', None) - - -class AuthorizationListResult(msrest.serialization.Model): - """Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. - - :param value: The authorizations in an ExpressRoute Circuit. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitAuthorization]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AuthorizationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class AzureAsyncOperationResult(msrest.serialization.Model): - """The response body contains the status of the specified asynchronous operation, indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response body includes the HTTP status code for the successful request. If the asynchronous operation failed, the response body includes the HTTP status code for the failed request and error information regarding the failure. - - :param status: Status of the Azure async operation. Possible values are: 'InProgress', - 'Succeeded', and 'Failed'. Possible values include: "InProgress", "Succeeded", "Failed". - :type status: str or ~azure.mgmt.network.v2017_08_01.models.NetworkOperationStatus - :param error: - :type error: ~azure.mgmt.network.v2017_08_01.models.Error - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureAsyncOperationResult, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.error = kwargs.get('error', None) - - -class BackendAddressPool(SubResource): - """Pool of backend IP addresses. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :ivar backend_ip_configurations: Gets collection of references to IP addresses defined in - network interfaces. - :vartype backend_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] - :ivar load_balancing_rules: Gets load balancing rules that use this backend address pool. - :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :ivar outbound_nat_rule: Gets outbound rules that use this backend address pool. - :vartype outbound_nat_rule: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Get provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'backend_ip_configurations': {'readonly': True}, - 'load_balancing_rules': {'readonly': True}, - 'outbound_nat_rule': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, - 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(BackendAddressPool, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.backend_ip_configurations = None - self.load_balancing_rules = None - self.outbound_nat_rule = None - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class BGPCommunity(msrest.serialization.Model): - """Contains bgp community information offered in Service Community resources. - - :param service_supported_region: The region which the service support. e.g. For O365, region is - Global. - :type service_supported_region: str - :param community_name: The name of the bgp community. e.g. Skype. - :type community_name: str - :param community_value: The value of the bgp community. For more information: - https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - :type community_value: str - :param community_prefixes: The prefixes that the bgp community contains. - :type community_prefixes: list[str] - :param is_authorized_to_use: Customer is authorized to use bgp community or not. - :type is_authorized_to_use: bool - :param service_group: The service group of the bgp community contains. - :type service_group: str - """ - - _attribute_map = { - 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, - 'community_name': {'key': 'communityName', 'type': 'str'}, - 'community_value': {'key': 'communityValue', 'type': 'str'}, - 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, - 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, - 'service_group': {'key': 'serviceGroup', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(BGPCommunity, self).__init__(**kwargs) - self.service_supported_region = kwargs.get('service_supported_region', None) - self.community_name = kwargs.get('community_name', None) - self.community_value = kwargs.get('community_value', None) - self.community_prefixes = kwargs.get('community_prefixes', None) - self.is_authorized_to_use = kwargs.get('is_authorized_to_use', None) - self.service_group = kwargs.get('service_group', None) - - -class BgpPeerStatus(msrest.serialization.Model): - """BGP peer status details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar local_address: The virtual network gateway's local address. - :vartype local_address: str - :ivar neighbor: The remote BGP peer. - :vartype neighbor: str - :ivar asn: The autonomous system number of the remote BGP peer. - :vartype asn: int - :ivar state: The BGP peer state. Possible values include: "Unknown", "Stopped", "Idle", - "Connecting", "Connected". - :vartype state: str or ~azure.mgmt.network.v2017_08_01.models.BgpPeerState - :ivar connected_duration: For how long the peering has been up. - :vartype connected_duration: str - :ivar routes_received: The number of routes learned from this peer. - :vartype routes_received: long - :ivar messages_sent: The number of BGP messages sent. - :vartype messages_sent: long - :ivar messages_received: The number of BGP messages received. - :vartype messages_received: long - """ - - _validation = { - 'local_address': {'readonly': True}, - 'neighbor': {'readonly': True}, - 'asn': {'readonly': True}, - 'state': {'readonly': True}, - 'connected_duration': {'readonly': True}, - 'routes_received': {'readonly': True}, - 'messages_sent': {'readonly': True}, - 'messages_received': {'readonly': True}, - } - - _attribute_map = { - 'local_address': {'key': 'localAddress', 'type': 'str'}, - 'neighbor': {'key': 'neighbor', 'type': 'str'}, - 'asn': {'key': 'asn', 'type': 'int'}, - 'state': {'key': 'state', 'type': 'str'}, - 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, - 'routes_received': {'key': 'routesReceived', 'type': 'long'}, - 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, - 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(BgpPeerStatus, self).__init__(**kwargs) - self.local_address = None - self.neighbor = None - self.asn = None - self.state = None - self.connected_duration = None - self.routes_received = None - self.messages_sent = None - self.messages_received = None - - -class BgpPeerStatusListResult(msrest.serialization.Model): - """Response for list BGP peer status API service call. - - :param value: List of BGP peers. - :type value: list[~azure.mgmt.network.v2017_08_01.models.BgpPeerStatus] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, - } - - def __init__( - self, - **kwargs - ): - super(BgpPeerStatusListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class BgpServiceCommunity(Resource): - """Service Community Properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param service_name: The name of the bgp community. e.g. Skype. - :type service_name: str - :param bgp_communities: Get a list of bgp communities. - :type bgp_communities: list[~azure.mgmt.network.v2017_08_01.models.BGPCommunity] - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, - 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, - } - - def __init__( - self, - **kwargs - ): - super(BgpServiceCommunity, self).__init__(**kwargs) - self.service_name = kwargs.get('service_name', None) - self.bgp_communities = kwargs.get('bgp_communities', None) - - -class BgpServiceCommunityListResult(msrest.serialization.Model): - """Response for the ListServiceCommunity API service call. - - :param value: A list of service community resources. - :type value: list[~azure.mgmt.network.v2017_08_01.models.BgpServiceCommunity] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[BgpServiceCommunity]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(BgpServiceCommunityListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class BgpSettings(msrest.serialization.Model): - """BGP settings details. - - :param asn: The BGP speaker's ASN. - :type asn: long - :param bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. - :type bgp_peering_address: str - :param peer_weight: The weight added to routes learned from this BGP speaker. - :type peer_weight: int - """ - - _attribute_map = { - 'asn': {'key': 'asn', 'type': 'long'}, - 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, - 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(BgpSettings, self).__init__(**kwargs) - self.asn = kwargs.get('asn', None) - self.bgp_peering_address = kwargs.get('bgp_peering_address', None) - self.peer_weight = kwargs.get('peer_weight', None) - - -class ConnectionResetSharedKey(msrest.serialization.Model): - """The virtual network connection reset shared key. - - All required parameters must be populated in order to send to Azure. - - :param key_length: Required. The virtual network connection reset shared key length, should - between 1 and 128. - :type key_length: int - """ - - _validation = { - 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, - } - - _attribute_map = { - 'key_length': {'key': 'keyLength', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectionResetSharedKey, self).__init__(**kwargs) - self.key_length = kwargs['key_length'] - - -class ConnectionSharedKey(msrest.serialization.Model): - """Response for GetConnectionSharedKey API service call. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. The virtual network connection shared key value. - :type value: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectionSharedKey, self).__init__(**kwargs) - self.value = kwargs['value'] - - -class ConnectivityDestination(msrest.serialization.Model): - """Parameters that define destination of connection. - - :param resource_id: The ID of the resource to which a connection attempt will be made. - :type resource_id: str - :param address: The IP address or URI the resource to which a connection attempt will be made. - :type address: str - :param port: Port on which check connectivity will be performed. - :type port: int - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectivityDestination, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.address = kwargs.get('address', None) - self.port = kwargs.get('port', None) - - -class ConnectivityHop(msrest.serialization.Model): - """Information about a hop between the source and the destination. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The type of the hop. - :vartype type: str - :ivar id: The ID of the hop. - :vartype id: str - :ivar address: The IP address of the hop. - :vartype address: str - :ivar resource_id: The ID of the resource corresponding to this hop. - :vartype resource_id: str - :ivar next_hop_ids: List of next hop identifiers. - :vartype next_hop_ids: list[str] - :ivar issues: List of issues. - :vartype issues: list[~azure.mgmt.network.v2017_08_01.models.ConnectivityIssue] - """ - - _validation = { - 'type': {'readonly': True}, - 'id': {'readonly': True}, - 'address': {'readonly': True}, - 'resource_id': {'readonly': True}, - 'next_hop_ids': {'readonly': True}, - 'issues': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, - 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectivityHop, self).__init__(**kwargs) - self.type = None - self.id = None - self.address = None - self.resource_id = None - self.next_hop_ids = None - self.issues = None - - -class ConnectivityInformation(msrest.serialization.Model): - """Information on the connectivity status. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar hops: List of hops between the source and the destination. - :vartype hops: list[~azure.mgmt.network.v2017_08_01.models.ConnectivityHop] - :ivar connection_status: The connection status. Possible values include: "Unknown", - "Connected", "Disconnected", "Degraded". - :vartype connection_status: str or ~azure.mgmt.network.v2017_08_01.models.ConnectionStatus - :ivar avg_latency_in_ms: Average latency in milliseconds. - :vartype avg_latency_in_ms: int - :ivar min_latency_in_ms: Minimum latency in milliseconds. - :vartype min_latency_in_ms: int - :ivar max_latency_in_ms: Maximum latency in milliseconds. - :vartype max_latency_in_ms: int - :ivar probes_sent: Total number of probes sent. - :vartype probes_sent: int - :ivar probes_failed: Number of failed probes. - :vartype probes_failed: int - """ - - _validation = { - 'hops': {'readonly': True}, - 'connection_status': {'readonly': True}, - 'avg_latency_in_ms': {'readonly': True}, - 'min_latency_in_ms': {'readonly': True}, - 'max_latency_in_ms': {'readonly': True}, - 'probes_sent': {'readonly': True}, - 'probes_failed': {'readonly': True}, - } - - _attribute_map = { - 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, - 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, - 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, - 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, - 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, - 'probes_sent': {'key': 'probesSent', 'type': 'int'}, - 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectivityInformation, self).__init__(**kwargs) - self.hops = None - self.connection_status = None - self.avg_latency_in_ms = None - self.min_latency_in_ms = None - self.max_latency_in_ms = None - self.probes_sent = None - self.probes_failed = None - - -class ConnectivityIssue(msrest.serialization.Model): - """Information about an issue encountered in the process of checking for connectivity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the issue. Possible values include: "Local", "Inbound", "Outbound". - :vartype origin: str or ~azure.mgmt.network.v2017_08_01.models.Origin - :ivar severity: The severity of the issue. Possible values include: "Error", "Warning". - :vartype severity: str or ~azure.mgmt.network.v2017_08_01.models.Severity - :ivar type: The type of issue. Possible values include: "Unknown", "AgentStopped", - "GuestFirewall", "DnsResolution", "SocketBind", "NetworkSecurityRule", "UserDefinedRoute", - "PortThrottled", "Platform". - :vartype type: str or ~azure.mgmt.network.v2017_08_01.models.IssueType - :ivar context: Provides additional context on the issue. - :vartype context: list[dict[str, str]] - """ - - _validation = { - 'origin': {'readonly': True}, - 'severity': {'readonly': True}, - 'type': {'readonly': True}, - 'context': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'context': {'key': 'context', 'type': '[{str}]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectivityIssue, self).__init__(**kwargs) - self.origin = None - self.severity = None - self.type = None - self.context = None - - -class ConnectivityParameters(msrest.serialization.Model): - """Parameters that determine how the connectivity check will be performed. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. Parameters that define the source of the connection. - :type source: ~azure.mgmt.network.v2017_08_01.models.ConnectivitySource - :param destination: Required. Parameters that define destination of connection. - :type destination: ~azure.mgmt.network.v2017_08_01.models.ConnectivityDestination - """ - - _validation = { - 'source': {'required': True}, - 'destination': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ConnectivitySource'}, - 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectivityParameters, self).__init__(**kwargs) - self.source = kwargs['source'] - self.destination = kwargs['destination'] - - -class ConnectivitySource(msrest.serialization.Model): - """Parameters that define the source of the connection. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: Required. The ID of the resource from which a connectivity check will be - initiated. - :type resource_id: str - :param port: The source port from which a connectivity check will be performed. - :type port: int - """ - - _validation = { - 'resource_id': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectivitySource, self).__init__(**kwargs) - self.resource_id = kwargs['resource_id'] - self.port = kwargs.get('port', None) - - -class DhcpOptions(msrest.serialization.Model): - """DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. - - :param dns_servers: The list of DNS servers IP addresses. - :type dns_servers: list[str] - """ - - _attribute_map = { - 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(DhcpOptions, self).__init__(**kwargs) - self.dns_servers = kwargs.get('dns_servers', None) - - -class DnsNameAvailabilityResult(msrest.serialization.Model): - """Response for the CheckDnsNameAvailability API service call. - - :param available: Domain availability (True/False). - :type available: bool - """ - - _attribute_map = { - 'available': {'key': 'available', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(DnsNameAvailabilityResult, self).__init__(**kwargs) - self.available = kwargs.get('available', None) - - -class EffectiveNetworkSecurityGroup(msrest.serialization.Model): - """Effective network security group. - - :param network_security_group: The ID of network security group that is applied. - :type network_security_group: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param association: Associated resources. - :type association: - ~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroupAssociation - :param effective_security_rules: A collection of effective security rules. - :type effective_security_rules: - list[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityRule] - :param tag_map: Mapping of tags to list of IP Addresses included within the tag. - :type tag_map: str - """ - - _attribute_map = { - 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, - 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, - 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, - 'tag_map': {'key': 'tagMap', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) - self.network_security_group = kwargs.get('network_security_group', None) - self.association = kwargs.get('association', None) - self.effective_security_rules = kwargs.get('effective_security_rules', None) - self.tag_map = kwargs.get('tag_map', None) - - -class EffectiveNetworkSecurityGroupAssociation(msrest.serialization.Model): - """The effective network security group association. - - :param subnet: The ID of the subnet if assigned. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param network_interface: The ID of the network interface if assigned. - :type network_interface: ~azure.mgmt.network.v2017_08_01.models.SubResource - """ - - _attribute_map = { - 'subnet': {'key': 'subnet', 'type': 'SubResource'}, - 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, - } - - def __init__( - self, - **kwargs - ): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) - self.subnet = kwargs.get('subnet', None) - self.network_interface = kwargs.get('network_interface', None) - - -class EffectiveNetworkSecurityGroupListResult(msrest.serialization.Model): - """Response for list effective network security groups API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of effective network security groups. - :type value: list[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroup] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class EffectiveNetworkSecurityRule(msrest.serialization.Model): - """Effective network security rules. - - :param name: The name of the security rule specified by the user (if created by the user). - :type name: str - :param protocol: The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', - and 'All'. Possible values include: "Tcp", "Udp", "All". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.EffectiveSecurityRuleProtocol - :param source_port_range: The source port or range. - :type source_port_range: str - :param destination_port_range: The destination port or range. - :type destination_port_range: str - :param source_port_ranges: The source port ranges. Expected values include a single integer - between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - :type source_port_ranges: list[str] - :param destination_port_ranges: The destination port ranges. Expected values include a single - integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - :type destination_port_ranges: list[str] - :param source_address_prefix: The source address prefix. - :type source_address_prefix: str - :param destination_address_prefix: The destination address prefix. - :type destination_address_prefix: str - :param source_address_prefixes: The source address prefixes. Expected values include CIDR IP - ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the - asterisk (*). - :type source_address_prefixes: list[str] - :param destination_address_prefixes: The destination address prefixes. Expected values include - CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and - the asterisk (*). - :type destination_address_prefixes: list[str] - :param expanded_source_address_prefix: The expanded source address prefix. - :type expanded_source_address_prefix: list[str] - :param expanded_destination_address_prefix: Expanded destination address prefix. - :type expanded_destination_address_prefix: list[str] - :param access: Whether network traffic is allowed or denied. Possible values are: 'Allow' and - 'Deny'. Possible values include: "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAccess - :param priority: The priority of the rule. - :type priority: int - :param direction: The direction of the rule. Possible values are: 'Inbound and Outbound'. - Possible values include: "Inbound", "Outbound". - :type direction: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleDirection - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, - 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, - 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, - 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, - 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, - 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, - 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, - 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, - 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, - 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, - 'access': {'key': 'access', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'direction': {'key': 'direction', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.protocol = kwargs.get('protocol', None) - self.source_port_range = kwargs.get('source_port_range', None) - self.destination_port_range = kwargs.get('destination_port_range', None) - self.source_port_ranges = kwargs.get('source_port_ranges', None) - self.destination_port_ranges = kwargs.get('destination_port_ranges', None) - self.source_address_prefix = kwargs.get('source_address_prefix', None) - self.destination_address_prefix = kwargs.get('destination_address_prefix', None) - self.source_address_prefixes = kwargs.get('source_address_prefixes', None) - self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) - self.expanded_source_address_prefix = kwargs.get('expanded_source_address_prefix', None) - self.expanded_destination_address_prefix = kwargs.get('expanded_destination_address_prefix', None) - self.access = kwargs.get('access', None) - self.priority = kwargs.get('priority', None) - self.direction = kwargs.get('direction', None) - - -class EffectiveRoute(msrest.serialization.Model): - """Effective Route. - - :param name: The name of the user defined route. This is optional. - :type name: str - :param source: Who created the route. Possible values are: 'Unknown', 'User', - 'VirtualNetworkGateway', and 'Default'. Possible values include: "Unknown", "User", - "VirtualNetworkGateway", "Default". - :type source: str or ~azure.mgmt.network.v2017_08_01.models.EffectiveRouteSource - :param state: The value of effective route. Possible values are: 'Active' and 'Invalid'. - Possible values include: "Active", "Invalid". - :type state: str or ~azure.mgmt.network.v2017_08_01.models.EffectiveRouteState - :param address_prefix: The address prefixes of the effective routes in CIDR notation. - :type address_prefix: list[str] - :param next_hop_ip_address: The IP address of the next hop of the effective route. - :type next_hop_ip_address: list[str] - :param next_hop_type: The type of Azure hop the packet should be sent to. Possible values are: - 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible - values include: "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", "None". - :type next_hop_type: str or ~azure.mgmt.network.v2017_08_01.models.RouteNextHopType - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, - 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, - 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EffectiveRoute, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.source = kwargs.get('source', None) - self.state = kwargs.get('state', None) - self.address_prefix = kwargs.get('address_prefix', None) - self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) - self.next_hop_type = kwargs.get('next_hop_type', None) - - -class EffectiveRouteListResult(msrest.serialization.Model): - """Response for list effective route API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of effective routes. - :type value: list[~azure.mgmt.network.v2017_08_01.models.EffectiveRoute] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EffectiveRouteListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class EndpointServiceResult(SubResource): - """Endpoint service. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Name of the endpoint service. - :vartype name: str - :ivar type: Type of the endpoint service. - :vartype type: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointServiceResult, self).__init__(**kwargs) - self.name = None - self.type = None - - -class EndpointServicesListResult(msrest.serialization.Model): - """Response for the ListAvailableEndpointServices API service call. - - :param value: List of available endpoint services in a region. - :type value: list[~azure.mgmt.network.v2017_08_01.models.EndpointServiceResult] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EndpointServiceResult]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(EndpointServicesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class Error(msrest.serialization.Model): - """Error. - - :param code: - :type code: str - :param message: - :type message: str - :param target: - :type target: str - :param details: - :type details: list[~azure.mgmt.network.v2017_08_01.models.ErrorDetails] - :param inner_error: - :type inner_error: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetails]'}, - 'inner_error': {'key': 'innerError', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Error, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - self.inner_error = kwargs.get('inner_error', None) - - -class ErrorDetails(msrest.serialization.Model): - """ErrorDetails. - - :param code: - :type code: str - :param target: - :type target: str - :param message: - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetails, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.target = kwargs.get('target', None) - self.message = kwargs.get('message', None) - - -class ExpressRouteCircuit(Resource): - """ExpressRouteCircuit resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The SKU. - :type sku: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitSku - :ivar etag: Gets a unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param allow_classic_operations: Allow classic operations. - :type allow_classic_operations: bool - :param circuit_provisioning_state: The CircuitProvisioningState state of the resource. - :type circuit_provisioning_state: str - :param service_provider_provisioning_state: The ServiceProviderProvisioningState state of the - resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and - 'Deprovisioning'. Possible values include: "NotProvisioned", "Provisioning", "Provisioned", - "Deprovisioning". - :type service_provider_provisioning_state: str or - ~azure.mgmt.network.v2017_08_01.models.ServiceProviderProvisioningState - :param authorizations: The list of authorizations. - :type authorizations: - list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization] - :param peerings: The list of peerings. - :type peerings: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :param service_key: The ServiceKey. - :type service_key: str - :param service_provider_notes: The ServiceProviderNotes. - :type service_provider_notes: str - :param service_provider_properties: The ServiceProviderProperties. - :type service_provider_properties: - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitServiceProviderProperties - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - :param gateway_manager_etag: The GatewayManager Etag. - :type gateway_manager_etag: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, - 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, - 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, - 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, - 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, - 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, - 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, - 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuit, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.etag = None - self.allow_classic_operations = kwargs.get('allow_classic_operations', None) - self.circuit_provisioning_state = kwargs.get('circuit_provisioning_state', None) - self.service_provider_provisioning_state = kwargs.get('service_provider_provisioning_state', None) - self.authorizations = kwargs.get('authorizations', None) - self.peerings = kwargs.get('peerings', None) - self.service_key = kwargs.get('service_key', None) - self.service_provider_notes = kwargs.get('service_provider_notes', None) - self.service_provider_properties = kwargs.get('service_provider_properties', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) - - -class ExpressRouteCircuitArpTable(msrest.serialization.Model): - """The ARP table associated with the ExpressRouteCircuit. - - :param age: Age. - :type age: int - :param interface: Interface. - :type interface: str - :param ip_address: The IP address. - :type ip_address: str - :param mac_address: The MAC address. - :type mac_address: str - """ - - _attribute_map = { - 'age': {'key': 'age', 'type': 'int'}, - 'interface': {'key': 'interface', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) - self.age = kwargs.get('age', None) - self.interface = kwargs.get('interface', None) - self.ip_address = kwargs.get('ip_address', None) - self.mac_address = kwargs.get('mac_address', None) - - -class ExpressRouteCircuitAuthorization(SubResource): - """Authorization in an ExpressRouteCircuit resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param authorization_key: The authorization key. - :type authorization_key: str - :param authorization_use_status: AuthorizationUseStatus. Possible values are: 'Available' and - 'InUse'. Possible values include: "Available", "InUse". - :type authorization_use_status: str or - ~azure.mgmt.network.v2017_08_01.models.AuthorizationUseStatus - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, - 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitAuthorization, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = None - self.authorization_key = kwargs.get('authorization_key', None) - self.authorization_use_status = kwargs.get('authorization_use_status', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ExpressRouteCircuitListResult(msrest.serialization.Model): - """Response for ListExpressRouteCircuit API service call. - - :param value: A list of ExpressRouteCircuits in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuit]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ExpressRouteCircuitPeering(SubResource): - """Peering in an ExpressRouteCircuit resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param peering_type: The PeeringType. Possible values are: 'AzurePublicPeering', - 'AzurePrivatePeering', and 'MicrosoftPeering'. Possible values include: "AzurePublicPeering", - "AzurePrivatePeering", "MicrosoftPeering". - :type peering_type: str or - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringType - :param state: The state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible - values include: "Disabled", "Enabled". - :type state: str or ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringState - :param azure_asn: The Azure ASN. - :type azure_asn: int - :param peer_asn: The peer ASN. - :type peer_asn: int - :param primary_peer_address_prefix: The primary address prefix. - :type primary_peer_address_prefix: str - :param secondary_peer_address_prefix: The secondary address prefix. - :type secondary_peer_address_prefix: str - :param primary_azure_port: The primary port. - :type primary_azure_port: str - :param secondary_azure_port: The secondary port. - :type secondary_azure_port: str - :param shared_key: The shared key. - :type shared_key: str - :param vlan_id: The VLAN ID. - :type vlan_id: int - :param microsoft_peering_config: The Microsoft peering configuration. - :type microsoft_peering_config: - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringConfig - :param stats: Gets peering stats. - :type stats: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - :param gateway_manager_etag: The GatewayManager Etag. - :type gateway_manager_etag: str - :param last_modified_by: Gets whether the provider or the customer last modified the peering. - :type last_modified_by: str - :param route_filter: The reference of the RouteFilter resource. - :type route_filter: ~azure.mgmt.network.v2017_08_01.models.RouteFilter - :param ipv6_peering_config: The IPv6 peering configuration. - :type ipv6_peering_config: - ~azure.mgmt.network.v2017_08_01.models.Ipv6ExpressRouteCircuitPeeringConfig - """ - - _validation = { - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, - 'peer_asn': {'key': 'properties.peerASN', 'type': 'int'}, - 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, - 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, - 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, - 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, - 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, - 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, - 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, - 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, - 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, - 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, - 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitPeering, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = None - self.peering_type = kwargs.get('peering_type', None) - self.state = kwargs.get('state', None) - self.azure_asn = kwargs.get('azure_asn', None) - self.peer_asn = kwargs.get('peer_asn', None) - self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) - self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) - self.primary_azure_port = kwargs.get('primary_azure_port', None) - self.secondary_azure_port = kwargs.get('secondary_azure_port', None) - self.shared_key = kwargs.get('shared_key', None) - self.vlan_id = kwargs.get('vlan_id', None) - self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) - self.stats = kwargs.get('stats', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - self.gateway_manager_etag = kwargs.get('gateway_manager_etag', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.route_filter = kwargs.get('route_filter', None) - self.ipv6_peering_config = kwargs.get('ipv6_peering_config', None) - - -class ExpressRouteCircuitPeeringConfig(msrest.serialization.Model): - """Specifies the peering configuration. - - :param advertised_public_prefixes: The reference of AdvertisedPublicPrefixes. - :type advertised_public_prefixes: list[str] - :param advertised_communities: The communities of bgp peering. Specified for microsoft peering. - :type advertised_communities: list[str] - :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of the Peering resource. - Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - Possible values include: "NotConfigured", "Configuring", "Configured", "ValidationNeeded". - :type advertised_public_prefixes_state: str or - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState - :param legacy_mode: The legacy mode of the peering. - :type legacy_mode: int - :param customer_asn: The CustomerASN of the peering. - :type customer_asn: int - :param routing_registry_name: The RoutingRegistryName of the configuration. - :type routing_registry_name: str - """ - - _attribute_map = { - 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, - 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, - 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, - 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, - 'customer_asn': {'key': 'customerASN', 'type': 'int'}, - 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) - self.advertised_public_prefixes = kwargs.get('advertised_public_prefixes', None) - self.advertised_communities = kwargs.get('advertised_communities', None) - self.advertised_public_prefixes_state = kwargs.get('advertised_public_prefixes_state', None) - self.legacy_mode = kwargs.get('legacy_mode', None) - self.customer_asn = kwargs.get('customer_asn', None) - self.routing_registry_name = kwargs.get('routing_registry_name', None) - - -class ExpressRouteCircuitPeeringListResult(msrest.serialization.Model): - """Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. - - :param value: The peerings in an express route circuit. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitPeering]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitPeeringListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ExpressRouteCircuitRoutesTable(msrest.serialization.Model): - """The routes table associated with the ExpressRouteCircuit. - - :param network: network. - :type network: str - :param next_hop: nextHop. - :type next_hop: str - :param loc_prf: locPrf. - :type loc_prf: str - :param weight: weight. - :type weight: int - :param path: path. - :type path: str - """ - - _attribute_map = { - 'network': {'key': 'network', 'type': 'str'}, - 'next_hop': {'key': 'nextHop', 'type': 'str'}, - 'loc_prf': {'key': 'locPrf', 'type': 'str'}, - 'weight': {'key': 'weight', 'type': 'int'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) - self.network = kwargs.get('network', None) - self.next_hop = kwargs.get('next_hop', None) - self.loc_prf = kwargs.get('loc_prf', None) - self.weight = kwargs.get('weight', None) - self.path = kwargs.get('path', None) - - -class ExpressRouteCircuitRoutesTableSummary(msrest.serialization.Model): - """The routes table associated with the ExpressRouteCircuit. - - :param neighbor: Neighbor. - :type neighbor: str - :param v: BGP version number spoken to the neighbor. - :type v: int - :param as_property: Autonomous system number. - :type as_property: int - :param up_down: The length of time that the BGP session has been in the Established state, or - the current status if not in the Established state. - :type up_down: str - :param state_pfx_rcd: Current state of the BGP session, and the number of prefixes that have - been received from a neighbor or peer group. - :type state_pfx_rcd: str - """ - - _attribute_map = { - 'neighbor': {'key': 'neighbor', 'type': 'str'}, - 'v': {'key': 'v', 'type': 'int'}, - 'as_property': {'key': 'as', 'type': 'int'}, - 'up_down': {'key': 'upDown', 'type': 'str'}, - 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) - self.neighbor = kwargs.get('neighbor', None) - self.v = kwargs.get('v', None) - self.as_property = kwargs.get('as_property', None) - self.up_down = kwargs.get('up_down', None) - self.state_pfx_rcd = kwargs.get('state_pfx_rcd', None) - - -class ExpressRouteCircuitsArpTableListResult(msrest.serialization.Model): - """Response for ListArpTable associated with the Express Route Circuits API. - - :param value: Gets list of the ARP table. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitArpTable] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ExpressRouteCircuitServiceProviderProperties(msrest.serialization.Model): - """Contains ServiceProviderProperties in an ExpressRouteCircuit. - - :param service_provider_name: The serviceProviderName. - :type service_provider_name: str - :param peering_location: The peering location. - :type peering_location: str - :param bandwidth_in_mbps: The BandwidthInMbps. - :type bandwidth_in_mbps: int - """ - - _attribute_map = { - 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, - 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, - 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) - self.service_provider_name = kwargs.get('service_provider_name', None) - self.peering_location = kwargs.get('peering_location', None) - self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) - - -class ExpressRouteCircuitSku(msrest.serialization.Model): - """Contains SKU in an ExpressRouteCircuit. - - :param name: The name of the SKU. - :type name: str - :param tier: The tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values - include: "Standard", "Premium". - :type tier: str or ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitSkuTier - :param family: The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. - Possible values include: "UnlimitedData", "MeteredData". - :type family: str or ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitSkuFamily - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitSku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - self.family = kwargs.get('family', None) - - -class ExpressRouteCircuitsRoutesTableListResult(msrest.serialization.Model): - """Response for ListRoutesTable associated with the Express Route Circuits API. - - :param value: The list of routes table. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitRoutesTable] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ExpressRouteCircuitsRoutesTableSummaryListResult(msrest.serialization.Model): - """Response for ListRoutesTable associated with the Express Route Circuits API. - - :param value: A list of the routes table. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitRoutesTableSummary] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ExpressRouteCircuitStats(msrest.serialization.Model): - """Contains stats associated with the peering. - - :param primarybytes_in: Gets BytesIn of the peering. - :type primarybytes_in: long - :param primarybytes_out: Gets BytesOut of the peering. - :type primarybytes_out: long - :param secondarybytes_in: Gets BytesIn of the peering. - :type secondarybytes_in: long - :param secondarybytes_out: Gets BytesOut of the peering. - :type secondarybytes_out: long - """ - - _attribute_map = { - 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, - 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, - 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, - 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteCircuitStats, self).__init__(**kwargs) - self.primarybytes_in = kwargs.get('primarybytes_in', None) - self.primarybytes_out = kwargs.get('primarybytes_out', None) - self.secondarybytes_in = kwargs.get('secondarybytes_in', None) - self.secondarybytes_out = kwargs.get('secondarybytes_out', None) - - -class ExpressRouteServiceProvider(Resource): - """A ExpressRouteResourceProvider object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param peering_locations: Get a list of peering locations. - :type peering_locations: list[str] - :param bandwidths_offered: Gets bandwidths offered. - :type bandwidths_offered: - list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteServiceProviderBandwidthsOffered] - :param provisioning_state: Gets the provisioning state of the resource. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, - 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteServiceProvider, self).__init__(**kwargs) - self.peering_locations = kwargs.get('peering_locations', None) - self.bandwidths_offered = kwargs.get('bandwidths_offered', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class ExpressRouteServiceProviderBandwidthsOffered(msrest.serialization.Model): - """Contains bandwidths offered in ExpressRouteServiceProvider resources. - - :param offer_name: The OfferName. - :type offer_name: str - :param value_in_mbps: The ValueInMbps. - :type value_in_mbps: int - """ - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) - self.offer_name = kwargs.get('offer_name', None) - self.value_in_mbps = kwargs.get('value_in_mbps', None) - - -class ExpressRouteServiceProviderListResult(msrest.serialization.Model): - """Response for the ListExpressRouteServiceProvider API service call. - - :param value: A list of ExpressRouteResourceProvider resources. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteServiceProvider] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteServiceProvider]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ExpressRouteServiceProviderListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class FlowLogInformation(msrest.serialization.Model): - """Information on the configuration of flow log. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The ID of the resource to configure for flow logging. - :type target_resource_id: str - :param storage_id: Required. ID of the storage account which is used to store the flow log. - :type storage_id: str - :param enabled: Required. Flag to enable/disable flow logging. - :type enabled: bool - :param retention_policy: Parameters that define the retention policy for flow log. - :type retention_policy: ~azure.mgmt.network.v2017_08_01.models.RetentionPolicyParameters - """ - - _validation = { - 'target_resource_id': {'required': True}, - 'storage_id': {'required': True}, - 'enabled': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, - } - - def __init__( - self, - **kwargs - ): - super(FlowLogInformation, self).__init__(**kwargs) - self.target_resource_id = kwargs['target_resource_id'] - self.storage_id = kwargs['storage_id'] - self.enabled = kwargs['enabled'] - self.retention_policy = kwargs.get('retention_policy', None) - - -class FlowLogStatusParameters(msrest.serialization.Model): - """Parameters that define a resource to query flow log status. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The target resource where getting the flow logging status. - :type target_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FlowLogStatusParameters, self).__init__(**kwargs) - self.target_resource_id = kwargs['target_resource_id'] - - -class FrontendIPConfiguration(SubResource): - """Frontend IP address of the load balancer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param zones: A list of availability zones denoting the IP allocated for the resource needs to - come from. - :type zones: list[str] - :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this frontend IP. - :vartype inbound_nat_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this frontend IP. - :vartype inbound_nat_pools: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this frontend IP. - :vartype outbound_nat_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :ivar load_balancing_rules: Gets load balancing rules URIs that use this frontend IP. - :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param private_ip_address: The private IP address of the IP configuration. - :type private_ip_address: str - :param private_ip_allocation_method: The Private IP allocation method. Possible values are: - 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param subnet: The reference of the subnet resource. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.Subnet - :param public_ip_address: The reference of the Public IP resource. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'inbound_nat_rules': {'readonly': True}, - 'inbound_nat_pools': {'readonly': True}, - 'outbound_nat_rules': {'readonly': True}, - 'load_balancing_rules': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'zones': {'key': 'zones', 'type': '[str]'}, - 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, - 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, - 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, - 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FrontendIPConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.zones = kwargs.get('zones', None) - self.inbound_nat_rules = None - self.inbound_nat_pools = None - self.outbound_nat_rules = None - self.load_balancing_rules = None - self.private_ip_address = kwargs.get('private_ip_address', None) - self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) - self.subnet = kwargs.get('subnet', None) - self.public_ip_address = kwargs.get('public_ip_address', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class GatewayRoute(msrest.serialization.Model): - """Gateway routing details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar local_address: The gateway's local address. - :vartype local_address: str - :ivar network: The route's network prefix. - :vartype network: str - :ivar next_hop: The route's next hop. - :vartype next_hop: str - :ivar source_peer: The peer this route was learned from. - :vartype source_peer: str - :ivar origin: The source this route was learned from. - :vartype origin: str - :ivar as_path: The route's AS path sequence. - :vartype as_path: str - :ivar weight: The route's weight. - :vartype weight: int - """ - - _validation = { - 'local_address': {'readonly': True}, - 'network': {'readonly': True}, - 'next_hop': {'readonly': True}, - 'source_peer': {'readonly': True}, - 'origin': {'readonly': True}, - 'as_path': {'readonly': True}, - 'weight': {'readonly': True}, - } - - _attribute_map = { - 'local_address': {'key': 'localAddress', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'next_hop': {'key': 'nextHop', 'type': 'str'}, - 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'as_path': {'key': 'asPath', 'type': 'str'}, - 'weight': {'key': 'weight', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(GatewayRoute, self).__init__(**kwargs) - self.local_address = None - self.network = None - self.next_hop = None - self.source_peer = None - self.origin = None - self.as_path = None - self.weight = None - - -class GatewayRouteListResult(msrest.serialization.Model): - """List of virtual network gateway routes. - - :param value: List of gateway routes. - :type value: list[~azure.mgmt.network.v2017_08_01.models.GatewayRoute] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[GatewayRoute]'}, - } - - def __init__( - self, - **kwargs - ): - super(GatewayRouteListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class InboundNatPool(SubResource): - """Inbound NAT pool of the load balancer. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param frontend_ip_configuration: A reference to frontend IP addresses. - :type frontend_ip_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param protocol: The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. - Possible values include: "Udp", "Tcp". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.TransportProtocol - :param frontend_port_range_start: 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. - :type frontend_port_range_start: int - :param frontend_port_range_end: 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. - :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the endpoint. Acceptable values - are between 1 and 65535. - :type backend_port: int - :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, - 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, - 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InboundNatPool, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) - self.protocol = kwargs.get('protocol', None) - self.frontend_port_range_start = kwargs.get('frontend_port_range_start', None) - self.frontend_port_range_end = kwargs.get('frontend_port_range_end', None) - self.backend_port = kwargs.get('backend_port', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class InboundNatRule(SubResource): - """Inbound NAT rule of the load balancer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param frontend_ip_configuration: A reference to frontend IP addresses. - :type frontend_ip_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :ivar backend_ip_configuration: 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 backend IP. - :vartype backend_ip_configuration: - ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration - :param protocol: The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. - Possible values include: "Udp", "Tcp". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.TransportProtocol - :param frontend_port: 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. - :type frontend_port: int - :param backend_port: The port used for the internal endpoint. Acceptable values range from 1 to - 65535. - :type backend_port: int - :param idle_timeout_in_minutes: 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. - :type idle_timeout_in_minutes: int - :param enable_floating_ip: 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. - :type enable_floating_ip: bool - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'backend_ip_configuration': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, - 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, - 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, - 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InboundNatRule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) - self.backend_ip_configuration = None - self.protocol = kwargs.get('protocol', None) - self.frontend_port = kwargs.get('frontend_port', None) - self.backend_port = kwargs.get('backend_port', None) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) - self.enable_floating_ip = kwargs.get('enable_floating_ip', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class InboundNatRuleListResult(msrest.serialization.Model): - """Response for ListInboundNatRule API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of inbound nat rules in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[InboundNatRule]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InboundNatRuleListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class IPAddressAvailabilityResult(msrest.serialization.Model): - """Response for CheckIPAddressAvailability API service call. - - :param available: Private IP address availability. - :type available: bool - :param available_ip_addresses: Contains other available private IP addresses if the asked for - address is taken. - :type available_ip_addresses: list[str] - """ - - _attribute_map = { - 'available': {'key': 'available', 'type': 'bool'}, - 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(IPAddressAvailabilityResult, self).__init__(**kwargs) - self.available = kwargs.get('available', None) - self.available_ip_addresses = kwargs.get('available_ip_addresses', None) - - -class IPConfiguration(SubResource): - """IP configuration. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param private_ip_address: The private IP address of the IP configuration. - :type private_ip_address: str - :param private_ip_allocation_method: The private IP allocation method. Possible values are - 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param subnet: The reference of the subnet resource. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.Subnet - :param public_ip_address: The reference of the public IP resource. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IPConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.private_ip_address = kwargs.get('private_ip_address', None) - self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) - self.subnet = kwargs.get('subnet', None) - self.public_ip_address = kwargs.get('public_ip_address', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class IpsecPolicy(msrest.serialization.Model): - """An IPSec Policy configuration for a virtual network gateway connection. - - All required parameters must be populated in order to send to Azure. - - :param sa_life_time_seconds: Required. The IPSec Security Association (also called Quick Mode - or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. - :type sa_life_time_seconds: int - :param sa_data_size_kilobytes: Required. The IPSec Security Association (also called Quick Mode - or Phase 2 SA) payload size in KB for a site to site VPN tunnel. - :type sa_data_size_kilobytes: int - :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE phase 1). Possible - values include: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", - "GCMAES256". - :type ipsec_encryption: str or ~azure.mgmt.network.v2017_08_01.models.IpsecEncryption - :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase 1). Possible values - include: "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", "GCMAES256". - :type ipsec_integrity: str or ~azure.mgmt.network.v2017_08_01.models.IpsecIntegrity - :param ike_encryption: Required. The IKE encryption algorithm (IKE phase 2). Possible values - include: "DES", "DES3", "AES128", "AES192", "AES256". - :type ike_encryption: str or ~azure.mgmt.network.v2017_08_01.models.IkeEncryption - :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). Possible values - include: "MD5", "SHA1", "SHA256", "SHA384". - :type ike_integrity: str or ~azure.mgmt.network.v2017_08_01.models.IkeIntegrity - :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial SA. Possible values - include: "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", - "DHGroup24". - :type dh_group: str or ~azure.mgmt.network.v2017_08_01.models.DhGroup - :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new child SA. Possible values - include: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24". - :type pfs_group: str or ~azure.mgmt.network.v2017_08_01.models.PfsGroup - """ - - _validation = { - 'sa_life_time_seconds': {'required': True}, - 'sa_data_size_kilobytes': {'required': True}, - 'ipsec_encryption': {'required': True}, - 'ipsec_integrity': {'required': True}, - 'ike_encryption': {'required': True}, - 'ike_integrity': {'required': True}, - 'dh_group': {'required': True}, - 'pfs_group': {'required': True}, - } - - _attribute_map = { - 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, - 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, - 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, - 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, - 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, - 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, - 'dh_group': {'key': 'dhGroup', 'type': 'str'}, - 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(IpsecPolicy, self).__init__(**kwargs) - self.sa_life_time_seconds = kwargs['sa_life_time_seconds'] - self.sa_data_size_kilobytes = kwargs['sa_data_size_kilobytes'] - self.ipsec_encryption = kwargs['ipsec_encryption'] - self.ipsec_integrity = kwargs['ipsec_integrity'] - self.ike_encryption = kwargs['ike_encryption'] - self.ike_integrity = kwargs['ike_integrity'] - self.dh_group = kwargs['dh_group'] - self.pfs_group = kwargs['pfs_group'] - - -class Ipv6ExpressRouteCircuitPeeringConfig(msrest.serialization.Model): - """Contains IPv6 peering config. - - :param primary_peer_address_prefix: The primary address prefix. - :type primary_peer_address_prefix: str - :param secondary_peer_address_prefix: The secondary address prefix. - :type secondary_peer_address_prefix: str - :param microsoft_peering_config: The Microsoft peering configuration. - :type microsoft_peering_config: - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringConfig - :param route_filter: The reference of the RouteFilter resource. - :type route_filter: ~azure.mgmt.network.v2017_08_01.models.RouteFilter - :param state: The state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible - values include: "Disabled", "Enabled". - :type state: str or ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringState - """ - - _attribute_map = { - 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, - 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, - 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, - 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, - 'state': {'key': 'state', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) - self.primary_peer_address_prefix = kwargs.get('primary_peer_address_prefix', None) - self.secondary_peer_address_prefix = kwargs.get('secondary_peer_address_prefix', None) - self.microsoft_peering_config = kwargs.get('microsoft_peering_config', None) - self.route_filter = kwargs.get('route_filter', None) - self.state = kwargs.get('state', None) - - -class LoadBalancer(Resource): - """LoadBalancer resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The load balancer SKU. - :type sku: ~azure.mgmt.network.v2017_08_01.models.LoadBalancerSku - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param frontend_ip_configurations: Object representing the frontend IPs to be used for the load - balancer. - :type frontend_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.FrontendIPConfiguration] - :param backend_address_pools: Collection of backend address pools used by a load balancer. - :type backend_address_pools: list[~azure.mgmt.network.v2017_08_01.models.BackendAddressPool] - :param load_balancing_rules: Object collection representing the load balancing rules Gets the - provisioning. - :type load_balancing_rules: list[~azure.mgmt.network.v2017_08_01.models.LoadBalancingRule] - :param probes: Collection of probe objects used in the load balancer. - :type probes: list[~azure.mgmt.network.v2017_08_01.models.Probe] - :param inbound_nat_rules: 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. - :type inbound_nat_rules: list[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] - :param inbound_nat_pools: 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. - :type inbound_nat_pools: list[~azure.mgmt.network.v2017_08_01.models.InboundNatPool] - :param outbound_nat_rules: The outbound NAT rules. - :type outbound_nat_rules: list[~azure.mgmt.network.v2017_08_01.models.OutboundNatRule] - :param resource_guid: The resource GUID property of the load balancer resource. - :type resource_guid: str - :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, - 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, - 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, - 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, - 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, - 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LoadBalancer, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.etag = kwargs.get('etag', None) - self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) - self.backend_address_pools = kwargs.get('backend_address_pools', None) - self.load_balancing_rules = kwargs.get('load_balancing_rules', None) - self.probes = kwargs.get('probes', None) - self.inbound_nat_rules = kwargs.get('inbound_nat_rules', None) - self.inbound_nat_pools = kwargs.get('inbound_nat_pools', None) - self.outbound_nat_rules = kwargs.get('outbound_nat_rules', None) - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class LoadBalancerBackendAddressPoolListResult(msrest.serialization.Model): - """Response for ListBackendAddressPool API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of backend address pools in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.BackendAddressPool] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[BackendAddressPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LoadBalancerBackendAddressPoolListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class LoadBalancerFrontendIPConfigurationListResult(msrest.serialization.Model): - """Response for ListFrontendIPConfiguration API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of frontend IP configurations in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.FrontendIPConfiguration] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FrontendIPConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LoadBalancerFrontendIPConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class LoadBalancerListResult(msrest.serialization.Model): - """Response for ListLoadBalancers API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of load balancers in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.LoadBalancer] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LoadBalancer]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LoadBalancerListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class LoadBalancerLoadBalancingRuleListResult(msrest.serialization.Model): - """Response for ListLoadBalancingRule API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of load balancing rules in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.LoadBalancingRule] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LoadBalancingRule]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LoadBalancerLoadBalancingRuleListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class LoadBalancerProbeListResult(msrest.serialization.Model): - """Response for ListProbe API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of probes in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.Probe] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Probe]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LoadBalancerProbeListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class LoadBalancerSku(msrest.serialization.Model): - """SKU of a load balancer. - - :param name: Name of a load balancer SKU. Possible values include: "Basic", "Standard". - :type name: str or ~azure.mgmt.network.v2017_08_01.models.LoadBalancerSkuName - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LoadBalancerSku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class LoadBalancingRule(SubResource): - """A load balancing rule for a load balancer. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param frontend_ip_configuration: A reference to frontend IP addresses. - :type frontend_ip_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param backend_address_pool: A reference to a pool of DIPs. Inbound traffic is randomly load - balanced across IPs in the backend IPs. - :type backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param probe: The reference of the load balancer probe used by the load balancing rule. - :type probe: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param protocol: The transport protocol for the external endpoint. Possible values are 'Udp' or - 'Tcp'. Possible values include: "Udp", "Tcp". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.TransportProtocol - :param load_distribution: The load distribution policy for this rule. Possible values are - 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: "Default", "SourceIP", - "SourceIPProtocol". - :type load_distribution: str or ~azure.mgmt.network.v2017_08_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for each rule must be - unique within the Load Balancer. Acceptable values are between 1 and 65534. - :type frontend_port: int - :param backend_port: The port used for internal connections on the endpoint. Acceptable values - are between 1 and 65535. - :type backend_port: int - :param idle_timeout_in_minutes: 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. - :type idle_timeout_in_minutes: int - :param enable_floating_ip: 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. - :type enable_floating_ip: bool - :param disable_outbound_snat: Configures SNAT for the VMs in the backend pool to use the - publicIP address specified in the frontend of the load balancing rule. - :type disable_outbound_snat: bool - :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, - 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, - 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, - 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, - 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, - 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, - 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LoadBalancingRule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.frontend_ip_configuration = kwargs.get('frontend_ip_configuration', None) - self.backend_address_pool = kwargs.get('backend_address_pool', None) - self.probe = kwargs.get('probe', None) - self.protocol = kwargs.get('protocol', None) - self.load_distribution = kwargs.get('load_distribution', None) - self.frontend_port = kwargs.get('frontend_port', None) - self.backend_port = kwargs.get('backend_port', None) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) - self.enable_floating_ip = kwargs.get('enable_floating_ip', None) - self.disable_outbound_snat = kwargs.get('disable_outbound_snat', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class LocalNetworkGateway(Resource): - """A common class for general resource information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param local_network_address_space: Local network site address space. - :type local_network_address_space: ~azure.mgmt.network.v2017_08_01.models.AddressSpace - :param gateway_ip_address: IP address of local network gateway. - :type gateway_ip_address: str - :param bgp_settings: Local network gateway's BGP speaker settings. - :type bgp_settings: ~azure.mgmt.network.v2017_08_01.models.BgpSettings - :param resource_guid: The resource GUID property of the LocalNetworkGateway resource. - :type resource_guid: str - :ivar provisioning_state: The provisioning state of the LocalNetworkGateway resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, - 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, - 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LocalNetworkGateway, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.local_network_address_space = kwargs.get('local_network_address_space', None) - self.gateway_ip_address = kwargs.get('gateway_ip_address', None) - self.bgp_settings = kwargs.get('bgp_settings', None) - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = None - - -class LocalNetworkGatewayListResult(msrest.serialization.Model): - """Response for ListLocalNetworkGateways API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of local network gateways that exists in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LocalNetworkGateway]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LocalNetworkGatewayListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class NetworkInterface(Resource): - """A network interface in a resource group. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param virtual_machine: The reference of a virtual machine. - :type virtual_machine: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param network_security_group: The reference of the NetworkSecurityGroup resource. - :type network_security_group: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup - :param ip_configurations: A list of IPConfigurations of the network interface. - :type ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] - :param dns_settings: The DNS settings in network interface. - :type dns_settings: ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceDnsSettings - :param mac_address: The MAC address of the network interface. - :type mac_address: str - :param primary: Gets whether this is a primary network interface on a virtual machine. - :type primary: bool - :param enable_accelerated_networking: If the network interface is accelerated networking - enabled. - :type enable_accelerated_networking: bool - :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on this network - interface. - :type enable_ip_forwarding: bool - :param resource_guid: The resource GUID property of the network interface resource. - :type resource_guid: str - :param provisioning_state: The provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, - 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, - 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, - 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, - 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, - 'primary': {'key': 'properties.primary', 'type': 'bool'}, - 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, - 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkInterface, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.virtual_machine = kwargs.get('virtual_machine', None) - self.network_security_group = kwargs.get('network_security_group', None) - self.ip_configurations = kwargs.get('ip_configurations', None) - self.dns_settings = kwargs.get('dns_settings', None) - self.mac_address = kwargs.get('mac_address', None) - self.primary = kwargs.get('primary', None) - self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) - self.enable_ip_forwarding = kwargs.get('enable_ip_forwarding', None) - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class NetworkInterfaceAssociation(msrest.serialization.Model): - """Network interface and its custom security rules. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Network interface ID. - :vartype id: str - :param security_rules: Collection of custom security rules. - :type security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkInterfaceAssociation, self).__init__(**kwargs) - self.id = None - self.security_rules = kwargs.get('security_rules', None) - - -class NetworkInterfaceDnsSettings(msrest.serialization.Model): - """DNS settings of a network interface. - - :param dns_servers: 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. - :type dns_servers: list[str] - :param applied_dns_servers: 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. - :type applied_dns_servers: list[str] - :param internal_dns_name_label: Relative DNS name for this NIC used for internal communications - between VMs in the same virtual network. - :type internal_dns_name_label: str - :param internal_fqdn: Fully qualified DNS name supporting internal communications between VMs - in the same virtual network. - :type internal_fqdn: str - :param internal_domain_name_suffix: Even if internalDnsNameLabel is not specified, a DNS entry - is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the - VM name with the value of internalDomainNameSuffix. - :type internal_domain_name_suffix: str - """ - - _attribute_map = { - 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, - 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, - 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, - 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, - 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) - self.dns_servers = kwargs.get('dns_servers', None) - self.applied_dns_servers = kwargs.get('applied_dns_servers', None) - self.internal_dns_name_label = kwargs.get('internal_dns_name_label', None) - self.internal_fqdn = kwargs.get('internal_fqdn', None) - self.internal_domain_name_suffix = kwargs.get('internal_domain_name_suffix', None) - - -class NetworkInterfaceIPConfiguration(SubResource): - """IPConfiguration in a network interface. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param application_gateway_backend_address_pools: The reference of - ApplicationGatewayBackendAddressPool resource. - :type application_gateway_backend_address_pools: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddressPool] - :param load_balancer_backend_address_pools: The reference of LoadBalancerBackendAddressPool - resource. - :type load_balancer_backend_address_pools: - list[~azure.mgmt.network.v2017_08_01.models.BackendAddressPool] - :param load_balancer_inbound_nat_rules: A list of references of LoadBalancerInboundNatRules. - :type load_balancer_inbound_nat_rules: - list[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] - :param private_ip_address: Private IP address of the IP configuration. - :type private_ip_address: str - :param private_ip_allocation_method: Defines how a private IP address is assigned. Possible - values are: 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param private_ip_address_version: 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'. Possible values include: "IPv4", "IPv6". - :type private_ip_address_version: str or ~azure.mgmt.network.v2017_08_01.models.IPVersion - :param subnet: Subnet bound to the IP configuration. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.Subnet - :param primary: Gets whether this is a primary customer address on the network interface. - :type primary: bool - :param public_ip_address: Public IP address bound to the IP configuration. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :param provisioning_state: The provisioning state of the network interface IP configuration. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, - 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, - 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, - 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, - 'primary': {'key': 'properties.primary', 'type': 'bool'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkInterfaceIPConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.application_gateway_backend_address_pools = kwargs.get('application_gateway_backend_address_pools', None) - self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) - self.load_balancer_inbound_nat_rules = kwargs.get('load_balancer_inbound_nat_rules', None) - self.private_ip_address = kwargs.get('private_ip_address', None) - self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) - self.private_ip_address_version = kwargs.get('private_ip_address_version', None) - self.subnet = kwargs.get('subnet', None) - self.primary = kwargs.get('primary', None) - self.public_ip_address = kwargs.get('public_ip_address', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class NetworkInterfaceIPConfigurationListResult(msrest.serialization.Model): - """Response for list ip configurations API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of ip configurations. - :type value: list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkInterfaceIPConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkInterfaceIPConfigurationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class NetworkInterfaceListResult(msrest.serialization.Model): - """Response for the ListNetworkInterface API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of network interfaces in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.NetworkInterface] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkInterface]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkInterfaceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class NetworkInterfaceLoadBalancerListResult(msrest.serialization.Model): - """Response for list ip configurations API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of load balancers. - :type value: list[~azure.mgmt.network.v2017_08_01.models.LoadBalancer] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LoadBalancer]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkInterfaceLoadBalancerListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class NetworkSecurityGroup(Resource): - """NetworkSecurityGroup resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param security_rules: A collection of security rules of the network security group. - :type security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :param default_security_rules: The default security rules of network security group. - :type default_security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :ivar network_interfaces: A collection of references to network interfaces. - :vartype network_interfaces: list[~azure.mgmt.network.v2017_08_01.models.NetworkInterface] - :ivar subnets: A collection of references to subnets. - :vartype subnets: list[~azure.mgmt.network.v2017_08_01.models.Subnet] - :param resource_guid: The resource GUID property of the network security group resource. - :type resource_guid: str - :param provisioning_state: The provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'network_interfaces': {'readonly': True}, - 'subnets': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, - 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, - 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, - 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkSecurityGroup, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.security_rules = kwargs.get('security_rules', None) - self.default_security_rules = kwargs.get('default_security_rules', None) - self.network_interfaces = None - self.subnets = None - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class NetworkSecurityGroupListResult(msrest.serialization.Model): - """Response for ListNetworkSecurityGroups API service call. - - :param value: A list of NetworkSecurityGroup resources. - :type value: list[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkSecurityGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkSecurityGroupListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class NetworkWatcher(Resource): - """Network watcher in a resource group. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :ivar provisioning_state: The provisioning state of the resource. Possible values include: - "Succeeded", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or ~azure.mgmt.network.v2017_08_01.models.ProvisioningState - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkWatcher, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.provisioning_state = None - - -class NetworkWatcherListResult(msrest.serialization.Model): - """List of network watcher resources. - - :param value: - :type value: list[~azure.mgmt.network.v2017_08_01.models.NetworkWatcher] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkWatcher]'}, - } - - def __init__( - self, - **kwargs - ): - super(NetworkWatcherListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class NextHopParameters(msrest.serialization.Model): - """Parameters that define the source and destination endpoint. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The resource identifier of the target resource against - which the action is to be performed. - :type target_resource_id: str - :param source_ip_address: Required. The source IP address. - :type source_ip_address: str - :param destination_ip_address: Required. The destination IP address. - :type destination_ip_address: str - :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is - enabled on any of the nics, then this parameter must be specified. Otherwise optional). - :type target_nic_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - 'source_ip_address': {'required': True}, - 'destination_ip_address': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, - 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, - 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NextHopParameters, self).__init__(**kwargs) - self.target_resource_id = kwargs['target_resource_id'] - self.source_ip_address = kwargs['source_ip_address'] - self.destination_ip_address = kwargs['destination_ip_address'] - self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) - - -class NextHopResult(msrest.serialization.Model): - """The information about next hop from the specified VM. - - :param next_hop_type: Next hop type. Possible values include: "Internet", "VirtualAppliance", - "VirtualNetworkGateway", "VnetLocal", "HyperNetGateway", "None". - :type next_hop_type: str or ~azure.mgmt.network.v2017_08_01.models.NextHopType - :param next_hop_ip_address: Next hop IP Address. - :type next_hop_ip_address: str - :param route_table_id: The resource identifier for the route table associated with the route - being returned. If the route being returned does not correspond to any user created routes then - this field will be the string 'System Route'. - :type route_table_id: str - """ - - _attribute_map = { - 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, - 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, - 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(NextHopResult, self).__init__(**kwargs) - self.next_hop_type = kwargs.get('next_hop_type', None) - self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) - self.route_table_id = kwargs.get('route_table_id', None) - - -class OutboundNatRule(SubResource): - """Outbound NAT pool of the load balancer. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param allocated_outbound_ports: The number of outbound ports to be used for NAT. - :type allocated_outbound_ports: int - :param frontend_ip_configurations: The Frontend IP addresses of the load balancer. - :type frontend_ip_configurations: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound traffic is randomly load - balanced across IPs in the backend IPs. - :type backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, - 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, - 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OutboundNatRule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.allocated_outbound_ports = kwargs.get('allocated_outbound_ports', None) - self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) - self.backend_address_pool = kwargs.get('backend_address_pool', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PacketCapture(msrest.serialization.Model): - """Parameters that define the create packet capture operation. - - All required parameters must be populated in order to send to Azure. - - :param target: Required. The ID of the targeted resource, only VM is currently supported. - :type target: str - :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes - are truncated. - :type bytes_to_capture_per_packet: int - :param total_bytes_per_session: Maximum size of the capture output. - :type total_bytes_per_session: int - :param time_limit_in_seconds: Maximum duration of the capture session in seconds. - :type time_limit_in_seconds: int - :param storage_location: Required. Describes the storage location for a packet capture session. - :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation - :param filters: - :type filters: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] - """ - - _validation = { - 'target': {'required': True}, - 'storage_location': {'required': True}, - } - - _attribute_map = { - 'target': {'key': 'properties.target', 'type': 'str'}, - 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, - 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, - 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, - 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, - 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, - } - - def __init__( - self, - **kwargs - ): - super(PacketCapture, self).__init__(**kwargs) - self.target = kwargs['target'] - self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) - self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) - self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) - self.storage_location = kwargs['storage_location'] - self.filters = kwargs.get('filters', None) - - -class PacketCaptureFilter(msrest.serialization.Model): - """Filter that is applied to packet capture request. Multiple filters can be applied. - - :param protocol: Protocol to be filtered on. Possible values include: "TCP", "UDP", "Any". - Default value: "Any". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.PcProtocol - :param local_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single - address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. - Multiple ranges not currently supported. Mixing ranges with multiple entries not currently - supported. Default = null. - :type local_ip_address: str - :param remote_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single - address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. - Multiple ranges not currently supported. Mixing ranges with multiple entries not currently - supported. Default = null. - :type remote_ip_address: str - :param local_port: Local port to be filtered on. Notation: "80" for single port entry."80-85" - for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing - ranges with multiple entries not currently supported. Default = null. - :type local_port: str - :param remote_port: Remote port to be filtered on. Notation: "80" for single port entry."80-85" - for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing - ranges with multiple entries not currently supported. Default = null. - :type remote_port: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, - 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, - 'local_port': {'key': 'localPort', 'type': 'str'}, - 'remote_port': {'key': 'remotePort', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PacketCaptureFilter, self).__init__(**kwargs) - self.protocol = kwargs.get('protocol', "Any") - self.local_ip_address = kwargs.get('local_ip_address', None) - self.remote_ip_address = kwargs.get('remote_ip_address', None) - self.local_port = kwargs.get('local_port', None) - self.remote_port = kwargs.get('remote_port', None) - - -class PacketCaptureListResult(msrest.serialization.Model): - """List of packet capture sessions. - - :param value: Information about packet capture sessions. - :type value: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PacketCaptureResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(PacketCaptureListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PacketCaptureParameters(msrest.serialization.Model): - """Parameters that define the create packet capture operation. - - All required parameters must be populated in order to send to Azure. - - :param target: Required. The ID of the targeted resource, only VM is currently supported. - :type target: str - :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes - are truncated. - :type bytes_to_capture_per_packet: int - :param total_bytes_per_session: Maximum size of the capture output. - :type total_bytes_per_session: int - :param time_limit_in_seconds: Maximum duration of the capture session in seconds. - :type time_limit_in_seconds: int - :param storage_location: Required. Describes the storage location for a packet capture session. - :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation - :param filters: - :type filters: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] - """ - - _validation = { - 'target': {'required': True}, - 'storage_location': {'required': True}, - } - - _attribute_map = { - 'target': {'key': 'target', 'type': 'str'}, - 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, - 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, - 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, - 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, - 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, - } - - def __init__( - self, - **kwargs - ): - super(PacketCaptureParameters, self).__init__(**kwargs) - self.target = kwargs['target'] - self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) - self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) - self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) - self.storage_location = kwargs['storage_location'] - self.filters = kwargs.get('filters', None) - - -class PacketCaptureQueryStatusResult(msrest.serialization.Model): - """Status of packet capture session. - - :param name: The name of the packet capture resource. - :type name: str - :param id: The ID of the packet capture resource. - :type id: str - :param capture_start_time: The start time of the packet capture session. - :type capture_start_time: ~datetime.datetime - :param packet_capture_status: The status of the packet capture session. Possible values - include: "NotStarted", "Running", "Stopped", "Error", "Unknown". - :type packet_capture_status: str or ~azure.mgmt.network.v2017_08_01.models.PcStatus - :param stop_reason: The reason the current packet capture session was stopped. - :type stop_reason: str - :param packet_capture_error: List of errors of packet capture session. - :type packet_capture_error: list[str or ~azure.mgmt.network.v2017_08_01.models.PcError] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, - 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, - 'stop_reason': {'key': 'stopReason', 'type': 'str'}, - 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.id = kwargs.get('id', None) - self.capture_start_time = kwargs.get('capture_start_time', None) - self.packet_capture_status = kwargs.get('packet_capture_status', None) - self.stop_reason = kwargs.get('stop_reason', None) - self.packet_capture_error = kwargs.get('packet_capture_error', None) - - -class PacketCaptureResult(msrest.serialization.Model): - """Information about packet capture session. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the packet capture session. - :vartype name: str - :ivar id: ID of the packet capture operation. - :vartype id: str - :param etag: - :type etag: str - :param target: The ID of the targeted resource, only VM is currently supported. - :type target: str - :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes - are truncated. - :type bytes_to_capture_per_packet: int - :param total_bytes_per_session: Maximum size of the capture output. - :type total_bytes_per_session: int - :param time_limit_in_seconds: Maximum duration of the capture session in seconds. - :type time_limit_in_seconds: int - :param storage_location: Describes the storage location for a packet capture session. - :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation - :param filters: - :type filters: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] - :param provisioning_state: The provisioning state of the packet capture session. Possible - values include: "Succeeded", "Updating", "Deleting", "Failed". - :type provisioning_state: str or ~azure.mgmt.network.v2017_08_01.models.ProvisioningState - """ - - _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'target': {'key': 'properties.target', 'type': 'str'}, - 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, - 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, - 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, - 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, - 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PacketCaptureResult, self).__init__(**kwargs) - self.name = None - self.id = None - self.etag = kwargs.get('etag', "A unique read-only string that changes whenever the resource is updated.") - self.target = kwargs.get('target', None) - self.bytes_to_capture_per_packet = kwargs.get('bytes_to_capture_per_packet', 0) - self.total_bytes_per_session = kwargs.get('total_bytes_per_session', 1073741824) - self.time_limit_in_seconds = kwargs.get('time_limit_in_seconds', 18000) - self.storage_location = kwargs.get('storage_location', None) - self.filters = kwargs.get('filters', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PacketCaptureResultProperties(PacketCaptureParameters): - """Describes the properties of a packet capture session. - - All required parameters must be populated in order to send to Azure. - - :param target: Required. The ID of the targeted resource, only VM is currently supported. - :type target: str - :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes - are truncated. - :type bytes_to_capture_per_packet: int - :param total_bytes_per_session: Maximum size of the capture output. - :type total_bytes_per_session: int - :param time_limit_in_seconds: Maximum duration of the capture session in seconds. - :type time_limit_in_seconds: int - :param storage_location: Required. Describes the storage location for a packet capture session. - :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation - :param filters: - :type filters: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] - :param provisioning_state: The provisioning state of the packet capture session. Possible - values include: "Succeeded", "Updating", "Deleting", "Failed". - :type provisioning_state: str or ~azure.mgmt.network.v2017_08_01.models.ProvisioningState - """ - - _validation = { - 'target': {'required': True}, - 'storage_location': {'required': True}, - } - - _attribute_map = { - 'target': {'key': 'target', 'type': 'str'}, - 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, - 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, - 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, - 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, - 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PacketCaptureResultProperties, self).__init__(**kwargs) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PacketCaptureStorageLocation(msrest.serialization.Model): - """Describes the storage location for a packet capture session. - - :param storage_id: The ID of the storage account to save the packet capture session. Required - if no local file path is provided. - :type storage_id: str - :param storage_path: The URI of the storage path to save the packet capture. Must be a - well-formed URI describing the location to save the packet capture. - :type storage_path: str - :param file_path: A valid local path on the targeting VM. Must include the name of the capture - file (*.cap). For linux virtual machine it must start with /var/captures. Required if no - storage ID is provided, otherwise optional. - :type file_path: str - """ - - _attribute_map = { - 'storage_id': {'key': 'storageId', 'type': 'str'}, - 'storage_path': {'key': 'storagePath', 'type': 'str'}, - 'file_path': {'key': 'filePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PacketCaptureStorageLocation, self).__init__(**kwargs) - self.storage_id = kwargs.get('storage_id', None) - self.storage_path = kwargs.get('storage_path', None) - self.file_path = kwargs.get('file_path', None) - - -class PatchRouteFilter(SubResource): - """Route Filter Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :ivar type: Resource type. - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param rules: Collection of RouteFilterRules contained within a route filter. - :type rules: list[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :param peerings: A collection of references to express route circuit peerings. - :type peerings: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :ivar provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', 'Succeeded' and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'etag': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, - 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PatchRouteFilter, self).__init__(**kwargs) - self.name = None - self.etag = None - self.type = None - self.tags = kwargs.get('tags', None) - self.rules = kwargs.get('rules', None) - self.peerings = kwargs.get('peerings', None) - self.provisioning_state = None - - -class PatchRouteFilterRule(SubResource): - """Route Filter Rule Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param access: The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values - include: "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access - :param route_filter_rule_type: The rule type of the rule. Valid value is: 'Community'. Possible - values include: "Community". - :type route_filter_rule_type: str or ~azure.mgmt.network.v2017_08_01.models.RouteFilterRuleType - :param communities: The collection for bgp community values to filter on. e.g. - ['12076:5010','12076:5020']. - :type communities: list[str] - :ivar provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', 'Succeeded' and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'access': {'key': 'properties.access', 'type': 'str'}, - 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, - 'communities': {'key': 'properties.communities', 'type': '[str]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PatchRouteFilterRule, self).__init__(**kwargs) - self.name = None - self.etag = None - self.tags = kwargs.get('tags', None) - self.access = kwargs.get('access', None) - self.route_filter_rule_type = kwargs.get('route_filter_rule_type', None) - self.communities = kwargs.get('communities', None) - self.provisioning_state = None - - -class Probe(SubResource): - """A load balancer probe. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :ivar load_balancing_rules: The load balancer rules that use this probe. - :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: 'Http' or 'Tcp'. If 'Tcp' - is specified, a received ACK is required for the probe to be successful. If 'Http' is - specified, a 200 OK response from the specifies URI is required for the probe to be successful. - Possible values include: "Http", "Tcp". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range from 1 to 65535, - inclusive. - :type port: int - :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint - for health status. 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. - :type interval_in_seconds: int - :param number_of_probes: The number of probes where if no response, will result in stopping - further traffic from being delivered to the endpoint. This values allows endpoints to be taken - out of rotation faster or slower than the typical times used in Azure. - :type number_of_probes: int - :param request_path: 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. There is no default value. - :type request_path: str - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'load_balancing_rules': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'port': {'key': 'properties.port', 'type': 'int'}, - 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, - 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, - 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Probe, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.load_balancing_rules = None - self.protocol = kwargs.get('protocol', None) - self.port = kwargs.get('port', None) - self.interval_in_seconds = kwargs.get('interval_in_seconds', None) - self.number_of_probes = kwargs.get('number_of_probes', None) - self.request_path = kwargs.get('request_path', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PublicIPAddress(Resource): - """Public IP address resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The public IP address SKU. - :type sku: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddressSku - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param zones: A list of availability zones denoting the IP allocated for the resource needs to - come from. - :type zones: list[str] - :param public_ip_allocation_method: The public IP allocation method. Possible values are: - 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type public_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param public_ip_address_version: The public IP address version. Possible values are: 'IPv4' - and 'IPv6'. Possible values include: "IPv4", "IPv6". - :type public_ip_address_version: str or ~azure.mgmt.network.v2017_08_01.models.IPVersion - :ivar ip_configuration: The IP configuration associated with the public IP address. - :vartype ip_configuration: ~azure.mgmt.network.v2017_08_01.models.IPConfiguration - :param dns_settings: The FQDN of the DNS record associated with the public IP address. - :type dns_settings: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddressDnsSettings - :param ip_address: The IP address associated with the public IP address resource. - :type ip_address: str - :param idle_timeout_in_minutes: The idle timeout of the public IP address. - :type idle_timeout_in_minutes: int - :param resource_guid: The resource GUID property of the public IP resource. - :type resource_guid: str - :param provisioning_state: The provisioning state of the PublicIP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'ip_configuration': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'zones': {'key': 'zones', 'type': '[str]'}, - 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, - 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, - 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, - 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, - 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, - 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PublicIPAddress, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.etag = kwargs.get('etag', None) - self.zones = kwargs.get('zones', None) - self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) - self.public_ip_address_version = kwargs.get('public_ip_address_version', None) - self.ip_configuration = None - self.dns_settings = kwargs.get('dns_settings', None) - self.ip_address = kwargs.get('ip_address', None) - self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class PublicIPAddressDnsSettings(msrest.serialization.Model): - """Contains FQDN of the DNS record associated with the public IP address. - - :param domain_name_label: 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. - :type domain_name_label: str - :param fqdn: 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. - :type fqdn: str - :param reverse_fqdn: 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. - :type reverse_fqdn: str - """ - - _attribute_map = { - 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PublicIPAddressDnsSettings, self).__init__(**kwargs) - self.domain_name_label = kwargs.get('domain_name_label', None) - self.fqdn = kwargs.get('fqdn', None) - self.reverse_fqdn = kwargs.get('reverse_fqdn', None) - - -class PublicIPAddressListResult(msrest.serialization.Model): - """Response for ListPublicIpAddresses API service call. - - :param value: A list of public IP addresses that exists in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.PublicIPAddress] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PublicIPAddress]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PublicIPAddressListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class PublicIPAddressSku(msrest.serialization.Model): - """SKU of a public IP address. - - :param name: Name of a public IP address SKU. Possible values include: "Basic", "Standard". - :type name: str or ~azure.mgmt.network.v2017_08_01.models.PublicIPAddressSkuName - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PublicIPAddressSku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - - -class QueryTroubleshootingParameters(msrest.serialization.Model): - """Parameters that define the resource to query the troubleshooting result. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The target resource ID to query the troubleshooting - result. - :type target_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(QueryTroubleshootingParameters, self).__init__(**kwargs) - self.target_resource_id = kwargs['target_resource_id'] - - -class ResourceNavigationLink(SubResource): - """ResourceNavigationLink resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param linked_resource_type: Resource type of the linked resource. - :type linked_resource_type: str - :param link: Link to the external resource. - :type link: str - :ivar provisioning_state: Provisioning state of the ResourceNavigationLink resource. - :vartype provisioning_state: str - """ - - _validation = { - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, - 'link': {'key': 'properties.link', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceNavigationLink, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = None - self.linked_resource_type = kwargs.get('linked_resource_type', None) - self.link = kwargs.get('link', None) - self.provisioning_state = None - - -class RetentionPolicyParameters(msrest.serialization.Model): - """Parameters that define the retention policy for flow log. - - :param days: Number of days to retain flow log records. - :type days: int - :param enabled: Flag to enable/disable retention. - :type enabled: bool - """ - - _attribute_map = { - 'days': {'key': 'days', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(RetentionPolicyParameters, self).__init__(**kwargs) - self.days = kwargs.get('days', 0) - self.enabled = kwargs.get('enabled', False) - - -class Route(SubResource): - """Route resource. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param address_prefix: The destination CIDR to which the route applies. - :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. Possible values are: - 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible - values include: "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", "None". - :type next_hop_type: str or ~azure.mgmt.network.v2017_08_01.models.RouteNextHopType - :param next_hop_ip_address: The IP address packets should be forwarded to. Next hop values are - only allowed in routes where the next hop type is VirtualAppliance. - :type next_hop_ip_address: str - :param provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, - 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, - 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Route, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.address_prefix = kwargs.get('address_prefix', None) - self.next_hop_type = kwargs.get('next_hop_type', None) - self.next_hop_ip_address = kwargs.get('next_hop_ip_address', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class RouteFilter(Resource): - """Route Filter Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :ivar etag: Gets a unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param rules: Collection of RouteFilterRules contained within a route filter. - :type rules: list[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :param peerings: A collection of references to express route circuit peerings. - :type peerings: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :ivar provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', 'Succeeded' and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, - 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RouteFilter, self).__init__(**kwargs) - self.etag = None - self.rules = kwargs.get('rules', None) - self.peerings = kwargs.get('peerings', None) - self.provisioning_state = None - - -class RouteFilterListResult(msrest.serialization.Model): - """Response for the ListRouteFilters API service call. - - :param value: Gets a list of route filters in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.RouteFilter] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RouteFilter]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RouteFilterListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class RouteFilterRule(SubResource): - """Route Filter Rule Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param location: Resource location. - :type location: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param access: The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values - include: "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access - :param route_filter_rule_type: The rule type of the rule. Valid value is: 'Community'. Possible - values include: "Community". - :type route_filter_rule_type: str or ~azure.mgmt.network.v2017_08_01.models.RouteFilterRuleType - :param communities: The collection for bgp community values to filter on. e.g. - ['12076:5010','12076:5020']. - :type communities: list[str] - :ivar provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', 'Succeeded' and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'access': {'key': 'properties.access', 'type': 'str'}, - 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, - 'communities': {'key': 'properties.communities', 'type': '[str]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RouteFilterRule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.location = kwargs.get('location', None) - self.etag = None - self.tags = kwargs.get('tags', None) - self.access = kwargs.get('access', None) - self.route_filter_rule_type = kwargs.get('route_filter_rule_type', None) - self.communities = kwargs.get('communities', None) - self.provisioning_state = None - - -class RouteFilterRuleListResult(msrest.serialization.Model): - """Response for the ListRouteFilterRules API service call. - - :param value: Gets a list of RouteFilterRules in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RouteFilterRule]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RouteFilterRuleListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class RouteListResult(msrest.serialization.Model): - """Response for the ListRoute API service call. - - :param value: Gets a list of routes in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.Route] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Route]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RouteListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class RouteTable(Resource): - """Route table resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param routes: Collection of routes contained within a route table. - :type routes: list[~azure.mgmt.network.v2017_08_01.models.Route] - :ivar subnets: A collection of references to subnets. - :vartype subnets: list[~azure.mgmt.network.v2017_08_01.models.Subnet] - :param provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'subnets': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'routes': {'key': 'properties.routes', 'type': '[Route]'}, - 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RouteTable, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.routes = kwargs.get('routes', None) - self.subnets = None - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class RouteTableListResult(msrest.serialization.Model): - """Response for the ListRouteTable API service call. - - :param value: Gets a list of route tables in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.RouteTable] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RouteTable]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(RouteTableListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class SecurityGroupNetworkInterface(msrest.serialization.Model): - """Network interface and all its associated security rules. - - :param id: ID of the network interface. - :type id: str - :param security_rule_associations: All security rules associated with the network interface. - :type security_rule_associations: - ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAssociations - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, - } - - def __init__( - self, - **kwargs - ): - super(SecurityGroupNetworkInterface, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.security_rule_associations = kwargs.get('security_rule_associations', None) - - -class SecurityGroupViewParameters(msrest.serialization.Model): - """Parameters that define the VM to check security groups for. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. ID of the target VM. - :type target_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SecurityGroupViewParameters, self).__init__(**kwargs) - self.target_resource_id = kwargs['target_resource_id'] - - -class SecurityGroupViewResult(msrest.serialization.Model): - """The information about security rules applied to the specified VM. - - :param network_interfaces: List of network interfaces on the specified VM. - :type network_interfaces: - list[~azure.mgmt.network.v2017_08_01.models.SecurityGroupNetworkInterface] - """ - - _attribute_map = { - 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, - } - - def __init__( - self, - **kwargs - ): - super(SecurityGroupViewResult, self).__init__(**kwargs) - self.network_interfaces = kwargs.get('network_interfaces', None) - - -class SecurityRule(SubResource): - """Network security rule. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param description: A description for this rule. Restricted to 140 chars. - :type description: str - :param protocol: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and - '*'. Possible values include: "Tcp", "Udp", "*". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleProtocol - :param source_port_range: The source port or range. Integer or range between 0 and 65535. - Asterisk '*' can also be used to match all ports. - :type source_port_range: str - :param destination_port_range: The destination port or range. Integer or range between 0 and - 65535. Asterisk '*' can also be used to match all ports. - :type destination_port_range: str - :param source_address_prefix: 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. - :type source_address_prefix: str - :param source_address_prefixes: The CIDR or source IP ranges. - :type source_address_prefixes: list[str] - :param destination_address_prefix: 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. - :type destination_address_prefix: str - :param destination_address_prefixes: The destination address prefixes. CIDR or destination IP - ranges. - :type destination_address_prefixes: list[str] - :param source_port_ranges: The source port ranges. - :type source_port_ranges: list[str] - :param destination_port_ranges: The destination port ranges. - :type destination_port_ranges: list[str] - :param access: The network traffic is allowed or denied. Possible values are: 'Allow' and - 'Deny'. Possible values include: "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAccess - :param priority: 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. - :type priority: int - :param direction: The direction of the rule. The direction specifies if rule will be evaluated - on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - include: "Inbound", "Outbound". - :type direction: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleDirection - :param provisioning_state: The provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, - 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, - 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, - 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, - 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, - 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, - 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, - 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, - 'access': {'key': 'properties.access', 'type': 'str'}, - 'priority': {'key': 'properties.priority', 'type': 'int'}, - 'direction': {'key': 'properties.direction', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SecurityRule, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.description = kwargs.get('description', None) - self.protocol = kwargs.get('protocol', None) - self.source_port_range = kwargs.get('source_port_range', None) - self.destination_port_range = kwargs.get('destination_port_range', None) - self.source_address_prefix = kwargs.get('source_address_prefix', None) - self.source_address_prefixes = kwargs.get('source_address_prefixes', None) - self.destination_address_prefix = kwargs.get('destination_address_prefix', None) - self.destination_address_prefixes = kwargs.get('destination_address_prefixes', None) - self.source_port_ranges = kwargs.get('source_port_ranges', None) - self.destination_port_ranges = kwargs.get('destination_port_ranges', None) - self.access = kwargs.get('access', None) - self.priority = kwargs.get('priority', None) - self.direction = kwargs.get('direction', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class SecurityRuleAssociations(msrest.serialization.Model): - """All security rules associated with the network interface. - - :param network_interface_association: Network interface and its custom security rules. - :type network_interface_association: - ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceAssociation - :param subnet_association: Network interface and its custom security rules. - :type subnet_association: ~azure.mgmt.network.v2017_08_01.models.SubnetAssociation - :param default_security_rules: Collection of default security rules of the network security - group. - :type default_security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :param effective_security_rules: Collection of effective security rules. - :type effective_security_rules: - list[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityRule] - """ - - _attribute_map = { - 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, - 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, - 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, - 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, - } - - def __init__( - self, - **kwargs - ): - super(SecurityRuleAssociations, self).__init__(**kwargs) - self.network_interface_association = kwargs.get('network_interface_association', None) - self.subnet_association = kwargs.get('subnet_association', None) - self.default_security_rules = kwargs.get('default_security_rules', None) - self.effective_security_rules = kwargs.get('effective_security_rules', None) - - -class SecurityRuleListResult(msrest.serialization.Model): - """Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security group. - - :param value: The security rules in a network security group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SecurityRule]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SecurityRuleListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class ServiceEndpointPropertiesFormat(msrest.serialization.Model): - """The service endpoint properties. - - :param service: The type of the endpoint service. - :type service: str - :param locations: A list of locations. - :type locations: list[str] - :param provisioning_state: The provisioning state of the resource. - :type provisioning_state: str - """ - - _attribute_map = { - 'service': {'key': 'service', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) - self.service = kwargs.get('service', None) - self.locations = kwargs.get('locations', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class Subnet(SubResource): - """Subnet in a virtual network resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param address_prefix: The address prefix for the subnet. - :type address_prefix: str - :param network_security_group: The reference of the NetworkSecurityGroup resource. - :type network_security_group: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup - :param route_table: The reference of the RouteTable resource. - :type route_table: ~azure.mgmt.network.v2017_08_01.models.RouteTable - :param service_endpoints: An array of service endpoints. - :type service_endpoints: - list[~azure.mgmt.network.v2017_08_01.models.ServiceEndpointPropertiesFormat] - :ivar ip_configurations: Gets an array of references to the network interface IP configurations - using subnet. - :vartype ip_configurations: list[~azure.mgmt.network.v2017_08_01.models.IPConfiguration] - :param resource_navigation_links: Gets an array of references to the external resources using - subnet. - :type resource_navigation_links: - list[~azure.mgmt.network.v2017_08_01.models.ResourceNavigationLink] - :param provisioning_state: The provisioning state of the resource. - :type provisioning_state: str - """ - - _validation = { - 'ip_configurations': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, - 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, - 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, - 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, - 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, - 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Subnet, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.address_prefix = kwargs.get('address_prefix', None) - self.network_security_group = kwargs.get('network_security_group', None) - self.route_table = kwargs.get('route_table', None) - self.service_endpoints = kwargs.get('service_endpoints', None) - self.ip_configurations = None - self.resource_navigation_links = kwargs.get('resource_navigation_links', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class SubnetAssociation(msrest.serialization.Model): - """Network interface and its custom security rules. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Subnet ID. - :vartype id: str - :param security_rules: Collection of custom security rules. - :type security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, - } - - def __init__( - self, - **kwargs - ): - super(SubnetAssociation, self).__init__(**kwargs) - self.id = None - self.security_rules = kwargs.get('security_rules', None) - - -class SubnetListResult(msrest.serialization.Model): - """Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. - - :param value: The subnets in a virtual network. - :type value: list[~azure.mgmt.network.v2017_08_01.models.Subnet] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Subnet]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SubnetListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class Topology(msrest.serialization.Model): - """Topology of the specified resource group. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: GUID representing the operation id. - :vartype id: str - :ivar created_date_time: The datetime when the topology was initially created for the resource - group. - :vartype created_date_time: ~datetime.datetime - :ivar last_modified: The datetime when the topology was last modified. - :vartype last_modified: ~datetime.datetime - :param resources: - :type resources: list[~azure.mgmt.network.v2017_08_01.models.TopologyResource] - """ - - _validation = { - 'id': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'last_modified': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(Topology, self).__init__(**kwargs) - self.id = None - self.created_date_time = None - self.last_modified = None - self.resources = kwargs.get('resources', None) - - -class TopologyAssociation(msrest.serialization.Model): - """Resources that have an association with the parent resource. - - :param name: The name of the resource that is associated with the parent resource. - :type name: str - :param resource_id: The ID of the resource that is associated with the parent resource. - :type resource_id: str - :param association_type: The association type of the child resource to the parent resource. - Possible values include: "Associated", "Contains". - :type association_type: str or ~azure.mgmt.network.v2017_08_01.models.AssociationType - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'association_type': {'key': 'associationType', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TopologyAssociation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.resource_id = kwargs.get('resource_id', None) - self.association_type = kwargs.get('association_type', None) - - -class TopologyParameters(msrest.serialization.Model): - """Parameters that define the representation of topology. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_group_name: Required. The name of the target resource group to perform - topology on. - :type target_resource_group_name: str - """ - - _validation = { - 'target_resource_group_name': {'required': True}, - } - - _attribute_map = { - 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TopologyParameters, self).__init__(**kwargs) - self.target_resource_group_name = kwargs['target_resource_group_name'] - - -class TopologyResource(msrest.serialization.Model): - """The network resource topology information for the given resource group. - - :param name: Name of the resource. - :type name: str - :param id: ID of the resource. - :type id: str - :param location: Resource location. - :type location: str - :param associations: Holds the associations the resource has with other resources in the - resource group. - :type associations: list[~azure.mgmt.network.v2017_08_01.models.TopologyAssociation] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, - } - - def __init__( - self, - **kwargs - ): - super(TopologyResource, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.id = kwargs.get('id', None) - self.location = kwargs.get('location', None) - self.associations = kwargs.get('associations', None) - - -class TroubleshootingDetails(msrest.serialization.Model): - """Information gained from troubleshooting of specified resource. - - :param id: The id of the get troubleshoot operation. - :type id: str - :param reason_type: Reason type of failure. - :type reason_type: str - :param summary: A summary of troubleshooting. - :type summary: str - :param detail: Details on troubleshooting results. - :type detail: str - :param recommended_actions: List of recommended actions. - :type recommended_actions: - list[~azure.mgmt.network.v2017_08_01.models.TroubleshootingRecommendedActions] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'reason_type': {'key': 'reasonType', 'type': 'str'}, - 'summary': {'key': 'summary', 'type': 'str'}, - 'detail': {'key': 'detail', 'type': 'str'}, - 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, - } - - def __init__( - self, - **kwargs - ): - super(TroubleshootingDetails, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.reason_type = kwargs.get('reason_type', None) - self.summary = kwargs.get('summary', None) - self.detail = kwargs.get('detail', None) - self.recommended_actions = kwargs.get('recommended_actions', None) - - -class TroubleshootingParameters(msrest.serialization.Model): - """Parameters that define the resource to troubleshoot. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The target resource to troubleshoot. - :type target_resource_id: str - :param storage_id: Required. The ID for the storage account to save the troubleshoot result. - :type storage_id: str - :param storage_path: Required. The path to the blob to save the troubleshoot result in. - :type storage_path: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - 'storage_id': {'required': True}, - 'storage_path': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, - 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TroubleshootingParameters, self).__init__(**kwargs) - self.target_resource_id = kwargs['target_resource_id'] - self.storage_id = kwargs['storage_id'] - self.storage_path = kwargs['storage_path'] - - -class TroubleshootingRecommendedActions(msrest.serialization.Model): - """Recommended actions based on discovered issues. - - :param action_id: ID of the recommended action. - :type action_id: str - :param action_text: Description of recommended actions. - :type action_text: str - :param action_uri: The uri linking to a documentation for the recommended troubleshooting - actions. - :type action_uri: str - :param action_uri_text: The information from the URI for the recommended troubleshooting - actions. - :type action_uri_text: str - """ - - _attribute_map = { - 'action_id': {'key': 'actionId', 'type': 'str'}, - 'action_text': {'key': 'actionText', 'type': 'str'}, - 'action_uri': {'key': 'actionUri', 'type': 'str'}, - 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TroubleshootingRecommendedActions, self).__init__(**kwargs) - self.action_id = kwargs.get('action_id', None) - self.action_text = kwargs.get('action_text', None) - self.action_uri = kwargs.get('action_uri', None) - self.action_uri_text = kwargs.get('action_uri_text', None) - - -class TroubleshootingResult(msrest.serialization.Model): - """Troubleshooting information gained from specified resource. - - :param start_time: The start time of the troubleshooting. - :type start_time: ~datetime.datetime - :param end_time: The end time of the troubleshooting. - :type end_time: ~datetime.datetime - :param code: The result code of the troubleshooting. - :type code: str - :param results: Information from troubleshooting. - :type results: list[~azure.mgmt.network.v2017_08_01.models.TroubleshootingDetails] - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'code': {'key': 'code', 'type': 'str'}, - 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, - } - - def __init__( - self, - **kwargs - ): - super(TroubleshootingResult, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', None) - self.end_time = kwargs.get('end_time', None) - self.code = kwargs.get('code', None) - self.results = kwargs.get('results', None) - - -class TunnelConnectionHealth(msrest.serialization.Model): - """VirtualNetworkGatewayConnection properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tunnel: Tunnel name. - :vartype tunnel: str - :ivar connection_status: Virtual network Gateway connection status. Possible values include: - "Unknown", "Connecting", "Connected", "NotConnected". - :vartype connection_status: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionStatus - :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this connection. - :vartype ingress_bytes_transferred: long - :ivar egress_bytes_transferred: The Egress Bytes Transferred in this connection. - :vartype egress_bytes_transferred: long - :ivar last_connection_established_utc_time: The time at which connection was established in Utc - format. - :vartype last_connection_established_utc_time: str - """ - - _validation = { - 'tunnel': {'readonly': True}, - 'connection_status': {'readonly': True}, - 'ingress_bytes_transferred': {'readonly': True}, - 'egress_bytes_transferred': {'readonly': True}, - 'last_connection_established_utc_time': {'readonly': True}, - } - - _attribute_map = { - 'tunnel': {'key': 'tunnel', 'type': 'str'}, - 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, - 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, - 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, - 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TunnelConnectionHealth, self).__init__(**kwargs) - self.tunnel = None - self.connection_status = None - self.ingress_bytes_transferred = None - self.egress_bytes_transferred = None - self.last_connection_established_utc_time = None - - -class Usage(msrest.serialization.Model): - """Describes network resource usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource identifier. - :vartype id: str - :param unit: Required. An enum describing the unit of measurement. Possible values include: - "Count". - :type unit: str or ~azure.mgmt.network.v2017_08_01.models.UsageUnit - :param current_value: Required. The current value of the usage. - :type current_value: long - :param limit: Required. The limit of usage. - :type limit: long - :param name: Required. The name of the type of usage. - :type name: ~azure.mgmt.network.v2017_08_01.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'unit': {'required': True}, - 'current_value': {'required': True}, - 'limit': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - **kwargs - ): - super(Usage, self).__init__(**kwargs) - self.id = None - self.unit = kwargs['unit'] - self.current_value = kwargs['current_value'] - self.limit = kwargs['limit'] - self.name = kwargs['name'] - - -class UsageName(msrest.serialization.Model): - """The usage names. - - :param value: A string describing the resource name. - :type value: str - :param localized_value: A localized string describing the resource name. - :type localized_value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UsageName, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.localized_value = kwargs.get('localized_value', None) - - -class UsagesListResult(msrest.serialization.Model): - """The list usages operation response. - - :param value: The list network resource usages. - :type value: list[~azure.mgmt.network.v2017_08_01.models.Usage] - :param next_link: URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(UsagesListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class VerificationIPFlowParameters(msrest.serialization.Model): - """Parameters that define the IP flow to be verified. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The ID of the target resource to perform next-hop on. - :type target_resource_id: str - :param direction: Required. The direction of the packet represented as a 5-tuple. Possible - values include: "Inbound", "Outbound". - :type direction: str or ~azure.mgmt.network.v2017_08_01.models.Direction - :param protocol: Required. Protocol to be verified on. Possible values include: "TCP", "UDP". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.Protocol - :param local_port: Required. The local port. Acceptable values are a single integer in the - range (0-65535). Support for * for the source port, which depends on the direction. - :type local_port: str - :param remote_port: Required. The remote port. Acceptable values are a single integer in the - range (0-65535). Support for * for the source port, which depends on the direction. - :type remote_port: str - :param local_ip_address: Required. The local IP address. Acceptable values are valid IPv4 - addresses. - :type local_ip_address: str - :param remote_ip_address: Required. The remote IP address. Acceptable values are valid IPv4 - addresses. - :type remote_ip_address: str - :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is - enabled on any of them, then this parameter must be specified. Otherwise optional). - :type target_nic_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - 'direction': {'required': True}, - 'protocol': {'required': True}, - 'local_port': {'required': True}, - 'remote_port': {'required': True}, - 'local_ip_address': {'required': True}, - 'remote_ip_address': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'direction': {'key': 'direction', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'local_port': {'key': 'localPort', 'type': 'str'}, - 'remote_port': {'key': 'remotePort', 'type': 'str'}, - 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, - 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, - 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VerificationIPFlowParameters, self).__init__(**kwargs) - self.target_resource_id = kwargs['target_resource_id'] - self.direction = kwargs['direction'] - self.protocol = kwargs['protocol'] - self.local_port = kwargs['local_port'] - self.remote_port = kwargs['remote_port'] - self.local_ip_address = kwargs['local_ip_address'] - self.remote_ip_address = kwargs['remote_ip_address'] - self.target_nic_resource_id = kwargs.get('target_nic_resource_id', None) - - -class VerificationIPFlowResult(msrest.serialization.Model): - """Results of IP flow verification on the target resource. - - :param access: Indicates whether the traffic is allowed or denied. Possible values include: - "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access - :param rule_name: Name of the rule. If input is not matched against any security rule, it is - not displayed. - :type rule_name: str - """ - - _attribute_map = { - 'access': {'key': 'access', 'type': 'str'}, - 'rule_name': {'key': 'ruleName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VerificationIPFlowResult, self).__init__(**kwargs) - self.access = kwargs.get('access', None) - self.rule_name = kwargs.get('rule_name', None) - - -class VirtualNetwork(Resource): - """Virtual Network resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param address_space: The AddressSpace that contains an array of IP address ranges that can be - used by subnets. - :type address_space: ~azure.mgmt.network.v2017_08_01.models.AddressSpace - :param dhcp_options: The dhcpOptions that contains an array of DNS servers available to VMs - deployed in the virtual network. - :type dhcp_options: ~azure.mgmt.network.v2017_08_01.models.DhcpOptions - :param subnets: A list of subnets in a Virtual Network. - :type subnets: list[~azure.mgmt.network.v2017_08_01.models.Subnet] - :param virtual_network_peerings: A list of peerings in a Virtual Network. - :type virtual_network_peerings: - list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering] - :param resource_guid: The resourceGuid property of the Virtual Network resource. - :type resource_guid: str - :param provisioning_state: The provisioning state of the PublicIP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, - 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, - 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, - 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetwork, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.address_space = kwargs.get('address_space', None) - self.dhcp_options = kwargs.get('dhcp_options', None) - self.subnets = kwargs.get('subnets', None) - self.virtual_network_peerings = kwargs.get('virtual_network_peerings', None) - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class VirtualNetworkConnectionGatewayReference(msrest.serialization.Model): - """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of VirtualNetworkGateway or LocalNetworkGateway resource. - :type id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) - self.id = kwargs['id'] - - -class VirtualNetworkGateway(Resource): - """A common class for general resource information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param ip_configurations: IP configurations for virtual network gateway. - :type ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayIPConfiguration] - :param gateway_type: The type of this virtual network gateway. Possible values are: 'Vpn' and - 'ExpressRoute'. Possible values include: "Vpn", "ExpressRoute". - :type gateway_type: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayType - :param vpn_type: The type of this virtual network gateway. Possible values are: 'PolicyBased' - and 'RouteBased'. Possible values include: "PolicyBased", "RouteBased". - :type vpn_type: str or ~azure.mgmt.network.v2017_08_01.models.VpnType - :param enable_bgp: Whether BGP is enabled for this virtual network gateway or not. - :type enable_bgp: bool - :param active: ActiveActive flag. - :type active: bool - :param gateway_default_site: The reference of the LocalNetworkGateway resource which represents - local network site having default routes. Assign Null value in case of removing existing - default site setting. - :type gateway_default_site: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param sku: The reference of the VirtualNetworkGatewaySku resource which represents the SKU - selected for Virtual network gateway. - :type sku: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewaySku - :param vpn_client_configuration: The reference of the VpnClientConfiguration resource which - represents the P2S VpnClient configurations. - :type vpn_client_configuration: ~azure.mgmt.network.v2017_08_01.models.VpnClientConfiguration - :param bgp_settings: Virtual network gateway's BGP speaker settings. - :type bgp_settings: ~azure.mgmt.network.v2017_08_01.models.BgpSettings - :param resource_guid: The resource GUID property of the VirtualNetworkGateway resource. - :type resource_guid: str - :ivar provisioning_state: The provisioning state of the VirtualNetworkGateway resource. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, - 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, - 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, - 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, - 'active': {'key': 'properties.activeActive', 'type': 'bool'}, - 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, - 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, - 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, - 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkGateway, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.ip_configurations = kwargs.get('ip_configurations', None) - self.gateway_type = kwargs.get('gateway_type', None) - self.vpn_type = kwargs.get('vpn_type', None) - self.enable_bgp = kwargs.get('enable_bgp', None) - self.active = kwargs.get('active', None) - self.gateway_default_site = kwargs.get('gateway_default_site', None) - self.sku = kwargs.get('sku', None) - self.vpn_client_configuration = kwargs.get('vpn_client_configuration', None) - self.bgp_settings = kwargs.get('bgp_settings', None) - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = None - - -class VirtualNetworkGatewayConnection(Resource): - """A common class for general resource information. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param authorization_key: The authorizationKey. - :type authorization_key: str - :param virtual_network_gateway1: Required. The reference to virtual network gateway resource. - :type virtual_network_gateway1: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway - :param virtual_network_gateway2: The reference to virtual network gateway resource. - :type virtual_network_gateway2: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway - :param local_network_gateway2: The reference to local network gateway resource. - :type local_network_gateway2: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway - :param connection_type: Required. Gateway connection type. Possible values are: - 'IPsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: "IPsec", - "Vnet2Vnet", "ExpressRoute", "VPNClient". - :type connection_type: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionType - :param routing_weight: The routing weight. - :type routing_weight: int - :param shared_key: The IPSec shared key. - :type shared_key: str - :ivar connection_status: Virtual network Gateway connection status. Possible values are - 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: "Unknown", - "Connecting", "Connected", "NotConnected". - :vartype connection_status: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionStatus - :ivar tunnel_connection_status: Collection of all tunnels' connection health status. - :vartype tunnel_connection_status: - list[~azure.mgmt.network.v2017_08_01.models.TunnelConnectionHealth] - :ivar egress_bytes_transferred: The egress bytes transferred in this connection. - :vartype egress_bytes_transferred: long - :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. - :vartype ingress_bytes_transferred: long - :param peer: The reference to peerings resource. - :type peer: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param enable_bgp: EnableBgp flag. - :type enable_bgp: bool - :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. - :type use_policy_based_traffic_selectors: bool - :param ipsec_policies: The IPSec Policies to be considered by this connection. - :type ipsec_policies: list[~azure.mgmt.network.v2017_08_01.models.IpsecPolicy] - :param resource_guid: The resource GUID property of the VirtualNetworkGatewayConnection - resource. - :type resource_guid: str - :ivar provisioning_state: The provisioning state of the VirtualNetworkGatewayConnection - resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'virtual_network_gateway1': {'required': True}, - 'connection_type': {'required': True}, - 'connection_status': {'readonly': True}, - 'tunnel_connection_status': {'readonly': True}, - 'egress_bytes_transferred': {'readonly': True}, - 'ingress_bytes_transferred': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, - 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, - 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, - 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, - 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, - 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, - 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, - 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, - 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, - 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, - 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, - 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, - 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, - 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, - 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkGatewayConnection, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.authorization_key = kwargs.get('authorization_key', None) - self.virtual_network_gateway1 = kwargs['virtual_network_gateway1'] - self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) - self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) - self.connection_type = kwargs['connection_type'] - self.routing_weight = kwargs.get('routing_weight', None) - self.shared_key = kwargs.get('shared_key', None) - self.connection_status = None - self.tunnel_connection_status = None - self.egress_bytes_transferred = None - self.ingress_bytes_transferred = None - self.peer = kwargs.get('peer', None) - self.enable_bgp = kwargs.get('enable_bgp', None) - self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) - self.ipsec_policies = kwargs.get('ipsec_policies', None) - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = None - - -class VirtualNetworkGatewayConnectionListEntity(Resource): - """A common class for general resource information. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param authorization_key: The authorizationKey. - :type authorization_key: str - :param virtual_network_gateway1: Required. The reference to virtual network gateway resource. - :type virtual_network_gateway1: - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference - :param virtual_network_gateway2: The reference to virtual network gateway resource. - :type virtual_network_gateway2: - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference - :param local_network_gateway2: The reference to local network gateway resource. - :type local_network_gateway2: - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference - :param connection_type: Required. Gateway connection type. Possible values are: - 'IPsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: "IPsec", - "Vnet2Vnet", "ExpressRoute", "VPNClient". - :type connection_type: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionType - :param routing_weight: The routing weight. - :type routing_weight: int - :param shared_key: The IPSec shared key. - :type shared_key: str - :ivar connection_status: Virtual network Gateway connection status. Possible values are - 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: "Unknown", - "Connecting", "Connected", "NotConnected". - :vartype connection_status: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionStatus - :ivar tunnel_connection_status: Collection of all tunnels' connection health status. - :vartype tunnel_connection_status: - list[~azure.mgmt.network.v2017_08_01.models.TunnelConnectionHealth] - :ivar egress_bytes_transferred: The egress bytes transferred in this connection. - :vartype egress_bytes_transferred: long - :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. - :vartype ingress_bytes_transferred: long - :param peer: The reference to peerings resource. - :type peer: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param enable_bgp: EnableBgp flag. - :type enable_bgp: bool - :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. - :type use_policy_based_traffic_selectors: bool - :param ipsec_policies: The IPSec Policies to be considered by this connection. - :type ipsec_policies: list[~azure.mgmt.network.v2017_08_01.models.IpsecPolicy] - :param resource_guid: The resource GUID property of the VirtualNetworkGatewayConnection - resource. - :type resource_guid: str - :ivar provisioning_state: The provisioning state of the VirtualNetworkGatewayConnection - resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'virtual_network_gateway1': {'required': True}, - 'connection_type': {'required': True}, - 'connection_status': {'readonly': True}, - 'tunnel_connection_status': {'readonly': True}, - 'egress_bytes_transferred': {'readonly': True}, - 'ingress_bytes_transferred': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, - 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, - 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, - 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, - 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, - 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, - 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, - 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, - 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, - 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, - 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, - 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, - 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, - 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, - 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkGatewayConnectionListEntity, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.authorization_key = kwargs.get('authorization_key', None) - self.virtual_network_gateway1 = kwargs['virtual_network_gateway1'] - self.virtual_network_gateway2 = kwargs.get('virtual_network_gateway2', None) - self.local_network_gateway2 = kwargs.get('local_network_gateway2', None) - self.connection_type = kwargs['connection_type'] - self.routing_weight = kwargs.get('routing_weight', None) - self.shared_key = kwargs.get('shared_key', None) - self.connection_status = None - self.tunnel_connection_status = None - self.egress_bytes_transferred = None - self.ingress_bytes_transferred = None - self.peer = kwargs.get('peer', None) - self.enable_bgp = kwargs.get('enable_bgp', None) - self.use_policy_based_traffic_selectors = kwargs.get('use_policy_based_traffic_selectors', None) - self.ipsec_policies = kwargs.get('ipsec_policies', None) - self.resource_guid = kwargs.get('resource_guid', None) - self.provisioning_state = None - - -class VirtualNetworkGatewayConnectionListResult(msrest.serialization.Model): - """Response for the ListVirtualNetworkGatewayConnections API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: Gets a list of VirtualNetworkGatewayConnection resources that exists in a - resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkGatewayConnection]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkGatewayConnectionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class VirtualNetworkGatewayIPConfiguration(SubResource): - """IP configuration for virtual network gateway. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param private_ip_allocation_method: The private IP allocation method. Possible values are: - 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param subnet: The reference of the subnet resource. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param public_ip_address: The reference of the public IP resource. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.SubResource - :ivar provisioning_state: The provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) - self.subnet = kwargs.get('subnet', None) - self.public_ip_address = kwargs.get('public_ip_address', None) - self.provisioning_state = None - - -class VirtualNetworkGatewayListConnectionsResult(msrest.serialization.Model): - """Response for the VirtualNetworkGatewayListConnections API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: Gets a list of VirtualNetworkGatewayConnection resources that exists in a - resource group. - :type value: - list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionListEntity] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkGatewayConnectionListEntity]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkGatewayListConnectionsResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class VirtualNetworkGatewayListResult(msrest.serialization.Model): - """Response for the ListVirtualNetworkGateways API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: Gets a list of VirtualNetworkGateway resources that exists in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkGateway]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkGatewayListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class VirtualNetworkGatewaySku(msrest.serialization.Model): - """VirtualNetworkGatewaySku details. - - :param name: Gateway SKU name. Possible values include: "Basic", "HighPerformance", "Standard", - "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3". - :type name: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewaySkuName - :param tier: Gateway SKU tier. Possible values include: "Basic", "HighPerformance", "Standard", - "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3". - :type tier: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewaySkuTier - :param capacity: The capacity. - :type capacity: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkGatewaySku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) - self.capacity = kwargs.get('capacity', None) - - -class VirtualNetworkListResult(msrest.serialization.Model): - """Response for the ListVirtualNetworks API service call. - - :param value: Gets a list of VirtualNetwork resources in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetwork] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetwork]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class VirtualNetworkListUsageResult(msrest.serialization.Model): - """Response for the virtual networks GetUsage API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: VirtualNetwork usage stats. - :vartype value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkUsage] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkUsage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkListUsageResult, self).__init__(**kwargs) - self.value = None - self.next_link = kwargs.get('next_link', None) - - -class VirtualNetworkPeering(SubResource): - """Peerings in a virtual network resource. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param allow_virtual_network_access: Whether the VMs in the linked virtual network space would - be able to access all the VMs in local Virtual network space. - :type allow_virtual_network_access: bool - :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs in the remote - virtual network will be allowed/disallowed. - :type allow_forwarded_traffic: bool - :param allow_gateway_transit: If gateway links can be used in remote virtual networking to link - to this virtual network. - :type allow_gateway_transit: bool - :param use_remote_gateways: If remote gateways can be used on this virtual network. If the flag - is set to true, and allowGatewayTransit on remote peering is also true, virtual network will - use gateways of remote virtual network for transit. Only one peering can have this flag set to - true. This flag cannot be set if virtual network already has a gateway. - :type use_remote_gateways: bool - :param remote_virtual_network: The reference of the remote virtual network. - :type remote_virtual_network: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param peering_state: The status of the virtual network peering. Possible values are - 'Initiated', 'Connected', and 'Disconnected'. Possible values include: "Initiated", - "Connected", "Disconnected". - :type peering_state: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeeringState - :param provisioning_state: The provisioning state of the resource. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, - 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, - 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, - 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, - 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, - 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkPeering, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.allow_virtual_network_access = kwargs.get('allow_virtual_network_access', None) - self.allow_forwarded_traffic = kwargs.get('allow_forwarded_traffic', None) - self.allow_gateway_transit = kwargs.get('allow_gateway_transit', None) - self.use_remote_gateways = kwargs.get('use_remote_gateways', None) - self.remote_virtual_network = kwargs.get('remote_virtual_network', None) - self.peering_state = kwargs.get('peering_state', None) - self.provisioning_state = kwargs.get('provisioning_state', None) - - -class VirtualNetworkPeeringListResult(msrest.serialization.Model): - """Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. - - :param value: The peerings in a virtual network. - :type value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkPeering]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkPeeringListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class VirtualNetworkUsage(msrest.serialization.Model): - """Usage details for subnet. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_value: Indicates number of IPs used from the Subnet. - :vartype current_value: float - :ivar id: Subnet identifier. - :vartype id: str - :ivar limit: Indicates the size of the subnet. - :vartype limit: float - :ivar name: The name containing common and localized value for usage. - :vartype name: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkUsageName - :ivar unit: Usage units. Returns 'Count'. - :vartype unit: str - """ - - _validation = { - 'current_value': {'readonly': True}, - 'id': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'id': {'key': 'id', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkUsage, self).__init__(**kwargs) - self.current_value = None - self.id = None - self.limit = None - self.name = None - self.unit = None - - -class VirtualNetworkUsageName(msrest.serialization.Model): - """Usage strings container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar localized_value: Localized subnet size and usage string. - :vartype localized_value: str - :ivar value: Subnet size and usage string. - :vartype value: str - """ - - _validation = { - 'localized_value': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkUsageName, self).__init__(**kwargs) - self.localized_value = None - self.value = None - - -class VpnClientConfiguration(msrest.serialization.Model): - """VpnClientConfiguration for P2S client. - - :param vpn_client_address_pool: The reference of the address space resource which represents - Address space for P2S VpnClient. - :type vpn_client_address_pool: ~azure.mgmt.network.v2017_08_01.models.AddressSpace - :param vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. - :type vpn_client_root_certificates: - list[~azure.mgmt.network.v2017_08_01.models.VpnClientRootCertificate] - :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network - gateway. - :type vpn_client_revoked_certificates: - list[~azure.mgmt.network.v2017_08_01.models.VpnClientRevokedCertificate] - :param vpn_client_protocols: VpnClientProtocols for Virtual network gateway. - :type vpn_client_protocols: list[str or - ~azure.mgmt.network.v2017_08_01.models.VpnClientProtocol] - :param radius_server_address: The radius server address property of the VirtualNetworkGateway - resource for vpn client connection. - :type radius_server_address: str - :param radius_server_secret: The radius secret property of the VirtualNetworkGateway resource - for vpn client connection. - :type radius_server_secret: str - """ - - _attribute_map = { - 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, - 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, - 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, - 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, - 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, - 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VpnClientConfiguration, self).__init__(**kwargs) - self.vpn_client_address_pool = kwargs.get('vpn_client_address_pool', None) - self.vpn_client_root_certificates = kwargs.get('vpn_client_root_certificates', None) - self.vpn_client_revoked_certificates = kwargs.get('vpn_client_revoked_certificates', None) - self.vpn_client_protocols = kwargs.get('vpn_client_protocols', None) - self.radius_server_address = kwargs.get('radius_server_address', None) - self.radius_server_secret = kwargs.get('radius_server_secret', None) - - -class VpnClientParameters(msrest.serialization.Model): - """Vpn Client Parameters for package generation. - - :param processor_architecture: VPN client Processor Architecture. Possible values are: 'AMD64' - and 'X86'. Possible values include: "Amd64", "X86". - :type processor_architecture: str or - ~azure.mgmt.network.v2017_08_01.models.ProcessorArchitecture - :param authentication_method: VPN client Authentication Method. Possible values are: 'EAPTLS' - and 'EAPMSCHAPv2'. Possible values include: "EAPTLS", "EAPMSCHAPv2". - :type authentication_method: str or ~azure.mgmt.network.v2017_08_01.models.AuthenticationMethod - :param radius_server_auth_certificate: 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. - :type radius_server_auth_certificate: str - :param client_root_certificates: A list of client root certificates public certificate data - encoded as Base-64 strings. Optional parameter for external radius based authentication with - EAPTLS. - :type client_root_certificates: list[str] - """ - - _attribute_map = { - 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, - 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, - 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, - 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(VpnClientParameters, self).__init__(**kwargs) - self.processor_architecture = kwargs.get('processor_architecture', None) - self.authentication_method = kwargs.get('authentication_method', None) - self.radius_server_auth_certificate = kwargs.get('radius_server_auth_certificate', None) - self.client_root_certificates = kwargs.get('client_root_certificates', None) - - -class VpnClientRevokedCertificate(SubResource): - """VPN client revoked certificate of virtual network gateway. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param thumbprint: The revoked VPN client certificate thumbprint. - :type thumbprint: str - :ivar provisioning_state: The provisioning state of the VPN client revoked certificate - resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VpnClientRevokedCertificate, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.thumbprint = kwargs.get('thumbprint', None) - self.provisioning_state = None - - -class VpnClientRootCertificate(SubResource): - """VPN client root certificate of virtual network gateway. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param public_cert_data: Required. The certificate public data. - :type public_cert_data: str - :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'public_cert_data': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VpnClientRootCertificate, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.etag = kwargs.get('etag', None) - self.public_cert_data = kwargs['public_cert_data'] - self.provisioning_state = None diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_models_py3.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_models_py3.py deleted file mode 100644 index b5c63073c922..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_models_py3.py +++ /dev/null @@ -1,8826 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Dict, List, Optional, Union - -import msrest.serialization - -from ._network_management_client_enums import * - - -class AddressSpace(msrest.serialization.Model): - """AddressSpace contains an array of IP address ranges that can be used by subnets of the virtual network. - - :param address_prefixes: A list of address blocks reserved for this virtual network in CIDR - notation. - :type address_prefixes: list[str] - """ - - _attribute_map = { - 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, - } - - def __init__( - self, - *, - address_prefixes: Optional[List[str]] = None, - **kwargs - ): - super(AddressSpace, self).__init__(**kwargs) - self.address_prefixes = address_prefixes - - -class Resource(msrest.serialization.Model): - """Common resource representation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = id - self.name = None - self.type = None - self.location = location - self.tags = tags - - -class ApplicationGateway(Resource): - """Application gateway resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param sku: SKU of the application gateway resource. - :type sku: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySku - :param ssl_policy: SSL policy of the application gateway resource. - :type ssl_policy: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicy - :ivar operational_state: Operational state of the application gateway resource. Possible values - include: "Stopped", "Starting", "Running", "Stopping". - :vartype operational_state: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayOperationalState - :param gateway_ip_configurations: Subnets of application the gateway resource. - :type gateway_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayIPConfiguration] - :param authentication_certificates: Authentication certificates of the application gateway - resource. - :type authentication_certificates: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAuthenticationCertificate] - :param ssl_certificates: SSL certificates of the application gateway resource. - :type ssl_certificates: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCertificate] - :param frontend_ip_configurations: Frontend IP addresses of the application gateway resource. - :type frontend_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFrontendIPConfiguration] - :param frontend_ports: Frontend ports of the application gateway resource. - :type frontend_ports: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFrontendPort] - :param probes: Probes of the application gateway resource. - :type probes: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProbe] - :param backend_address_pools: Backend address pool of the application gateway resource. - :type backend_address_pools: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddressPool] - :param backend_http_settings_collection: Backend http settings of the application gateway - resource. - :type backend_http_settings_collection: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHttpSettings] - :param http_listeners: Http listeners of the application gateway resource. - :type http_listeners: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayHttpListener] - :param url_path_maps: URL path map of the application gateway resource. - :type url_path_maps: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayUrlPathMap] - :param request_routing_rules: Request routing rules of the application gateway resource. - :type request_routing_rules: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRequestRoutingRule] - :param redirect_configurations: Redirect configurations of the application gateway resource. - :type redirect_configurations: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRedirectConfiguration] - :param web_application_firewall_configuration: Web application firewall configuration. - :type web_application_firewall_configuration: - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayWebApplicationFirewallConfiguration - :param resource_guid: Resource GUID property of the application gateway resource. - :type resource_guid: str - :param provisioning_state: Provisioning state of the application gateway resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'operational_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'sku': {'key': 'properties.sku', 'type': 'ApplicationGatewaySku'}, - 'ssl_policy': {'key': 'properties.sslPolicy', 'type': 'ApplicationGatewaySslPolicy'}, - 'operational_state': {'key': 'properties.operationalState', 'type': 'str'}, - 'gateway_ip_configurations': {'key': 'properties.gatewayIPConfigurations', 'type': '[ApplicationGatewayIPConfiguration]'}, - 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[ApplicationGatewayAuthenticationCertificate]'}, - 'ssl_certificates': {'key': 'properties.sslCertificates', 'type': '[ApplicationGatewaySslCertificate]'}, - 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[ApplicationGatewayFrontendIPConfiguration]'}, - 'frontend_ports': {'key': 'properties.frontendPorts', 'type': '[ApplicationGatewayFrontendPort]'}, - 'probes': {'key': 'properties.probes', 'type': '[ApplicationGatewayProbe]'}, - 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, - 'backend_http_settings_collection': {'key': 'properties.backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHttpSettings]'}, - 'http_listeners': {'key': 'properties.httpListeners', 'type': '[ApplicationGatewayHttpListener]'}, - 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[ApplicationGatewayUrlPathMap]'}, - 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[ApplicationGatewayRequestRoutingRule]'}, - 'redirect_configurations': {'key': 'properties.redirectConfigurations', 'type': '[ApplicationGatewayRedirectConfiguration]'}, - 'web_application_firewall_configuration': {'key': 'properties.webApplicationFirewallConfiguration', 'type': 'ApplicationGatewayWebApplicationFirewallConfiguration'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - sku: Optional["ApplicationGatewaySku"] = None, - ssl_policy: Optional["ApplicationGatewaySslPolicy"] = None, - gateway_ip_configurations: Optional[List["ApplicationGatewayIPConfiguration"]] = None, - authentication_certificates: Optional[List["ApplicationGatewayAuthenticationCertificate"]] = None, - ssl_certificates: Optional[List["ApplicationGatewaySslCertificate"]] = None, - frontend_ip_configurations: Optional[List["ApplicationGatewayFrontendIPConfiguration"]] = None, - frontend_ports: Optional[List["ApplicationGatewayFrontendPort"]] = None, - probes: Optional[List["ApplicationGatewayProbe"]] = None, - backend_address_pools: Optional[List["ApplicationGatewayBackendAddressPool"]] = None, - backend_http_settings_collection: Optional[List["ApplicationGatewayBackendHttpSettings"]] = None, - http_listeners: Optional[List["ApplicationGatewayHttpListener"]] = None, - url_path_maps: Optional[List["ApplicationGatewayUrlPathMap"]] = None, - request_routing_rules: Optional[List["ApplicationGatewayRequestRoutingRule"]] = None, - redirect_configurations: Optional[List["ApplicationGatewayRedirectConfiguration"]] = None, - web_application_firewall_configuration: Optional["ApplicationGatewayWebApplicationFirewallConfiguration"] = None, - resource_guid: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.sku = sku - self.ssl_policy = ssl_policy - self.operational_state = None - self.gateway_ip_configurations = gateway_ip_configurations - self.authentication_certificates = authentication_certificates - self.ssl_certificates = ssl_certificates - self.frontend_ip_configurations = frontend_ip_configurations - self.frontend_ports = frontend_ports - self.probes = probes - self.backend_address_pools = backend_address_pools - self.backend_http_settings_collection = backend_http_settings_collection - self.http_listeners = http_listeners - self.url_path_maps = url_path_maps - self.request_routing_rules = request_routing_rules - self.redirect_configurations = redirect_configurations - self.web_application_firewall_configuration = web_application_firewall_configuration - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - - -class SubResource(msrest.serialization.Model): - """Reference to another subresource. - - :param id: Resource ID. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): - super(SubResource, self).__init__(**kwargs) - self.id = id - - -class ApplicationGatewayAuthenticationCertificate(SubResource): - """Authentication certificates of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param data: Certificate public data. - :type data: str - :param provisioning_state: Provisioning state of the authentication certificate resource. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'data': {'key': 'properties.data', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - data: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayAuthenticationCertificate, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.data = data - self.provisioning_state = provisioning_state - - -class ApplicationGatewayAvailableSslOptions(Resource): - """Response for ApplicationGatewayAvailableSslOptions API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param predefined_policies: List of available Ssl predefined policy. - :type predefined_policies: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param default_policy: Name of the Ssl predefined policy applied by default to application - gateway. Possible values include: "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", - "AppGwSslPolicy20170401S". - :type default_policy: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicyName - :param available_cipher_suites: List of available Ssl cipher suites. - :type available_cipher_suites: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCipherSuite] - :param available_protocols: List of available Ssl protocols. - :type available_protocols: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol] - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'predefined_policies': {'key': 'properties.predefinedPolicies', 'type': '[SubResource]'}, - 'default_policy': {'key': 'properties.defaultPolicy', 'type': 'str'}, - 'available_cipher_suites': {'key': 'properties.availableCipherSuites', 'type': '[str]'}, - 'available_protocols': {'key': 'properties.availableProtocols', 'type': '[str]'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - predefined_policies: Optional[List["SubResource"]] = None, - default_policy: Optional[Union[str, "ApplicationGatewaySslPolicyName"]] = None, - available_cipher_suites: Optional[List[Union[str, "ApplicationGatewaySslCipherSuite"]]] = None, - available_protocols: Optional[List[Union[str, "ApplicationGatewaySslProtocol"]]] = None, - **kwargs - ): - super(ApplicationGatewayAvailableSslOptions, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.predefined_policies = predefined_policies - self.default_policy = default_policy - self.available_cipher_suites = available_cipher_suites - self.available_protocols = available_protocols - - -class ApplicationGatewayAvailableSslPredefinedPolicies(msrest.serialization.Model): - """Response for ApplicationGatewayAvailableSslOptions API service call. - - :param value: List of available Ssl predefined policy. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPredefinedPolicy] - :param next_link: URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationGatewaySslPredefinedPolicy]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ApplicationGatewaySslPredefinedPolicy"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayAvailableSslPredefinedPolicies, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ApplicationGatewayAvailableWafRuleSetsResult(msrest.serialization.Model): - """Response for ApplicationGatewayAvailableWafRuleSets API service call. - - :param value: The list of application gateway rule sets. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRuleSet] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, - } - - def __init__( - self, - *, - value: Optional[List["ApplicationGatewayFirewallRuleSet"]] = None, - **kwargs - ): - super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) - self.value = value - - -class ApplicationGatewayBackendAddress(msrest.serialization.Model): - """Backend address of an application gateway. - - :param fqdn: Fully qualified domain name (FQDN). - :type fqdn: str - :param ip_address: IP address. - :type ip_address: str - """ - - _attribute_map = { - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - } - - def __init__( - self, - *, - fqdn: Optional[str] = None, - ip_address: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayBackendAddress, self).__init__(**kwargs) - self.fqdn = fqdn - self.ip_address = ip_address - - -class ApplicationGatewayBackendAddressPool(SubResource): - """Backend Address Pool of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Resource that is unique within a resource group. This name can be used to access - the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param backend_ip_configurations: Collection of references to IPs defined in network - interfaces. - :type backend_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] - :param backend_addresses: Backend addresses. - :type backend_addresses: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddress] - :param provisioning_state: Provisioning state of the backend address pool resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, - 'backend_addresses': {'key': 'properties.backendAddresses', 'type': '[ApplicationGatewayBackendAddress]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - backend_ip_configurations: Optional[List["NetworkInterfaceIPConfiguration"]] = None, - backend_addresses: Optional[List["ApplicationGatewayBackendAddress"]] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayBackendAddressPool, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.backend_ip_configurations = backend_ip_configurations - self.backend_addresses = backend_addresses - self.provisioning_state = provisioning_state - - -class ApplicationGatewayBackendHealth(msrest.serialization.Model): - """List of ApplicationGatewayBackendHealthPool resources. - - :param backend_address_pools: - :type backend_address_pools: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthPool] - """ - - _attribute_map = { - 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[ApplicationGatewayBackendHealthPool]'}, - } - - def __init__( - self, - *, - backend_address_pools: Optional[List["ApplicationGatewayBackendHealthPool"]] = None, - **kwargs - ): - super(ApplicationGatewayBackendHealth, self).__init__(**kwargs) - self.backend_address_pools = backend_address_pools - - -class ApplicationGatewayBackendHealthHttpSettings(msrest.serialization.Model): - """Application gateway BackendHealthHttp settings. - - :param backend_http_settings: Reference of an ApplicationGatewayBackendHttpSettings resource. - :type backend_http_settings: - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHttpSettings - :param servers: List of ApplicationGatewayBackendHealthServer resources. - :type servers: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthServer] - """ - - _attribute_map = { - 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, - 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, - } - - def __init__( - self, - *, - backend_http_settings: Optional["ApplicationGatewayBackendHttpSettings"] = None, - servers: Optional[List["ApplicationGatewayBackendHealthServer"]] = None, - **kwargs - ): - super(ApplicationGatewayBackendHealthHttpSettings, self).__init__(**kwargs) - self.backend_http_settings = backend_http_settings - self.servers = servers - - -class ApplicationGatewayBackendHealthPool(msrest.serialization.Model): - """Application gateway BackendHealth pool. - - :param backend_address_pool: Reference of an ApplicationGatewayBackendAddressPool resource. - :type backend_address_pool: - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddressPool - :param backend_http_settings_collection: List of ApplicationGatewayBackendHealthHttpSettings - resources. - :type backend_http_settings_collection: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthHttpSettings] - """ - - _attribute_map = { - 'backend_address_pool': {'key': 'backendAddressPool', 'type': 'ApplicationGatewayBackendAddressPool'}, - 'backend_http_settings_collection': {'key': 'backendHttpSettingsCollection', 'type': '[ApplicationGatewayBackendHealthHttpSettings]'}, - } - - def __init__( - self, - *, - backend_address_pool: Optional["ApplicationGatewayBackendAddressPool"] = None, - backend_http_settings_collection: Optional[List["ApplicationGatewayBackendHealthHttpSettings"]] = None, - **kwargs - ): - super(ApplicationGatewayBackendHealthPool, self).__init__(**kwargs) - self.backend_address_pool = backend_address_pool - self.backend_http_settings_collection = backend_http_settings_collection - - -class ApplicationGatewayBackendHealthServer(msrest.serialization.Model): - """Application gateway backendhealth http settings. - - :param address: IP address or FQDN of backend server. - :type address: str - :param ip_configuration: Reference of IP configuration of backend server. - :type ip_configuration: ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration - :param health: Health of backend server. Possible values include: "Unknown", "Up", "Down", - "Partial", "Draining". - :type health: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealthServerHealth - """ - - _attribute_map = { - 'address': {'key': 'address', 'type': 'str'}, - 'ip_configuration': {'key': 'ipConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, - 'health': {'key': 'health', 'type': 'str'}, - } - - def __init__( - self, - *, - address: Optional[str] = None, - ip_configuration: Optional["NetworkInterfaceIPConfiguration"] = None, - health: Optional[Union[str, "ApplicationGatewayBackendHealthServerHealth"]] = None, - **kwargs - ): - super(ApplicationGatewayBackendHealthServer, self).__init__(**kwargs) - self.address = address - self.ip_configuration = ip_configuration - self.health = health - - -class ApplicationGatewayBackendHttpSettings(SubResource): - """Backend address pool settings of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param port: Port. - :type port: int - :param protocol: Protocol. Possible values include: "Http", "Https". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProtocol - :param cookie_based_affinity: Cookie based affinity. Possible values include: "Enabled", - "Disabled". - :type cookie_based_affinity: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayCookieBasedAffinity - :param request_timeout: Request timeout in seconds. Application Gateway will fail the request - if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 - seconds. - :type request_timeout: int - :param probe: Probe resource of an application gateway. - :type probe: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param authentication_certificates: Array of references to application gateway authentication - certificates. - :type authentication_certificates: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param connection_draining: Connection draining of the backend http settings resource. - :type connection_draining: - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayConnectionDraining - :param host_name: Host header to be sent to the backend servers. - :type host_name: str - :param pick_host_name_from_backend_address: Whether to pick host header should be picked from - the host name of the backend server. Default value is false. - :type pick_host_name_from_backend_address: bool - :param affinity_cookie_name: Cookie name to use for the affinity cookie. - :type affinity_cookie_name: str - :param probe_enabled: Whether the probe is enabled. Default value is false. - :type probe_enabled: bool - :param path: Path which should be used as a prefix for all HTTP requests. Null means no path - will be prefixed. Default value is null. - :type path: str - :param provisioning_state: Provisioning state of the backend http settings resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'port': {'key': 'properties.port', 'type': 'int'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'cookie_based_affinity': {'key': 'properties.cookieBasedAffinity', 'type': 'str'}, - 'request_timeout': {'key': 'properties.requestTimeout', 'type': 'int'}, - 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, - 'authentication_certificates': {'key': 'properties.authenticationCertificates', 'type': '[SubResource]'}, - 'connection_draining': {'key': 'properties.connectionDraining', 'type': 'ApplicationGatewayConnectionDraining'}, - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'pick_host_name_from_backend_address': {'key': 'properties.pickHostNameFromBackendAddress', 'type': 'bool'}, - 'affinity_cookie_name': {'key': 'properties.affinityCookieName', 'type': 'str'}, - 'probe_enabled': {'key': 'properties.probeEnabled', 'type': 'bool'}, - 'path': {'key': 'properties.path', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - port: Optional[int] = None, - protocol: Optional[Union[str, "ApplicationGatewayProtocol"]] = None, - cookie_based_affinity: Optional[Union[str, "ApplicationGatewayCookieBasedAffinity"]] = None, - request_timeout: Optional[int] = None, - probe: Optional["SubResource"] = None, - authentication_certificates: Optional[List["SubResource"]] = None, - connection_draining: Optional["ApplicationGatewayConnectionDraining"] = None, - host_name: Optional[str] = None, - pick_host_name_from_backend_address: Optional[bool] = None, - affinity_cookie_name: Optional[str] = None, - probe_enabled: Optional[bool] = None, - path: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayBackendHttpSettings, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.port = port - self.protocol = protocol - self.cookie_based_affinity = cookie_based_affinity - self.request_timeout = request_timeout - self.probe = probe - self.authentication_certificates = authentication_certificates - self.connection_draining = connection_draining - self.host_name = host_name - self.pick_host_name_from_backend_address = pick_host_name_from_backend_address - self.affinity_cookie_name = affinity_cookie_name - self.probe_enabled = probe_enabled - self.path = path - self.provisioning_state = provisioning_state - - -class ApplicationGatewayConnectionDraining(msrest.serialization.Model): - """Connection draining allows open connections to a backend server to be active for a specified time after the backend server got removed from the configuration. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether connection draining is enabled or not. - :type enabled: bool - :param drain_timeout_in_sec: Required. The number of seconds connection draining is active. - Acceptable values are from 1 second to 3600 seconds. - :type drain_timeout_in_sec: int - """ - - _validation = { - 'enabled': {'required': True}, - 'drain_timeout_in_sec': {'required': True, 'maximum': 3600, 'minimum': 1}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'drain_timeout_in_sec': {'key': 'drainTimeoutInSec', 'type': 'int'}, - } - - def __init__( - self, - *, - enabled: bool, - drain_timeout_in_sec: int, - **kwargs - ): - super(ApplicationGatewayConnectionDraining, self).__init__(**kwargs) - self.enabled = enabled - self.drain_timeout_in_sec = drain_timeout_in_sec - - -class ApplicationGatewayFirewallDisabledRuleGroup(msrest.serialization.Model): - """Allows to disable rules within a rule group or an entire rule group. - - All required parameters must be populated in order to send to Azure. - - :param rule_group_name: Required. The name of the rule group that will be disabled. - :type rule_group_name: str - :param rules: The list of rules that will be disabled. If null, all rules of the rule group - will be disabled. - :type rules: list[int] - """ - - _validation = { - 'rule_group_name': {'required': True}, - } - - _attribute_map = { - 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[int]'}, - } - - def __init__( - self, - *, - rule_group_name: str, - rules: Optional[List[int]] = None, - **kwargs - ): - super(ApplicationGatewayFirewallDisabledRuleGroup, self).__init__(**kwargs) - self.rule_group_name = rule_group_name - self.rules = rules - - -class ApplicationGatewayFirewallRule(msrest.serialization.Model): - """A web application firewall rule. - - All required parameters must be populated in order to send to Azure. - - :param rule_id: Required. The identifier of the web application firewall rule. - :type rule_id: int - :param description: The description of the web application firewall rule. - :type description: str - """ - - _validation = { - 'rule_id': {'required': True}, - } - - _attribute_map = { - 'rule_id': {'key': 'ruleId', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - rule_id: int, - description: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayFirewallRule, self).__init__(**kwargs) - self.rule_id = rule_id - self.description = description - - -class ApplicationGatewayFirewallRuleGroup(msrest.serialization.Model): - """A web application firewall rule group. - - All required parameters must be populated in order to send to Azure. - - :param rule_group_name: Required. The name of the web application firewall rule group. - :type rule_group_name: str - :param description: The description of the web application firewall rule group. - :type description: str - :param rules: Required. The rules of the web application firewall rule group. - :type rules: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRule] - """ - - _validation = { - 'rule_group_name': {'required': True}, - 'rules': {'required': True}, - } - - _attribute_map = { - 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'rules': {'key': 'rules', 'type': '[ApplicationGatewayFirewallRule]'}, - } - - def __init__( - self, - *, - rule_group_name: str, - rules: List["ApplicationGatewayFirewallRule"], - description: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayFirewallRuleGroup, self).__init__(**kwargs) - self.rule_group_name = rule_group_name - self.description = description - self.rules = rules - - -class ApplicationGatewayFirewallRuleSet(Resource): - """A web application firewall rule set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param provisioning_state: The provisioning state of the web application firewall rule set. - :type provisioning_state: str - :param rule_set_type: The type of the web application firewall rule set. - :type rule_set_type: str - :param rule_set_version: The version of the web application firewall rule set type. - :type rule_set_version: str - :param rule_groups: The rule groups of the web application firewall rule set. - :type rule_groups: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRuleGroup] - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'rule_set_type': {'key': 'properties.ruleSetType', 'type': 'str'}, - 'rule_set_version': {'key': 'properties.ruleSetVersion', 'type': 'str'}, - 'rule_groups': {'key': 'properties.ruleGroups', 'type': '[ApplicationGatewayFirewallRuleGroup]'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - provisioning_state: Optional[str] = None, - rule_set_type: Optional[str] = None, - rule_set_version: Optional[str] = None, - rule_groups: Optional[List["ApplicationGatewayFirewallRuleGroup"]] = None, - **kwargs - ): - super(ApplicationGatewayFirewallRuleSet, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.provisioning_state = provisioning_state - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.rule_groups = rule_groups - - -class ApplicationGatewayFrontendIPConfiguration(SubResource): - """Frontend IP configuration of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param private_ip_address: PrivateIPAddress of the network interface IP Configuration. - :type private_ip_address: str - :param private_ip_allocation_method: PrivateIP allocation method. Possible values include: - "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param subnet: Reference of the subnet resource. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param public_ip_address: Reference of the PublicIP resource. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Provisioning state of the public IP resource. Possible values are: - 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - private_ip_address: Optional[str] = None, - private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, - subnet: Optional["SubResource"] = None, - public_ip_address: Optional["SubResource"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayFrontendIPConfiguration, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - - -class ApplicationGatewayFrontendPort(SubResource): - """Frontend port of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param port: Frontend port. - :type port: int - :param provisioning_state: Provisioning state of the frontend port resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'port': {'key': 'properties.port', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - port: Optional[int] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayFrontendPort, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.port = port - self.provisioning_state = provisioning_state - - -class ApplicationGatewayHttpListener(SubResource): - """Http listener of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param frontend_ip_configuration: Frontend IP configuration resource of an application gateway. - :type frontend_ip_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param frontend_port: Frontend port resource of an application gateway. - :type frontend_port: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param protocol: Protocol. Possible values include: "Http", "Https". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProtocol - :param host_name: Host name of HTTP listener. - :type host_name: str - :param ssl_certificate: SSL certificate resource of an application gateway. - :type ssl_certificate: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param require_server_name_indication: Applicable only if protocol is https. Enables SNI for - multi-hosting. - :type require_server_name_indication: bool - :param provisioning_state: Provisioning state of the HTTP listener resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, - 'frontend_port': {'key': 'properties.frontendPort', 'type': 'SubResource'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'host_name': {'key': 'properties.hostName', 'type': 'str'}, - 'ssl_certificate': {'key': 'properties.sslCertificate', 'type': 'SubResource'}, - 'require_server_name_indication': {'key': 'properties.requireServerNameIndication', 'type': 'bool'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - frontend_ip_configuration: Optional["SubResource"] = None, - frontend_port: Optional["SubResource"] = None, - protocol: Optional[Union[str, "ApplicationGatewayProtocol"]] = None, - host_name: Optional[str] = None, - ssl_certificate: Optional["SubResource"] = None, - require_server_name_indication: Optional[bool] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayHttpListener, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.frontend_ip_configuration = frontend_ip_configuration - self.frontend_port = frontend_port - self.protocol = protocol - self.host_name = host_name - self.ssl_certificate = ssl_certificate - self.require_server_name_indication = require_server_name_indication - self.provisioning_state = provisioning_state - - -class ApplicationGatewayIPConfiguration(SubResource): - """IP configuration of an application gateway. Currently 1 public and 1 private IP configuration is allowed. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param subnet: Reference of the subnet resource. A subnet from where application gateway gets - its private address. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Provisioning state of the application gateway subnet resource. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - subnet: Optional["SubResource"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayIPConfiguration, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.subnet = subnet - self.provisioning_state = provisioning_state - - -class ApplicationGatewayListResult(msrest.serialization.Model): - """Response for ListApplicationGateways API service call. - - :param value: List of an application gateways in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGateway] - :param next_link: URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationGateway]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ApplicationGateway"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ApplicationGatewayPathRule(SubResource): - """Path rule of URL path map of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param paths: Path rules of URL path map. - :type paths: list[str] - :param backend_address_pool: Backend address pool resource of URL path map path rule. - :type backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param backend_http_settings: Backend http settings resource of URL path map path rule. - :type backend_http_settings: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param redirect_configuration: Redirect configuration resource of URL path map path rule. - :type redirect_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Path rule of URL path map resource. Possible values are: 'Updating', - 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'paths': {'key': 'properties.paths', 'type': '[str]'}, - 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, - 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, - 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - paths: Optional[List[str]] = None, - backend_address_pool: Optional["SubResource"] = None, - backend_http_settings: Optional["SubResource"] = None, - redirect_configuration: Optional["SubResource"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayPathRule, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.paths = paths - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - - -class ApplicationGatewayProbe(SubResource): - """Probe of the application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param protocol: Protocol. Possible values include: "Http", "Https". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProtocol - :param host: Host name to send the probe to. - :type host: str - :param path: Relative path of probe. Valid path starts from '/'. Probe is sent to - :code:``://:code:``::code:``:code:``. - :type path: str - :param interval: The probing interval in seconds. This is the time interval between two - consecutive probes. Acceptable values are from 1 second to 86400 seconds. - :type interval: int - :param timeout: the probe timeout in seconds. Probe marked as failed if valid response is not - received with this timeout period. Acceptable values are from 1 second to 86400 seconds. - :type timeout: int - :param unhealthy_threshold: The probe retry count. Backend server is marked down after - consecutive probe failure count reaches UnhealthyThreshold. Acceptable values are from 1 second - to 20. - :type unhealthy_threshold: int - :param pick_host_name_from_backend_http_settings: Whether the host header should be picked from - the backend http settings. Default value is false. - :type pick_host_name_from_backend_http_settings: bool - :param min_servers: Minimum number of servers that are always marked healthy. Default value is - 0. - :type min_servers: int - :param match: Criterion for classifying a healthy probe response. - :type match: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayProbeHealthResponseMatch - :param provisioning_state: Provisioning state of the backend http settings resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'host': {'key': 'properties.host', 'type': 'str'}, - 'path': {'key': 'properties.path', 'type': 'str'}, - 'interval': {'key': 'properties.interval', 'type': 'int'}, - 'timeout': {'key': 'properties.timeout', 'type': 'int'}, - 'unhealthy_threshold': {'key': 'properties.unhealthyThreshold', 'type': 'int'}, - 'pick_host_name_from_backend_http_settings': {'key': 'properties.pickHostNameFromBackendHttpSettings', 'type': 'bool'}, - 'min_servers': {'key': 'properties.minServers', 'type': 'int'}, - 'match': {'key': 'properties.match', 'type': 'ApplicationGatewayProbeHealthResponseMatch'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - protocol: Optional[Union[str, "ApplicationGatewayProtocol"]] = None, - host: Optional[str] = None, - path: Optional[str] = None, - interval: Optional[int] = None, - timeout: Optional[int] = None, - unhealthy_threshold: Optional[int] = None, - pick_host_name_from_backend_http_settings: Optional[bool] = None, - min_servers: Optional[int] = None, - match: Optional["ApplicationGatewayProbeHealthResponseMatch"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayProbe, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.protocol = protocol - self.host = host - self.path = path - self.interval = interval - self.timeout = timeout - self.unhealthy_threshold = unhealthy_threshold - self.pick_host_name_from_backend_http_settings = pick_host_name_from_backend_http_settings - self.min_servers = min_servers - self.match = match - self.provisioning_state = provisioning_state - - -class ApplicationGatewayProbeHealthResponseMatch(msrest.serialization.Model): - """Application gateway probe health response match. - - :param body: Body that must be contained in the health response. Default value is empty. - :type body: str - :param status_codes: Allowed ranges of healthy status codes. Default range of healthy status - codes is 200-399. - :type status_codes: list[str] - """ - - _attribute_map = { - 'body': {'key': 'body', 'type': 'str'}, - 'status_codes': {'key': 'statusCodes', 'type': '[str]'}, - } - - def __init__( - self, - *, - body: Optional[str] = None, - status_codes: Optional[List[str]] = None, - **kwargs - ): - super(ApplicationGatewayProbeHealthResponseMatch, self).__init__(**kwargs) - self.body = body - self.status_codes = status_codes - - -class ApplicationGatewayRedirectConfiguration(SubResource): - """Redirect configuration of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param redirect_type: Supported http redirection types - Permanent, Temporary, Found, SeeOther. - Possible values include: "Permanent", "Found", "SeeOther", "Temporary". - :type redirect_type: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRedirectType - :param target_listener: Reference to a listener to redirect the request to. - :type target_listener: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param target_url: Url to redirect the request to. - :type target_url: str - :param include_path: Include path in the redirected url. - :type include_path: bool - :param include_query_string: Include query string in the redirected url. - :type include_query_string: bool - :param request_routing_rules: Request routing specifying redirect configuration. - :type request_routing_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param url_path_maps: Url path maps specifying default redirect configuration. - :type url_path_maps: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param path_rules: Path rules specifying redirect configuration. - :type path_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'redirect_type': {'key': 'properties.redirectType', 'type': 'str'}, - 'target_listener': {'key': 'properties.targetListener', 'type': 'SubResource'}, - 'target_url': {'key': 'properties.targetUrl', 'type': 'str'}, - 'include_path': {'key': 'properties.includePath', 'type': 'bool'}, - 'include_query_string': {'key': 'properties.includeQueryString', 'type': 'bool'}, - 'request_routing_rules': {'key': 'properties.requestRoutingRules', 'type': '[SubResource]'}, - 'url_path_maps': {'key': 'properties.urlPathMaps', 'type': '[SubResource]'}, - 'path_rules': {'key': 'properties.pathRules', 'type': '[SubResource]'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - redirect_type: Optional[Union[str, "ApplicationGatewayRedirectType"]] = None, - target_listener: Optional["SubResource"] = None, - target_url: Optional[str] = None, - include_path: Optional[bool] = None, - include_query_string: Optional[bool] = None, - request_routing_rules: Optional[List["SubResource"]] = None, - url_path_maps: Optional[List["SubResource"]] = None, - path_rules: Optional[List["SubResource"]] = None, - **kwargs - ): - super(ApplicationGatewayRedirectConfiguration, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.redirect_type = redirect_type - self.target_listener = target_listener - self.target_url = target_url - self.include_path = include_path - self.include_query_string = include_query_string - self.request_routing_rules = request_routing_rules - self.url_path_maps = url_path_maps - self.path_rules = path_rules - - -class ApplicationGatewayRequestRoutingRule(SubResource): - """Request routing rule of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param rule_type: Rule type. Possible values include: "Basic", "PathBasedRouting". - :type rule_type: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayRequestRoutingRuleType - :param backend_address_pool: Backend address pool resource of the application gateway. - :type backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param backend_http_settings: Frontend port resource of the application gateway. - :type backend_http_settings: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param http_listener: Http listener resource of the application gateway. - :type http_listener: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param url_path_map: URL path map resource of the application gateway. - :type url_path_map: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param redirect_configuration: Redirect configuration resource of the application gateway. - :type redirect_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Provisioning state of the request routing rule resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'rule_type': {'key': 'properties.ruleType', 'type': 'str'}, - 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, - 'backend_http_settings': {'key': 'properties.backendHttpSettings', 'type': 'SubResource'}, - 'http_listener': {'key': 'properties.httpListener', 'type': 'SubResource'}, - 'url_path_map': {'key': 'properties.urlPathMap', 'type': 'SubResource'}, - 'redirect_configuration': {'key': 'properties.redirectConfiguration', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - rule_type: Optional[Union[str, "ApplicationGatewayRequestRoutingRuleType"]] = None, - backend_address_pool: Optional["SubResource"] = None, - backend_http_settings: Optional["SubResource"] = None, - http_listener: Optional["SubResource"] = None, - url_path_map: Optional["SubResource"] = None, - redirect_configuration: Optional["SubResource"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayRequestRoutingRule, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.rule_type = rule_type - self.backend_address_pool = backend_address_pool - self.backend_http_settings = backend_http_settings - self.http_listener = http_listener - self.url_path_map = url_path_map - self.redirect_configuration = redirect_configuration - self.provisioning_state = provisioning_state - - -class ApplicationGatewaySku(msrest.serialization.Model): - """SKU of an application gateway. - - :param name: Name of an application gateway SKU. Possible values include: "Standard_Small", - "Standard_Medium", "Standard_Large", "WAF_Medium", "WAF_Large". - :type name: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySkuName - :param tier: Tier of an application gateway. Possible values include: "Standard", "WAF". - :type tier: str or ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayTier - :param capacity: Capacity (instance count) of an application gateway. - :type capacity: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: Optional[Union[str, "ApplicationGatewaySkuName"]] = None, - tier: Optional[Union[str, "ApplicationGatewayTier"]] = None, - capacity: Optional[int] = None, - **kwargs - ): - super(ApplicationGatewaySku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.capacity = capacity - - -class ApplicationGatewaySslCertificate(SubResource): - """SSL certificates of an application gateway. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param data: Base-64 encoded pfx certificate. Only applicable in PUT Request. - :type data: str - :param password: Password for the pfx file specified in data. Only applicable in PUT request. - :type password: str - :param public_cert_data: Base-64 encoded Public cert data corresponding to pfx specified in - data. Only applicable in GET request. - :type public_cert_data: str - :param provisioning_state: Provisioning state of the SSL certificate resource Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'data': {'key': 'properties.data', 'type': 'str'}, - 'password': {'key': 'properties.password', 'type': 'str'}, - 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - data: Optional[str] = None, - password: Optional[str] = None, - public_cert_data: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewaySslCertificate, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.data = data - self.password = password - self.public_cert_data = public_cert_data - self.provisioning_state = provisioning_state - - -class ApplicationGatewaySslPolicy(msrest.serialization.Model): - """Application Gateway Ssl policy. - - :param disabled_ssl_protocols: Ssl protocols to be disabled on application gateway. - :type disabled_ssl_protocols: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol] - :param policy_type: Type of Ssl Policy. Possible values include: "Predefined", "Custom". - :type policy_type: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicyType - :param policy_name: Name of Ssl predefined policy. Possible values include: - "AppGwSslPolicy20150501", "AppGwSslPolicy20170401", "AppGwSslPolicy20170401S". - :type policy_name: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPolicyName - :param cipher_suites: Ssl cipher suites to be enabled in the specified order to application - gateway. - :type cipher_suites: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCipherSuite] - :param min_protocol_version: Minimum version of Ssl protocol to be supported on application - gateway. Possible values include: "TLSv1_0", "TLSv1_1", "TLSv1_2". - :type min_protocol_version: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol - """ - - _attribute_map = { - 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, - 'policy_type': {'key': 'policyType', 'type': 'str'}, - 'policy_name': {'key': 'policyName', 'type': 'str'}, - 'cipher_suites': {'key': 'cipherSuites', 'type': '[str]'}, - 'min_protocol_version': {'key': 'minProtocolVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - disabled_ssl_protocols: Optional[List[Union[str, "ApplicationGatewaySslProtocol"]]] = None, - policy_type: Optional[Union[str, "ApplicationGatewaySslPolicyType"]] = None, - policy_name: Optional[Union[str, "ApplicationGatewaySslPolicyName"]] = None, - cipher_suites: Optional[List[Union[str, "ApplicationGatewaySslCipherSuite"]]] = None, - min_protocol_version: Optional[Union[str, "ApplicationGatewaySslProtocol"]] = None, - **kwargs - ): - super(ApplicationGatewaySslPolicy, self).__init__(**kwargs) - self.disabled_ssl_protocols = disabled_ssl_protocols - self.policy_type = policy_type - self.policy_name = policy_name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version - - -class ApplicationGatewaySslPredefinedPolicy(SubResource): - """An Ssl predefined policy. - - :param id: Resource ID. - :type id: str - :param name: Name of Ssl predefined policy. - :type name: str - :param cipher_suites: Ssl cipher suites to be enabled in the specified order for application - gateway. - :type cipher_suites: list[str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslCipherSuite] - :param min_protocol_version: Minimum version of Ssl protocol to be supported on application - gateway. Possible values include: "TLSv1_0", "TLSv1_1", "TLSv1_2". - :type min_protocol_version: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslProtocol - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, - 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - cipher_suites: Optional[List[Union[str, "ApplicationGatewaySslCipherSuite"]]] = None, - min_protocol_version: Optional[Union[str, "ApplicationGatewaySslProtocol"]] = None, - **kwargs - ): - super(ApplicationGatewaySslPredefinedPolicy, self).__init__(id=id, **kwargs) - self.name = name - self.cipher_suites = cipher_suites - self.min_protocol_version = min_protocol_version - - -class ApplicationGatewayUrlPathMap(SubResource): - """UrlPathMaps give a url path to the backend mapping information for PathBasedRouting. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param type: Type of the resource. - :type type: str - :param default_backend_address_pool: Default backend address pool resource of URL path map. - :type default_backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param default_backend_http_settings: Default backend http settings resource of URL path map. - :type default_backend_http_settings: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param default_redirect_configuration: Default redirect configuration resource of URL path map. - :type default_redirect_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param path_rules: Path rule of URL path map resource. - :type path_rules: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayPathRule] - :param provisioning_state: Provisioning state of the backend http settings resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'default_backend_address_pool': {'key': 'properties.defaultBackendAddressPool', 'type': 'SubResource'}, - 'default_backend_http_settings': {'key': 'properties.defaultBackendHttpSettings', 'type': 'SubResource'}, - 'default_redirect_configuration': {'key': 'properties.defaultRedirectConfiguration', 'type': 'SubResource'}, - 'path_rules': {'key': 'properties.pathRules', 'type': '[ApplicationGatewayPathRule]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - type: Optional[str] = None, - default_backend_address_pool: Optional["SubResource"] = None, - default_backend_http_settings: Optional["SubResource"] = None, - default_redirect_configuration: Optional["SubResource"] = None, - path_rules: Optional[List["ApplicationGatewayPathRule"]] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ApplicationGatewayUrlPathMap, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.type = type - self.default_backend_address_pool = default_backend_address_pool - self.default_backend_http_settings = default_backend_http_settings - self.default_redirect_configuration = default_redirect_configuration - self.path_rules = path_rules - self.provisioning_state = provisioning_state - - -class ApplicationGatewayWebApplicationFirewallConfiguration(msrest.serialization.Model): - """Application gateway web application firewall configuration. - - All required parameters must be populated in order to send to Azure. - - :param enabled: Required. Whether the web application firewall is enabled or not. - :type enabled: bool - :param firewall_mode: Required. Web application firewall mode. Possible values include: - "Detection", "Prevention". - :type firewall_mode: str or - ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallMode - :param rule_set_type: Required. The type of the web application firewall rule set. Possible - values are: 'OWASP'. - :type rule_set_type: str - :param rule_set_version: Required. The version of the rule set type. - :type rule_set_version: str - :param disabled_rule_groups: The disabled rule groups. - :type disabled_rule_groups: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallDisabledRuleGroup] - """ - - _validation = { - 'enabled': {'required': True}, - 'firewall_mode': {'required': True}, - 'rule_set_type': {'required': True}, - 'rule_set_version': {'required': True}, - } - - _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'firewall_mode': {'key': 'firewallMode', 'type': 'str'}, - 'rule_set_type': {'key': 'ruleSetType', 'type': 'str'}, - 'rule_set_version': {'key': 'ruleSetVersion', 'type': 'str'}, - 'disabled_rule_groups': {'key': 'disabledRuleGroups', 'type': '[ApplicationGatewayFirewallDisabledRuleGroup]'}, - } - - def __init__( - self, - *, - enabled: bool, - firewall_mode: Union[str, "ApplicationGatewayFirewallMode"], - rule_set_type: str, - rule_set_version: str, - disabled_rule_groups: Optional[List["ApplicationGatewayFirewallDisabledRuleGroup"]] = None, - **kwargs - ): - super(ApplicationGatewayWebApplicationFirewallConfiguration, self).__init__(**kwargs) - self.enabled = enabled - self.firewall_mode = firewall_mode - self.rule_set_type = rule_set_type - self.rule_set_version = rule_set_version - self.disabled_rule_groups = disabled_rule_groups - - -class AuthorizationListResult(msrest.serialization.Model): - """Response for ListAuthorizations API service call retrieves all authorizations that belongs to an ExpressRouteCircuit. - - :param value: The authorizations in an ExpressRoute Circuit. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitAuthorization]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ExpressRouteCircuitAuthorization"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(AuthorizationListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class AzureAsyncOperationResult(msrest.serialization.Model): - """The response body contains the status of the specified asynchronous operation, indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the response body includes the HTTP status code for the successful request. If the asynchronous operation failed, the response body includes the HTTP status code for the failed request and error information regarding the failure. - - :param status: Status of the Azure async operation. Possible values are: 'InProgress', - 'Succeeded', and 'Failed'. Possible values include: "InProgress", "Succeeded", "Failed". - :type status: str or ~azure.mgmt.network.v2017_08_01.models.NetworkOperationStatus - :param error: - :type error: ~azure.mgmt.network.v2017_08_01.models.Error - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'Error'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "NetworkOperationStatus"]] = None, - error: Optional["Error"] = None, - **kwargs - ): - super(AzureAsyncOperationResult, self).__init__(**kwargs) - self.status = status - self.error = error - - -class BackendAddressPool(SubResource): - """Pool of backend IP addresses. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :ivar backend_ip_configurations: Gets collection of references to IP addresses defined in - network interfaces. - :vartype backend_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] - :ivar load_balancing_rules: Gets load balancing rules that use this backend address pool. - :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :ivar outbound_nat_rule: Gets outbound rules that use this backend address pool. - :vartype outbound_nat_rule: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Get provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'backend_ip_configurations': {'readonly': True}, - 'load_balancing_rules': {'readonly': True}, - 'outbound_nat_rule': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'backend_ip_configurations': {'key': 'properties.backendIPConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, - 'outbound_nat_rule': {'key': 'properties.outboundNatRule', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(BackendAddressPool, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.backend_ip_configurations = None - self.load_balancing_rules = None - self.outbound_nat_rule = None - self.provisioning_state = provisioning_state - - -class BGPCommunity(msrest.serialization.Model): - """Contains bgp community information offered in Service Community resources. - - :param service_supported_region: The region which the service support. e.g. For O365, region is - Global. - :type service_supported_region: str - :param community_name: The name of the bgp community. e.g. Skype. - :type community_name: str - :param community_value: The value of the bgp community. For more information: - https://docs.microsoft.com/en-us/azure/expressroute/expressroute-routing. - :type community_value: str - :param community_prefixes: The prefixes that the bgp community contains. - :type community_prefixes: list[str] - :param is_authorized_to_use: Customer is authorized to use bgp community or not. - :type is_authorized_to_use: bool - :param service_group: The service group of the bgp community contains. - :type service_group: str - """ - - _attribute_map = { - 'service_supported_region': {'key': 'serviceSupportedRegion', 'type': 'str'}, - 'community_name': {'key': 'communityName', 'type': 'str'}, - 'community_value': {'key': 'communityValue', 'type': 'str'}, - 'community_prefixes': {'key': 'communityPrefixes', 'type': '[str]'}, - 'is_authorized_to_use': {'key': 'isAuthorizedToUse', 'type': 'bool'}, - 'service_group': {'key': 'serviceGroup', 'type': 'str'}, - } - - def __init__( - self, - *, - service_supported_region: Optional[str] = None, - community_name: Optional[str] = None, - community_value: Optional[str] = None, - community_prefixes: Optional[List[str]] = None, - is_authorized_to_use: Optional[bool] = None, - service_group: Optional[str] = None, - **kwargs - ): - super(BGPCommunity, self).__init__(**kwargs) - self.service_supported_region = service_supported_region - self.community_name = community_name - self.community_value = community_value - self.community_prefixes = community_prefixes - self.is_authorized_to_use = is_authorized_to_use - self.service_group = service_group - - -class BgpPeerStatus(msrest.serialization.Model): - """BGP peer status details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar local_address: The virtual network gateway's local address. - :vartype local_address: str - :ivar neighbor: The remote BGP peer. - :vartype neighbor: str - :ivar asn: The autonomous system number of the remote BGP peer. - :vartype asn: int - :ivar state: The BGP peer state. Possible values include: "Unknown", "Stopped", "Idle", - "Connecting", "Connected". - :vartype state: str or ~azure.mgmt.network.v2017_08_01.models.BgpPeerState - :ivar connected_duration: For how long the peering has been up. - :vartype connected_duration: str - :ivar routes_received: The number of routes learned from this peer. - :vartype routes_received: long - :ivar messages_sent: The number of BGP messages sent. - :vartype messages_sent: long - :ivar messages_received: The number of BGP messages received. - :vartype messages_received: long - """ - - _validation = { - 'local_address': {'readonly': True}, - 'neighbor': {'readonly': True}, - 'asn': {'readonly': True}, - 'state': {'readonly': True}, - 'connected_duration': {'readonly': True}, - 'routes_received': {'readonly': True}, - 'messages_sent': {'readonly': True}, - 'messages_received': {'readonly': True}, - } - - _attribute_map = { - 'local_address': {'key': 'localAddress', 'type': 'str'}, - 'neighbor': {'key': 'neighbor', 'type': 'str'}, - 'asn': {'key': 'asn', 'type': 'int'}, - 'state': {'key': 'state', 'type': 'str'}, - 'connected_duration': {'key': 'connectedDuration', 'type': 'str'}, - 'routes_received': {'key': 'routesReceived', 'type': 'long'}, - 'messages_sent': {'key': 'messagesSent', 'type': 'long'}, - 'messages_received': {'key': 'messagesReceived', 'type': 'long'}, - } - - def __init__( - self, - **kwargs - ): - super(BgpPeerStatus, self).__init__(**kwargs) - self.local_address = None - self.neighbor = None - self.asn = None - self.state = None - self.connected_duration = None - self.routes_received = None - self.messages_sent = None - self.messages_received = None - - -class BgpPeerStatusListResult(msrest.serialization.Model): - """Response for list BGP peer status API service call. - - :param value: List of BGP peers. - :type value: list[~azure.mgmt.network.v2017_08_01.models.BgpPeerStatus] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[BgpPeerStatus]'}, - } - - def __init__( - self, - *, - value: Optional[List["BgpPeerStatus"]] = None, - **kwargs - ): - super(BgpPeerStatusListResult, self).__init__(**kwargs) - self.value = value - - -class BgpServiceCommunity(Resource): - """Service Community Properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param service_name: The name of the bgp community. e.g. Skype. - :type service_name: str - :param bgp_communities: Get a list of bgp communities. - :type bgp_communities: list[~azure.mgmt.network.v2017_08_01.models.BGPCommunity] - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'service_name': {'key': 'properties.serviceName', 'type': 'str'}, - 'bgp_communities': {'key': 'properties.bgpCommunities', 'type': '[BGPCommunity]'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - service_name: Optional[str] = None, - bgp_communities: Optional[List["BGPCommunity"]] = None, - **kwargs - ): - super(BgpServiceCommunity, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.service_name = service_name - self.bgp_communities = bgp_communities - - -class BgpServiceCommunityListResult(msrest.serialization.Model): - """Response for the ListServiceCommunity API service call. - - :param value: A list of service community resources. - :type value: list[~azure.mgmt.network.v2017_08_01.models.BgpServiceCommunity] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[BgpServiceCommunity]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["BgpServiceCommunity"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(BgpServiceCommunityListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class BgpSettings(msrest.serialization.Model): - """BGP settings details. - - :param asn: The BGP speaker's ASN. - :type asn: long - :param bgp_peering_address: The BGP peering address and BGP identifier of this BGP speaker. - :type bgp_peering_address: str - :param peer_weight: The weight added to routes learned from this BGP speaker. - :type peer_weight: int - """ - - _attribute_map = { - 'asn': {'key': 'asn', 'type': 'long'}, - 'bgp_peering_address': {'key': 'bgpPeeringAddress', 'type': 'str'}, - 'peer_weight': {'key': 'peerWeight', 'type': 'int'}, - } - - def __init__( - self, - *, - asn: Optional[int] = None, - bgp_peering_address: Optional[str] = None, - peer_weight: Optional[int] = None, - **kwargs - ): - super(BgpSettings, self).__init__(**kwargs) - self.asn = asn - self.bgp_peering_address = bgp_peering_address - self.peer_weight = peer_weight - - -class ConnectionResetSharedKey(msrest.serialization.Model): - """The virtual network connection reset shared key. - - All required parameters must be populated in order to send to Azure. - - :param key_length: Required. The virtual network connection reset shared key length, should - between 1 and 128. - :type key_length: int - """ - - _validation = { - 'key_length': {'required': True, 'maximum': 128, 'minimum': 1}, - } - - _attribute_map = { - 'key_length': {'key': 'keyLength', 'type': 'int'}, - } - - def __init__( - self, - *, - key_length: int, - **kwargs - ): - super(ConnectionResetSharedKey, self).__init__(**kwargs) - self.key_length = key_length - - -class ConnectionSharedKey(msrest.serialization.Model): - """Response for GetConnectionSharedKey API service call. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. The virtual network connection shared key value. - :type value: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - *, - value: str, - **kwargs - ): - super(ConnectionSharedKey, self).__init__(**kwargs) - self.value = value - - -class ConnectivityDestination(msrest.serialization.Model): - """Parameters that define destination of connection. - - :param resource_id: The ID of the resource to which a connection attempt will be made. - :type resource_id: str - :param address: The IP address or URI the resource to which a connection attempt will be made. - :type address: str - :param port: Port on which check connectivity will be performed. - :type port: int - """ - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - address: Optional[str] = None, - port: Optional[int] = None, - **kwargs - ): - super(ConnectivityDestination, self).__init__(**kwargs) - self.resource_id = resource_id - self.address = address - self.port = port - - -class ConnectivityHop(msrest.serialization.Model): - """Information about a hop between the source and the destination. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The type of the hop. - :vartype type: str - :ivar id: The ID of the hop. - :vartype id: str - :ivar address: The IP address of the hop. - :vartype address: str - :ivar resource_id: The ID of the resource corresponding to this hop. - :vartype resource_id: str - :ivar next_hop_ids: List of next hop identifiers. - :vartype next_hop_ids: list[str] - :ivar issues: List of issues. - :vartype issues: list[~azure.mgmt.network.v2017_08_01.models.ConnectivityIssue] - """ - - _validation = { - 'type': {'readonly': True}, - 'id': {'readonly': True}, - 'address': {'readonly': True}, - 'resource_id': {'readonly': True}, - 'next_hop_ids': {'readonly': True}, - 'issues': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'next_hop_ids': {'key': 'nextHopIds', 'type': '[str]'}, - 'issues': {'key': 'issues', 'type': '[ConnectivityIssue]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectivityHop, self).__init__(**kwargs) - self.type = None - self.id = None - self.address = None - self.resource_id = None - self.next_hop_ids = None - self.issues = None - - -class ConnectivityInformation(msrest.serialization.Model): - """Information on the connectivity status. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar hops: List of hops between the source and the destination. - :vartype hops: list[~azure.mgmt.network.v2017_08_01.models.ConnectivityHop] - :ivar connection_status: The connection status. Possible values include: "Unknown", - "Connected", "Disconnected", "Degraded". - :vartype connection_status: str or ~azure.mgmt.network.v2017_08_01.models.ConnectionStatus - :ivar avg_latency_in_ms: Average latency in milliseconds. - :vartype avg_latency_in_ms: int - :ivar min_latency_in_ms: Minimum latency in milliseconds. - :vartype min_latency_in_ms: int - :ivar max_latency_in_ms: Maximum latency in milliseconds. - :vartype max_latency_in_ms: int - :ivar probes_sent: Total number of probes sent. - :vartype probes_sent: int - :ivar probes_failed: Number of failed probes. - :vartype probes_failed: int - """ - - _validation = { - 'hops': {'readonly': True}, - 'connection_status': {'readonly': True}, - 'avg_latency_in_ms': {'readonly': True}, - 'min_latency_in_ms': {'readonly': True}, - 'max_latency_in_ms': {'readonly': True}, - 'probes_sent': {'readonly': True}, - 'probes_failed': {'readonly': True}, - } - - _attribute_map = { - 'hops': {'key': 'hops', 'type': '[ConnectivityHop]'}, - 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, - 'avg_latency_in_ms': {'key': 'avgLatencyInMs', 'type': 'int'}, - 'min_latency_in_ms': {'key': 'minLatencyInMs', 'type': 'int'}, - 'max_latency_in_ms': {'key': 'maxLatencyInMs', 'type': 'int'}, - 'probes_sent': {'key': 'probesSent', 'type': 'int'}, - 'probes_failed': {'key': 'probesFailed', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectivityInformation, self).__init__(**kwargs) - self.hops = None - self.connection_status = None - self.avg_latency_in_ms = None - self.min_latency_in_ms = None - self.max_latency_in_ms = None - self.probes_sent = None - self.probes_failed = None - - -class ConnectivityIssue(msrest.serialization.Model): - """Information about an issue encountered in the process of checking for connectivity. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the issue. Possible values include: "Local", "Inbound", "Outbound". - :vartype origin: str or ~azure.mgmt.network.v2017_08_01.models.Origin - :ivar severity: The severity of the issue. Possible values include: "Error", "Warning". - :vartype severity: str or ~azure.mgmt.network.v2017_08_01.models.Severity - :ivar type: The type of issue. Possible values include: "Unknown", "AgentStopped", - "GuestFirewall", "DnsResolution", "SocketBind", "NetworkSecurityRule", "UserDefinedRoute", - "PortThrottled", "Platform". - :vartype type: str or ~azure.mgmt.network.v2017_08_01.models.IssueType - :ivar context: Provides additional context on the issue. - :vartype context: list[dict[str, str]] - """ - - _validation = { - 'origin': {'readonly': True}, - 'severity': {'readonly': True}, - 'type': {'readonly': True}, - 'context': {'readonly': True}, - } - - _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'severity': {'key': 'severity', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'context': {'key': 'context', 'type': '[{str}]'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectivityIssue, self).__init__(**kwargs) - self.origin = None - self.severity = None - self.type = None - self.context = None - - -class ConnectivityParameters(msrest.serialization.Model): - """Parameters that determine how the connectivity check will be performed. - - All required parameters must be populated in order to send to Azure. - - :param source: Required. Parameters that define the source of the connection. - :type source: ~azure.mgmt.network.v2017_08_01.models.ConnectivitySource - :param destination: Required. Parameters that define destination of connection. - :type destination: ~azure.mgmt.network.v2017_08_01.models.ConnectivityDestination - """ - - _validation = { - 'source': {'required': True}, - 'destination': {'required': True}, - } - - _attribute_map = { - 'source': {'key': 'source', 'type': 'ConnectivitySource'}, - 'destination': {'key': 'destination', 'type': 'ConnectivityDestination'}, - } - - def __init__( - self, - *, - source: "ConnectivitySource", - destination: "ConnectivityDestination", - **kwargs - ): - super(ConnectivityParameters, self).__init__(**kwargs) - self.source = source - self.destination = destination - - -class ConnectivitySource(msrest.serialization.Model): - """Parameters that define the source of the connection. - - All required parameters must be populated in order to send to Azure. - - :param resource_id: Required. The ID of the resource from which a connectivity check will be - initiated. - :type resource_id: str - :param port: The source port from which a connectivity check will be performed. - :type port: int - """ - - _validation = { - 'resource_id': {'required': True}, - } - - _attribute_map = { - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'port': {'key': 'port', 'type': 'int'}, - } - - def __init__( - self, - *, - resource_id: str, - port: Optional[int] = None, - **kwargs - ): - super(ConnectivitySource, self).__init__(**kwargs) - self.resource_id = resource_id - self.port = port - - -class DhcpOptions(msrest.serialization.Model): - """DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options. - - :param dns_servers: The list of DNS servers IP addresses. - :type dns_servers: list[str] - """ - - _attribute_map = { - 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, - } - - def __init__( - self, - *, - dns_servers: Optional[List[str]] = None, - **kwargs - ): - super(DhcpOptions, self).__init__(**kwargs) - self.dns_servers = dns_servers - - -class DnsNameAvailabilityResult(msrest.serialization.Model): - """Response for the CheckDnsNameAvailability API service call. - - :param available: Domain availability (True/False). - :type available: bool - """ - - _attribute_map = { - 'available': {'key': 'available', 'type': 'bool'}, - } - - def __init__( - self, - *, - available: Optional[bool] = None, - **kwargs - ): - super(DnsNameAvailabilityResult, self).__init__(**kwargs) - self.available = available - - -class EffectiveNetworkSecurityGroup(msrest.serialization.Model): - """Effective network security group. - - :param network_security_group: The ID of network security group that is applied. - :type network_security_group: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param association: Associated resources. - :type association: - ~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroupAssociation - :param effective_security_rules: A collection of effective security rules. - :type effective_security_rules: - list[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityRule] - :param tag_map: Mapping of tags to list of IP Addresses included within the tag. - :type tag_map: str - """ - - _attribute_map = { - 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'SubResource'}, - 'association': {'key': 'association', 'type': 'EffectiveNetworkSecurityGroupAssociation'}, - 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, - 'tag_map': {'key': 'tagMap', 'type': 'str'}, - } - - def __init__( - self, - *, - network_security_group: Optional["SubResource"] = None, - association: Optional["EffectiveNetworkSecurityGroupAssociation"] = None, - effective_security_rules: Optional[List["EffectiveNetworkSecurityRule"]] = None, - tag_map: Optional[str] = None, - **kwargs - ): - super(EffectiveNetworkSecurityGroup, self).__init__(**kwargs) - self.network_security_group = network_security_group - self.association = association - self.effective_security_rules = effective_security_rules - self.tag_map = tag_map - - -class EffectiveNetworkSecurityGroupAssociation(msrest.serialization.Model): - """The effective network security group association. - - :param subnet: The ID of the subnet if assigned. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param network_interface: The ID of the network interface if assigned. - :type network_interface: ~azure.mgmt.network.v2017_08_01.models.SubResource - """ - - _attribute_map = { - 'subnet': {'key': 'subnet', 'type': 'SubResource'}, - 'network_interface': {'key': 'networkInterface', 'type': 'SubResource'}, - } - - def __init__( - self, - *, - subnet: Optional["SubResource"] = None, - network_interface: Optional["SubResource"] = None, - **kwargs - ): - super(EffectiveNetworkSecurityGroupAssociation, self).__init__(**kwargs) - self.subnet = subnet - self.network_interface = network_interface - - -class EffectiveNetworkSecurityGroupListResult(msrest.serialization.Model): - """Response for list effective network security groups API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of effective network security groups. - :type value: list[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroup] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EffectiveNetworkSecurityGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["EffectiveNetworkSecurityGroup"]] = None, - **kwargs - ): - super(EffectiveNetworkSecurityGroupListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class EffectiveNetworkSecurityRule(msrest.serialization.Model): - """Effective network security rules. - - :param name: The name of the security rule specified by the user (if created by the user). - :type name: str - :param protocol: The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', - and 'All'. Possible values include: "Tcp", "Udp", "All". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.EffectiveSecurityRuleProtocol - :param source_port_range: The source port or range. - :type source_port_range: str - :param destination_port_range: The destination port or range. - :type destination_port_range: str - :param source_port_ranges: The source port ranges. Expected values include a single integer - between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - :type source_port_ranges: list[str] - :param destination_port_ranges: The destination port ranges. Expected values include a single - integer between 0 and 65535, a range using '-' as separator (e.g. 100-400), or an asterisk (*). - :type destination_port_ranges: list[str] - :param source_address_prefix: The source address prefix. - :type source_address_prefix: str - :param destination_address_prefix: The destination address prefix. - :type destination_address_prefix: str - :param source_address_prefixes: The source address prefixes. Expected values include CIDR IP - ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and the - asterisk (*). - :type source_address_prefixes: list[str] - :param destination_address_prefixes: The destination address prefixes. Expected values include - CIDR IP ranges, Default Tags (VirtualNetwork, AzureLoadBalancer, Internet), System Tags, and - the asterisk (*). - :type destination_address_prefixes: list[str] - :param expanded_source_address_prefix: The expanded source address prefix. - :type expanded_source_address_prefix: list[str] - :param expanded_destination_address_prefix: Expanded destination address prefix. - :type expanded_destination_address_prefix: list[str] - :param access: Whether network traffic is allowed or denied. Possible values are: 'Allow' and - 'Deny'. Possible values include: "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAccess - :param priority: The priority of the rule. - :type priority: int - :param direction: The direction of the rule. Possible values are: 'Inbound and Outbound'. - Possible values include: "Inbound", "Outbound". - :type direction: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleDirection - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, - 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, - 'source_port_ranges': {'key': 'sourcePortRanges', 'type': '[str]'}, - 'destination_port_ranges': {'key': 'destinationPortRanges', 'type': '[str]'}, - 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, - 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, - 'source_address_prefixes': {'key': 'sourceAddressPrefixes', 'type': '[str]'}, - 'destination_address_prefixes': {'key': 'destinationAddressPrefixes', 'type': '[str]'}, - 'expanded_source_address_prefix': {'key': 'expandedSourceAddressPrefix', 'type': '[str]'}, - 'expanded_destination_address_prefix': {'key': 'expandedDestinationAddressPrefix', 'type': '[str]'}, - 'access': {'key': 'access', 'type': 'str'}, - 'priority': {'key': 'priority', 'type': 'int'}, - 'direction': {'key': 'direction', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - protocol: Optional[Union[str, "EffectiveSecurityRuleProtocol"]] = None, - source_port_range: Optional[str] = None, - destination_port_range: Optional[str] = None, - source_port_ranges: Optional[List[str]] = None, - destination_port_ranges: Optional[List[str]] = None, - source_address_prefix: Optional[str] = None, - destination_address_prefix: Optional[str] = None, - source_address_prefixes: Optional[List[str]] = None, - destination_address_prefixes: Optional[List[str]] = None, - expanded_source_address_prefix: Optional[List[str]] = None, - expanded_destination_address_prefix: Optional[List[str]] = None, - access: Optional[Union[str, "SecurityRuleAccess"]] = None, - priority: Optional[int] = None, - direction: Optional[Union[str, "SecurityRuleDirection"]] = None, - **kwargs - ): - super(EffectiveNetworkSecurityRule, self).__init__(**kwargs) - self.name = name - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.source_address_prefix = source_address_prefix - self.destination_address_prefix = destination_address_prefix - self.source_address_prefixes = source_address_prefixes - self.destination_address_prefixes = destination_address_prefixes - self.expanded_source_address_prefix = expanded_source_address_prefix - self.expanded_destination_address_prefix = expanded_destination_address_prefix - self.access = access - self.priority = priority - self.direction = direction - - -class EffectiveRoute(msrest.serialization.Model): - """Effective Route. - - :param name: The name of the user defined route. This is optional. - :type name: str - :param source: Who created the route. Possible values are: 'Unknown', 'User', - 'VirtualNetworkGateway', and 'Default'. Possible values include: "Unknown", "User", - "VirtualNetworkGateway", "Default". - :type source: str or ~azure.mgmt.network.v2017_08_01.models.EffectiveRouteSource - :param state: The value of effective route. Possible values are: 'Active' and 'Invalid'. - Possible values include: "Active", "Invalid". - :type state: str or ~azure.mgmt.network.v2017_08_01.models.EffectiveRouteState - :param address_prefix: The address prefixes of the effective routes in CIDR notation. - :type address_prefix: list[str] - :param next_hop_ip_address: The IP address of the next hop of the effective route. - :type next_hop_ip_address: list[str] - :param next_hop_type: The type of Azure hop the packet should be sent to. Possible values are: - 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible - values include: "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", "None". - :type next_hop_type: str or ~azure.mgmt.network.v2017_08_01.models.RouteNextHopType - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'source': {'key': 'source', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, - 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]'}, - 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - source: Optional[Union[str, "EffectiveRouteSource"]] = None, - state: Optional[Union[str, "EffectiveRouteState"]] = None, - address_prefix: Optional[List[str]] = None, - next_hop_ip_address: Optional[List[str]] = None, - next_hop_type: Optional[Union[str, "RouteNextHopType"]] = None, - **kwargs - ): - super(EffectiveRoute, self).__init__(**kwargs) - self.name = name - self.source = source - self.state = state - self.address_prefix = address_prefix - self.next_hop_ip_address = next_hop_ip_address - self.next_hop_type = next_hop_type - - -class EffectiveRouteListResult(msrest.serialization.Model): - """Response for list effective route API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of effective routes. - :type value: list[~azure.mgmt.network.v2017_08_01.models.EffectiveRoute] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EffectiveRoute]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["EffectiveRoute"]] = None, - **kwargs - ): - super(EffectiveRouteListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class EndpointServiceResult(SubResource): - """Endpoint service. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Name of the endpoint service. - :vartype name: str - :ivar type: Type of the endpoint service. - :vartype type: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): - super(EndpointServiceResult, self).__init__(id=id, **kwargs) - self.name = None - self.type = None - - -class EndpointServicesListResult(msrest.serialization.Model): - """Response for the ListAvailableEndpointServices API service call. - - :param value: List of available endpoint services in a region. - :type value: list[~azure.mgmt.network.v2017_08_01.models.EndpointServiceResult] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[EndpointServiceResult]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["EndpointServiceResult"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(EndpointServicesListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class Error(msrest.serialization.Model): - """Error. - - :param code: - :type code: str - :param message: - :type message: str - :param target: - :type target: str - :param details: - :type details: list[~azure.mgmt.network.v2017_08_01.models.ErrorDetails] - :param inner_error: - :type inner_error: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetails]'}, - 'inner_error': {'key': 'innerError', 'type': 'str'}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - target: Optional[str] = None, - details: Optional[List["ErrorDetails"]] = None, - inner_error: Optional[str] = None, - **kwargs - ): - super(Error, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - self.inner_error = inner_error - - -class ErrorDetails(msrest.serialization.Model): - """ErrorDetails. - - :param code: - :type code: str - :param target: - :type target: str - :param message: - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - target: Optional[str] = None, - message: Optional[str] = None, - **kwargs - ): - super(ErrorDetails, self).__init__(**kwargs) - self.code = code - self.target = target - self.message = message - - -class ExpressRouteCircuit(Resource): - """ExpressRouteCircuit resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The SKU. - :type sku: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitSku - :ivar etag: Gets a unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param allow_classic_operations: Allow classic operations. - :type allow_classic_operations: bool - :param circuit_provisioning_state: The CircuitProvisioningState state of the resource. - :type circuit_provisioning_state: str - :param service_provider_provisioning_state: The ServiceProviderProvisioningState state of the - resource. Possible values are 'NotProvisioned', 'Provisioning', 'Provisioned', and - 'Deprovisioning'. Possible values include: "NotProvisioned", "Provisioning", "Provisioned", - "Deprovisioning". - :type service_provider_provisioning_state: str or - ~azure.mgmt.network.v2017_08_01.models.ServiceProviderProvisioningState - :param authorizations: The list of authorizations. - :type authorizations: - list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization] - :param peerings: The list of peerings. - :type peerings: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :param service_key: The ServiceKey. - :type service_key: str - :param service_provider_notes: The ServiceProviderNotes. - :type service_provider_notes: str - :param service_provider_properties: The ServiceProviderProperties. - :type service_provider_properties: - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitServiceProviderProperties - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - :param gateway_manager_etag: The GatewayManager Etag. - :type gateway_manager_etag: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'ExpressRouteCircuitSku'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'allow_classic_operations': {'key': 'properties.allowClassicOperations', 'type': 'bool'}, - 'circuit_provisioning_state': {'key': 'properties.circuitProvisioningState', 'type': 'str'}, - 'service_provider_provisioning_state': {'key': 'properties.serviceProviderProvisioningState', 'type': 'str'}, - 'authorizations': {'key': 'properties.authorizations', 'type': '[ExpressRouteCircuitAuthorization]'}, - 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, - 'service_key': {'key': 'properties.serviceKey', 'type': 'str'}, - 'service_provider_notes': {'key': 'properties.serviceProviderNotes', 'type': 'str'}, - 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["ExpressRouteCircuitSku"] = None, - allow_classic_operations: Optional[bool] = None, - circuit_provisioning_state: Optional[str] = None, - service_provider_provisioning_state: Optional[Union[str, "ServiceProviderProvisioningState"]] = None, - authorizations: Optional[List["ExpressRouteCircuitAuthorization"]] = None, - peerings: Optional[List["ExpressRouteCircuitPeering"]] = None, - service_key: Optional[str] = None, - service_provider_notes: Optional[str] = None, - service_provider_properties: Optional["ExpressRouteCircuitServiceProviderProperties"] = None, - provisioning_state: Optional[str] = None, - gateway_manager_etag: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.sku = sku - self.etag = None - self.allow_classic_operations = allow_classic_operations - self.circuit_provisioning_state = circuit_provisioning_state - self.service_provider_provisioning_state = service_provider_provisioning_state - self.authorizations = authorizations - self.peerings = peerings - self.service_key = service_key - self.service_provider_notes = service_provider_notes - self.service_provider_properties = service_provider_properties - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - - -class ExpressRouteCircuitArpTable(msrest.serialization.Model): - """The ARP table associated with the ExpressRouteCircuit. - - :param age: Age. - :type age: int - :param interface: Interface. - :type interface: str - :param ip_address: The IP address. - :type ip_address: str - :param mac_address: The MAC address. - :type mac_address: str - """ - - _attribute_map = { - 'age': {'key': 'age', 'type': 'int'}, - 'interface': {'key': 'interface', 'type': 'str'}, - 'ip_address': {'key': 'ipAddress', 'type': 'str'}, - 'mac_address': {'key': 'macAddress', 'type': 'str'}, - } - - def __init__( - self, - *, - age: Optional[int] = None, - interface: Optional[str] = None, - ip_address: Optional[str] = None, - mac_address: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitArpTable, self).__init__(**kwargs) - self.age = age - self.interface = interface - self.ip_address = ip_address - self.mac_address = mac_address - - -class ExpressRouteCircuitAuthorization(SubResource): - """Authorization in an ExpressRouteCircuit resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param authorization_key: The authorization key. - :type authorization_key: str - :param authorization_use_status: AuthorizationUseStatus. Possible values are: 'Available' and - 'InUse'. Possible values include: "Available", "InUse". - :type authorization_use_status: str or - ~azure.mgmt.network.v2017_08_01.models.AuthorizationUseStatus - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, - 'authorization_use_status': {'key': 'properties.authorizationUseStatus', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - authorization_key: Optional[str] = None, - authorization_use_status: Optional[Union[str, "AuthorizationUseStatus"]] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitAuthorization, self).__init__(id=id, **kwargs) - self.name = name - self.etag = None - self.authorization_key = authorization_key - self.authorization_use_status = authorization_use_status - self.provisioning_state = provisioning_state - - -class ExpressRouteCircuitListResult(msrest.serialization.Model): - """Response for ListExpressRouteCircuit API service call. - - :param value: A list of ExpressRouteCircuits in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuit]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ExpressRouteCircuit"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ExpressRouteCircuitPeering(SubResource): - """Peering in an ExpressRouteCircuit resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param peering_type: The PeeringType. Possible values are: 'AzurePublicPeering', - 'AzurePrivatePeering', and 'MicrosoftPeering'. Possible values include: "AzurePublicPeering", - "AzurePrivatePeering", "MicrosoftPeering". - :type peering_type: str or - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringType - :param state: The state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible - values include: "Disabled", "Enabled". - :type state: str or ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringState - :param azure_asn: The Azure ASN. - :type azure_asn: int - :param peer_asn: The peer ASN. - :type peer_asn: int - :param primary_peer_address_prefix: The primary address prefix. - :type primary_peer_address_prefix: str - :param secondary_peer_address_prefix: The secondary address prefix. - :type secondary_peer_address_prefix: str - :param primary_azure_port: The primary port. - :type primary_azure_port: str - :param secondary_azure_port: The secondary port. - :type secondary_azure_port: str - :param shared_key: The shared key. - :type shared_key: str - :param vlan_id: The VLAN ID. - :type vlan_id: int - :param microsoft_peering_config: The Microsoft peering configuration. - :type microsoft_peering_config: - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringConfig - :param stats: Gets peering stats. - :type stats: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - :param gateway_manager_etag: The GatewayManager Etag. - :type gateway_manager_etag: str - :param last_modified_by: Gets whether the provider or the customer last modified the peering. - :type last_modified_by: str - :param route_filter: The reference of the RouteFilter resource. - :type route_filter: ~azure.mgmt.network.v2017_08_01.models.RouteFilter - :param ipv6_peering_config: The IPv6 peering configuration. - :type ipv6_peering_config: - ~azure.mgmt.network.v2017_08_01.models.Ipv6ExpressRouteCircuitPeeringConfig - """ - - _validation = { - 'etag': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'peering_type': {'key': 'properties.peeringType', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'azure_asn': {'key': 'properties.azureASN', 'type': 'int'}, - 'peer_asn': {'key': 'properties.peerASN', 'type': 'int'}, - 'primary_peer_address_prefix': {'key': 'properties.primaryPeerAddressPrefix', 'type': 'str'}, - 'secondary_peer_address_prefix': {'key': 'properties.secondaryPeerAddressPrefix', 'type': 'str'}, - 'primary_azure_port': {'key': 'properties.primaryAzurePort', 'type': 'str'}, - 'secondary_azure_port': {'key': 'properties.secondaryAzurePort', 'type': 'str'}, - 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, - 'vlan_id': {'key': 'properties.vlanId', 'type': 'int'}, - 'microsoft_peering_config': {'key': 'properties.microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, - 'stats': {'key': 'properties.stats', 'type': 'ExpressRouteCircuitStats'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, - 'last_modified_by': {'key': 'properties.lastModifiedBy', 'type': 'str'}, - 'route_filter': {'key': 'properties.routeFilter', 'type': 'RouteFilter'}, - 'ipv6_peering_config': {'key': 'properties.ipv6PeeringConfig', 'type': 'Ipv6ExpressRouteCircuitPeeringConfig'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - peering_type: Optional[Union[str, "ExpressRouteCircuitPeeringType"]] = None, - state: Optional[Union[str, "ExpressRouteCircuitPeeringState"]] = None, - azure_asn: Optional[int] = None, - peer_asn: Optional[int] = None, - primary_peer_address_prefix: Optional[str] = None, - secondary_peer_address_prefix: Optional[str] = None, - primary_azure_port: Optional[str] = None, - secondary_azure_port: Optional[str] = None, - shared_key: Optional[str] = None, - vlan_id: Optional[int] = None, - microsoft_peering_config: Optional["ExpressRouteCircuitPeeringConfig"] = None, - stats: Optional["ExpressRouteCircuitStats"] = None, - provisioning_state: Optional[str] = None, - gateway_manager_etag: Optional[str] = None, - last_modified_by: Optional[str] = None, - route_filter: Optional["RouteFilter"] = None, - ipv6_peering_config: Optional["Ipv6ExpressRouteCircuitPeeringConfig"] = None, - **kwargs - ): - super(ExpressRouteCircuitPeering, self).__init__(id=id, **kwargs) - self.name = name - self.etag = None - self.peering_type = peering_type - self.state = state - self.azure_asn = azure_asn - self.peer_asn = peer_asn - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.primary_azure_port = primary_azure_port - self.secondary_azure_port = secondary_azure_port - self.shared_key = shared_key - self.vlan_id = vlan_id - self.microsoft_peering_config = microsoft_peering_config - self.stats = stats - self.provisioning_state = provisioning_state - self.gateway_manager_etag = gateway_manager_etag - self.last_modified_by = last_modified_by - self.route_filter = route_filter - self.ipv6_peering_config = ipv6_peering_config - - -class ExpressRouteCircuitPeeringConfig(msrest.serialization.Model): - """Specifies the peering configuration. - - :param advertised_public_prefixes: The reference of AdvertisedPublicPrefixes. - :type advertised_public_prefixes: list[str] - :param advertised_communities: The communities of bgp peering. Specified for microsoft peering. - :type advertised_communities: list[str] - :param advertised_public_prefixes_state: AdvertisedPublicPrefixState of the Peering resource. - Possible values are 'NotConfigured', 'Configuring', 'Configured', and 'ValidationNeeded'. - Possible values include: "NotConfigured", "Configuring", "Configured", "ValidationNeeded". - :type advertised_public_prefixes_state: str or - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringAdvertisedPublicPrefixState - :param legacy_mode: The legacy mode of the peering. - :type legacy_mode: int - :param customer_asn: The CustomerASN of the peering. - :type customer_asn: int - :param routing_registry_name: The RoutingRegistryName of the configuration. - :type routing_registry_name: str - """ - - _attribute_map = { - 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, - 'advertised_communities': {'key': 'advertisedCommunities', 'type': '[str]'}, - 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, - 'legacy_mode': {'key': 'legacyMode', 'type': 'int'}, - 'customer_asn': {'key': 'customerASN', 'type': 'int'}, - 'routing_registry_name': {'key': 'routingRegistryName', 'type': 'str'}, - } - - def __init__( - self, - *, - advertised_public_prefixes: Optional[List[str]] = None, - advertised_communities: Optional[List[str]] = None, - advertised_public_prefixes_state: Optional[Union[str, "ExpressRouteCircuitPeeringAdvertisedPublicPrefixState"]] = None, - legacy_mode: Optional[int] = None, - customer_asn: Optional[int] = None, - routing_registry_name: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) - self.advertised_public_prefixes = advertised_public_prefixes - self.advertised_communities = advertised_communities - self.advertised_public_prefixes_state = advertised_public_prefixes_state - self.legacy_mode = legacy_mode - self.customer_asn = customer_asn - self.routing_registry_name = routing_registry_name - - -class ExpressRouteCircuitPeeringListResult(msrest.serialization.Model): - """Response for ListPeering API service call retrieves all peerings that belong to an ExpressRouteCircuit. - - :param value: The peerings in an express route circuit. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitPeering]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ExpressRouteCircuitPeering"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitPeeringListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ExpressRouteCircuitRoutesTable(msrest.serialization.Model): - """The routes table associated with the ExpressRouteCircuit. - - :param network: network. - :type network: str - :param next_hop: nextHop. - :type next_hop: str - :param loc_prf: locPrf. - :type loc_prf: str - :param weight: weight. - :type weight: int - :param path: path. - :type path: str - """ - - _attribute_map = { - 'network': {'key': 'network', 'type': 'str'}, - 'next_hop': {'key': 'nextHop', 'type': 'str'}, - 'loc_prf': {'key': 'locPrf', 'type': 'str'}, - 'weight': {'key': 'weight', 'type': 'int'}, - 'path': {'key': 'path', 'type': 'str'}, - } - - def __init__( - self, - *, - network: Optional[str] = None, - next_hop: Optional[str] = None, - loc_prf: Optional[str] = None, - weight: Optional[int] = None, - path: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitRoutesTable, self).__init__(**kwargs) - self.network = network - self.next_hop = next_hop - self.loc_prf = loc_prf - self.weight = weight - self.path = path - - -class ExpressRouteCircuitRoutesTableSummary(msrest.serialization.Model): - """The routes table associated with the ExpressRouteCircuit. - - :param neighbor: Neighbor. - :type neighbor: str - :param v: BGP version number spoken to the neighbor. - :type v: int - :param as_property: Autonomous system number. - :type as_property: int - :param up_down: The length of time that the BGP session has been in the Established state, or - the current status if not in the Established state. - :type up_down: str - :param state_pfx_rcd: Current state of the BGP session, and the number of prefixes that have - been received from a neighbor or peer group. - :type state_pfx_rcd: str - """ - - _attribute_map = { - 'neighbor': {'key': 'neighbor', 'type': 'str'}, - 'v': {'key': 'v', 'type': 'int'}, - 'as_property': {'key': 'as', 'type': 'int'}, - 'up_down': {'key': 'upDown', 'type': 'str'}, - 'state_pfx_rcd': {'key': 'statePfxRcd', 'type': 'str'}, - } - - def __init__( - self, - *, - neighbor: Optional[str] = None, - v: Optional[int] = None, - as_property: Optional[int] = None, - up_down: Optional[str] = None, - state_pfx_rcd: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitRoutesTableSummary, self).__init__(**kwargs) - self.neighbor = neighbor - self.v = v - self.as_property = as_property - self.up_down = up_down - self.state_pfx_rcd = state_pfx_rcd - - -class ExpressRouteCircuitsArpTableListResult(msrest.serialization.Model): - """Response for ListArpTable associated with the Express Route Circuits API. - - :param value: Gets list of the ARP table. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitArpTable] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitArpTable]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ExpressRouteCircuitArpTable"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitsArpTableListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ExpressRouteCircuitServiceProviderProperties(msrest.serialization.Model): - """Contains ServiceProviderProperties in an ExpressRouteCircuit. - - :param service_provider_name: The serviceProviderName. - :type service_provider_name: str - :param peering_location: The peering location. - :type peering_location: str - :param bandwidth_in_mbps: The BandwidthInMbps. - :type bandwidth_in_mbps: int - """ - - _attribute_map = { - 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, - 'peering_location': {'key': 'peeringLocation', 'type': 'str'}, - 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, - } - - def __init__( - self, - *, - service_provider_name: Optional[str] = None, - peering_location: Optional[str] = None, - bandwidth_in_mbps: Optional[int] = None, - **kwargs - ): - super(ExpressRouteCircuitServiceProviderProperties, self).__init__(**kwargs) - self.service_provider_name = service_provider_name - self.peering_location = peering_location - self.bandwidth_in_mbps = bandwidth_in_mbps - - -class ExpressRouteCircuitSku(msrest.serialization.Model): - """Contains SKU in an ExpressRouteCircuit. - - :param name: The name of the SKU. - :type name: str - :param tier: The tier of the SKU. Possible values are 'Standard' and 'Premium'. Possible values - include: "Standard", "Premium". - :type tier: str or ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitSkuTier - :param family: The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. - Possible values include: "UnlimitedData", "MeteredData". - :type family: str or ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitSkuFamily - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - tier: Optional[Union[str, "ExpressRouteCircuitSkuTier"]] = None, - family: Optional[Union[str, "ExpressRouteCircuitSkuFamily"]] = None, - **kwargs - ): - super(ExpressRouteCircuitSku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.family = family - - -class ExpressRouteCircuitsRoutesTableListResult(msrest.serialization.Model): - """Response for ListRoutesTable associated with the Express Route Circuits API. - - :param value: The list of routes table. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitRoutesTable] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTable]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ExpressRouteCircuitRoutesTable"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitsRoutesTableListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ExpressRouteCircuitsRoutesTableSummaryListResult(msrest.serialization.Model): - """Response for ListRoutesTable associated with the Express Route Circuits API. - - :param value: A list of the routes table. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitRoutesTableSummary] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteCircuitRoutesTableSummary]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ExpressRouteCircuitRoutesTableSummary"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(ExpressRouteCircuitsRoutesTableSummaryListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ExpressRouteCircuitStats(msrest.serialization.Model): - """Contains stats associated with the peering. - - :param primarybytes_in: Gets BytesIn of the peering. - :type primarybytes_in: long - :param primarybytes_out: Gets BytesOut of the peering. - :type primarybytes_out: long - :param secondarybytes_in: Gets BytesIn of the peering. - :type secondarybytes_in: long - :param secondarybytes_out: Gets BytesOut of the peering. - :type secondarybytes_out: long - """ - - _attribute_map = { - 'primarybytes_in': {'key': 'primarybytesIn', 'type': 'long'}, - 'primarybytes_out': {'key': 'primarybytesOut', 'type': 'long'}, - 'secondarybytes_in': {'key': 'secondarybytesIn', 'type': 'long'}, - 'secondarybytes_out': {'key': 'secondarybytesOut', 'type': 'long'}, - } - - def __init__( - self, - *, - primarybytes_in: Optional[int] = None, - primarybytes_out: Optional[int] = None, - secondarybytes_in: Optional[int] = None, - secondarybytes_out: Optional[int] = None, - **kwargs - ): - super(ExpressRouteCircuitStats, self).__init__(**kwargs) - self.primarybytes_in = primarybytes_in - self.primarybytes_out = primarybytes_out - self.secondarybytes_in = secondarybytes_in - self.secondarybytes_out = secondarybytes_out - - -class ExpressRouteServiceProvider(Resource): - """A ExpressRouteResourceProvider object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param peering_locations: Get a list of peering locations. - :type peering_locations: list[str] - :param bandwidths_offered: Gets bandwidths offered. - :type bandwidths_offered: - list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteServiceProviderBandwidthsOffered] - :param provisioning_state: Gets the provisioning state of the resource. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'peering_locations': {'key': 'properties.peeringLocations', 'type': '[str]'}, - 'bandwidths_offered': {'key': 'properties.bandwidthsOffered', 'type': '[ExpressRouteServiceProviderBandwidthsOffered]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - peering_locations: Optional[List[str]] = None, - bandwidths_offered: Optional[List["ExpressRouteServiceProviderBandwidthsOffered"]] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ExpressRouteServiceProvider, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.peering_locations = peering_locations - self.bandwidths_offered = bandwidths_offered - self.provisioning_state = provisioning_state - - -class ExpressRouteServiceProviderBandwidthsOffered(msrest.serialization.Model): - """Contains bandwidths offered in ExpressRouteServiceProvider resources. - - :param offer_name: The OfferName. - :type offer_name: str - :param value_in_mbps: The ValueInMbps. - :type value_in_mbps: int - """ - - _attribute_map = { - 'offer_name': {'key': 'offerName', 'type': 'str'}, - 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, - } - - def __init__( - self, - *, - offer_name: Optional[str] = None, - value_in_mbps: Optional[int] = None, - **kwargs - ): - super(ExpressRouteServiceProviderBandwidthsOffered, self).__init__(**kwargs) - self.offer_name = offer_name - self.value_in_mbps = value_in_mbps - - -class ExpressRouteServiceProviderListResult(msrest.serialization.Model): - """Response for the ListExpressRouteServiceProvider API service call. - - :param value: A list of ExpressRouteResourceProvider resources. - :type value: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteServiceProvider] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ExpressRouteServiceProvider]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ExpressRouteServiceProvider"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(ExpressRouteServiceProviderListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class FlowLogInformation(msrest.serialization.Model): - """Information on the configuration of flow log. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The ID of the resource to configure for flow logging. - :type target_resource_id: str - :param storage_id: Required. ID of the storage account which is used to store the flow log. - :type storage_id: str - :param enabled: Required. Flag to enable/disable flow logging. - :type enabled: bool - :param retention_policy: Parameters that define the retention policy for flow log. - :type retention_policy: ~azure.mgmt.network.v2017_08_01.models.RetentionPolicyParameters - """ - - _validation = { - 'target_resource_id': {'required': True}, - 'storage_id': {'required': True}, - 'enabled': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - 'retention_policy': {'key': 'properties.retentionPolicy', 'type': 'RetentionPolicyParameters'}, - } - - def __init__( - self, - *, - target_resource_id: str, - storage_id: str, - enabled: bool, - retention_policy: Optional["RetentionPolicyParameters"] = None, - **kwargs - ): - super(FlowLogInformation, self).__init__(**kwargs) - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.enabled = enabled - self.retention_policy = retention_policy - - -class FlowLogStatusParameters(msrest.serialization.Model): - """Parameters that define a resource to query flow log status. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The target resource where getting the flow logging status. - :type target_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - target_resource_id: str, - **kwargs - ): - super(FlowLogStatusParameters, self).__init__(**kwargs) - self.target_resource_id = target_resource_id - - -class FrontendIPConfiguration(SubResource): - """Frontend IP address of the load balancer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param zones: A list of availability zones denoting the IP allocated for the resource needs to - come from. - :type zones: list[str] - :ivar inbound_nat_rules: Read only. Inbound rules URIs that use this frontend IP. - :vartype inbound_nat_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :ivar inbound_nat_pools: Read only. Inbound pools URIs that use this frontend IP. - :vartype inbound_nat_pools: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :ivar outbound_nat_rules: Read only. Outbound rules URIs that use this frontend IP. - :vartype outbound_nat_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :ivar load_balancing_rules: Gets load balancing rules URIs that use this frontend IP. - :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param private_ip_address: The private IP address of the IP configuration. - :type private_ip_address: str - :param private_ip_allocation_method: The Private IP allocation method. Possible values are: - 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param subnet: The reference of the subnet resource. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.Subnet - :param public_ip_address: The reference of the Public IP resource. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'inbound_nat_rules': {'readonly': True}, - 'inbound_nat_pools': {'readonly': True}, - 'outbound_nat_rules': {'readonly': True}, - 'load_balancing_rules': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'zones': {'key': 'zones', 'type': '[str]'}, - 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[SubResource]'}, - 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[SubResource]'}, - 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[SubResource]'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, - 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - zones: Optional[List[str]] = None, - private_ip_address: Optional[str] = None, - private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, - subnet: Optional["Subnet"] = None, - public_ip_address: Optional["PublicIPAddress"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(FrontendIPConfiguration, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.zones = zones - self.inbound_nat_rules = None - self.inbound_nat_pools = None - self.outbound_nat_rules = None - self.load_balancing_rules = None - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - - -class GatewayRoute(msrest.serialization.Model): - """Gateway routing details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar local_address: The gateway's local address. - :vartype local_address: str - :ivar network: The route's network prefix. - :vartype network: str - :ivar next_hop: The route's next hop. - :vartype next_hop: str - :ivar source_peer: The peer this route was learned from. - :vartype source_peer: str - :ivar origin: The source this route was learned from. - :vartype origin: str - :ivar as_path: The route's AS path sequence. - :vartype as_path: str - :ivar weight: The route's weight. - :vartype weight: int - """ - - _validation = { - 'local_address': {'readonly': True}, - 'network': {'readonly': True}, - 'next_hop': {'readonly': True}, - 'source_peer': {'readonly': True}, - 'origin': {'readonly': True}, - 'as_path': {'readonly': True}, - 'weight': {'readonly': True}, - } - - _attribute_map = { - 'local_address': {'key': 'localAddress', 'type': 'str'}, - 'network': {'key': 'network', 'type': 'str'}, - 'next_hop': {'key': 'nextHop', 'type': 'str'}, - 'source_peer': {'key': 'sourcePeer', 'type': 'str'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'as_path': {'key': 'asPath', 'type': 'str'}, - 'weight': {'key': 'weight', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(GatewayRoute, self).__init__(**kwargs) - self.local_address = None - self.network = None - self.next_hop = None - self.source_peer = None - self.origin = None - self.as_path = None - self.weight = None - - -class GatewayRouteListResult(msrest.serialization.Model): - """List of virtual network gateway routes. - - :param value: List of gateway routes. - :type value: list[~azure.mgmt.network.v2017_08_01.models.GatewayRoute] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[GatewayRoute]'}, - } - - def __init__( - self, - *, - value: Optional[List["GatewayRoute"]] = None, - **kwargs - ): - super(GatewayRouteListResult, self).__init__(**kwargs) - self.value = value - - -class InboundNatPool(SubResource): - """Inbound NAT pool of the load balancer. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param frontend_ip_configuration: A reference to frontend IP addresses. - :type frontend_ip_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param protocol: The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. - Possible values include: "Udp", "Tcp". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.TransportProtocol - :param frontend_port_range_start: 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. - :type frontend_port_range_start: int - :param frontend_port_range_end: 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. - :type frontend_port_range_end: int - :param backend_port: The port used for internal connections on the endpoint. Acceptable values - are between 1 and 65535. - :type backend_port: int - :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'frontend_port_range_start': {'key': 'properties.frontendPortRangeStart', 'type': 'int'}, - 'frontend_port_range_end': {'key': 'properties.frontendPortRangeEnd', 'type': 'int'}, - 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - frontend_ip_configuration: Optional["SubResource"] = None, - protocol: Optional[Union[str, "TransportProtocol"]] = None, - frontend_port_range_start: Optional[int] = None, - frontend_port_range_end: Optional[int] = None, - backend_port: Optional[int] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(InboundNatPool, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.frontend_ip_configuration = frontend_ip_configuration - self.protocol = protocol - self.frontend_port_range_start = frontend_port_range_start - self.frontend_port_range_end = frontend_port_range_end - self.backend_port = backend_port - self.provisioning_state = provisioning_state - - -class InboundNatRule(SubResource): - """Inbound NAT rule of the load balancer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param frontend_ip_configuration: A reference to frontend IP addresses. - :type frontend_ip_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :ivar backend_ip_configuration: 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 backend IP. - :vartype backend_ip_configuration: - ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration - :param protocol: The transport protocol for the endpoint. Possible values are: 'Udp' or 'Tcp'. - Possible values include: "Udp", "Tcp". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.TransportProtocol - :param frontend_port: 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. - :type frontend_port: int - :param backend_port: The port used for the internal endpoint. Acceptable values range from 1 to - 65535. - :type backend_port: int - :param idle_timeout_in_minutes: 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. - :type idle_timeout_in_minutes: int - :param enable_floating_ip: 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. - :type enable_floating_ip: bool - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'backend_ip_configuration': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, - 'backend_ip_configuration': {'key': 'properties.backendIPConfiguration', 'type': 'NetworkInterfaceIPConfiguration'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, - 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, - 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - frontend_ip_configuration: Optional["SubResource"] = None, - protocol: Optional[Union[str, "TransportProtocol"]] = None, - frontend_port: Optional[int] = None, - backend_port: Optional[int] = None, - idle_timeout_in_minutes: Optional[int] = None, - enable_floating_ip: Optional[bool] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(InboundNatRule, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_ip_configuration = None - self.protocol = protocol - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.provisioning_state = provisioning_state - - -class InboundNatRuleListResult(msrest.serialization.Model): - """Response for ListInboundNatRule API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of inbound nat rules in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[InboundNatRule]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["InboundNatRule"]] = None, - **kwargs - ): - super(InboundNatRuleListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class IPAddressAvailabilityResult(msrest.serialization.Model): - """Response for CheckIPAddressAvailability API service call. - - :param available: Private IP address availability. - :type available: bool - :param available_ip_addresses: Contains other available private IP addresses if the asked for - address is taken. - :type available_ip_addresses: list[str] - """ - - _attribute_map = { - 'available': {'key': 'available', 'type': 'bool'}, - 'available_ip_addresses': {'key': 'availableIPAddresses', 'type': '[str]'}, - } - - def __init__( - self, - *, - available: Optional[bool] = None, - available_ip_addresses: Optional[List[str]] = None, - **kwargs - ): - super(IPAddressAvailabilityResult, self).__init__(**kwargs) - self.available = available - self.available_ip_addresses = available_ip_addresses - - -class IPConfiguration(SubResource): - """IP configuration. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param private_ip_address: The private IP address of the IP configuration. - :type private_ip_address: str - :param private_ip_allocation_method: The private IP allocation method. Possible values are - 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param subnet: The reference of the subnet resource. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.Subnet - :param public_ip_address: The reference of the public IP resource. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - private_ip_address: Optional[str] = None, - private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, - subnet: Optional["Subnet"] = None, - public_ip_address: Optional["PublicIPAddress"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(IPConfiguration, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - - -class IpsecPolicy(msrest.serialization.Model): - """An IPSec Policy configuration for a virtual network gateway connection. - - All required parameters must be populated in order to send to Azure. - - :param sa_life_time_seconds: Required. The IPSec Security Association (also called Quick Mode - or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. - :type sa_life_time_seconds: int - :param sa_data_size_kilobytes: Required. The IPSec Security Association (also called Quick Mode - or Phase 2 SA) payload size in KB for a site to site VPN tunnel. - :type sa_data_size_kilobytes: int - :param ipsec_encryption: Required. The IPSec encryption algorithm (IKE phase 1). Possible - values include: "None", "DES", "DES3", "AES128", "AES192", "AES256", "GCMAES128", "GCMAES192", - "GCMAES256". - :type ipsec_encryption: str or ~azure.mgmt.network.v2017_08_01.models.IpsecEncryption - :param ipsec_integrity: Required. The IPSec integrity algorithm (IKE phase 1). Possible values - include: "MD5", "SHA1", "SHA256", "GCMAES128", "GCMAES192", "GCMAES256". - :type ipsec_integrity: str or ~azure.mgmt.network.v2017_08_01.models.IpsecIntegrity - :param ike_encryption: Required. The IKE encryption algorithm (IKE phase 2). Possible values - include: "DES", "DES3", "AES128", "AES192", "AES256". - :type ike_encryption: str or ~azure.mgmt.network.v2017_08_01.models.IkeEncryption - :param ike_integrity: Required. The IKE integrity algorithm (IKE phase 2). Possible values - include: "MD5", "SHA1", "SHA256", "SHA384". - :type ike_integrity: str or ~azure.mgmt.network.v2017_08_01.models.IkeIntegrity - :param dh_group: Required. The DH Groups used in IKE Phase 1 for initial SA. Possible values - include: "None", "DHGroup1", "DHGroup2", "DHGroup14", "DHGroup2048", "ECP256", "ECP384", - "DHGroup24". - :type dh_group: str or ~azure.mgmt.network.v2017_08_01.models.DhGroup - :param pfs_group: Required. The DH Groups used in IKE Phase 2 for new child SA. Possible values - include: "None", "PFS1", "PFS2", "PFS2048", "ECP256", "ECP384", "PFS24". - :type pfs_group: str or ~azure.mgmt.network.v2017_08_01.models.PfsGroup - """ - - _validation = { - 'sa_life_time_seconds': {'required': True}, - 'sa_data_size_kilobytes': {'required': True}, - 'ipsec_encryption': {'required': True}, - 'ipsec_integrity': {'required': True}, - 'ike_encryption': {'required': True}, - 'ike_integrity': {'required': True}, - 'dh_group': {'required': True}, - 'pfs_group': {'required': True}, - } - - _attribute_map = { - 'sa_life_time_seconds': {'key': 'saLifeTimeSeconds', 'type': 'int'}, - 'sa_data_size_kilobytes': {'key': 'saDataSizeKilobytes', 'type': 'int'}, - 'ipsec_encryption': {'key': 'ipsecEncryption', 'type': 'str'}, - 'ipsec_integrity': {'key': 'ipsecIntegrity', 'type': 'str'}, - 'ike_encryption': {'key': 'ikeEncryption', 'type': 'str'}, - 'ike_integrity': {'key': 'ikeIntegrity', 'type': 'str'}, - 'dh_group': {'key': 'dhGroup', 'type': 'str'}, - 'pfs_group': {'key': 'pfsGroup', 'type': 'str'}, - } - - def __init__( - self, - *, - sa_life_time_seconds: int, - sa_data_size_kilobytes: int, - ipsec_encryption: Union[str, "IpsecEncryption"], - ipsec_integrity: Union[str, "IpsecIntegrity"], - ike_encryption: Union[str, "IkeEncryption"], - ike_integrity: Union[str, "IkeIntegrity"], - dh_group: Union[str, "DhGroup"], - pfs_group: Union[str, "PfsGroup"], - **kwargs - ): - super(IpsecPolicy, self).__init__(**kwargs) - self.sa_life_time_seconds = sa_life_time_seconds - self.sa_data_size_kilobytes = sa_data_size_kilobytes - self.ipsec_encryption = ipsec_encryption - self.ipsec_integrity = ipsec_integrity - self.ike_encryption = ike_encryption - self.ike_integrity = ike_integrity - self.dh_group = dh_group - self.pfs_group = pfs_group - - -class Ipv6ExpressRouteCircuitPeeringConfig(msrest.serialization.Model): - """Contains IPv6 peering config. - - :param primary_peer_address_prefix: The primary address prefix. - :type primary_peer_address_prefix: str - :param secondary_peer_address_prefix: The secondary address prefix. - :type secondary_peer_address_prefix: str - :param microsoft_peering_config: The Microsoft peering configuration. - :type microsoft_peering_config: - ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringConfig - :param route_filter: The reference of the RouteFilter resource. - :type route_filter: ~azure.mgmt.network.v2017_08_01.models.RouteFilter - :param state: The state of peering. Possible values are: 'Disabled' and 'Enabled'. Possible - values include: "Disabled", "Enabled". - :type state: str or ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringState - """ - - _attribute_map = { - 'primary_peer_address_prefix': {'key': 'primaryPeerAddressPrefix', 'type': 'str'}, - 'secondary_peer_address_prefix': {'key': 'secondaryPeerAddressPrefix', 'type': 'str'}, - 'microsoft_peering_config': {'key': 'microsoftPeeringConfig', 'type': 'ExpressRouteCircuitPeeringConfig'}, - 'route_filter': {'key': 'routeFilter', 'type': 'RouteFilter'}, - 'state': {'key': 'state', 'type': 'str'}, - } - - def __init__( - self, - *, - primary_peer_address_prefix: Optional[str] = None, - secondary_peer_address_prefix: Optional[str] = None, - microsoft_peering_config: Optional["ExpressRouteCircuitPeeringConfig"] = None, - route_filter: Optional["RouteFilter"] = None, - state: Optional[Union[str, "ExpressRouteCircuitPeeringState"]] = None, - **kwargs - ): - super(Ipv6ExpressRouteCircuitPeeringConfig, self).__init__(**kwargs) - self.primary_peer_address_prefix = primary_peer_address_prefix - self.secondary_peer_address_prefix = secondary_peer_address_prefix - self.microsoft_peering_config = microsoft_peering_config - self.route_filter = route_filter - self.state = state - - -class LoadBalancer(Resource): - """LoadBalancer resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The load balancer SKU. - :type sku: ~azure.mgmt.network.v2017_08_01.models.LoadBalancerSku - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param frontend_ip_configurations: Object representing the frontend IPs to be used for the load - balancer. - :type frontend_ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.FrontendIPConfiguration] - :param backend_address_pools: Collection of backend address pools used by a load balancer. - :type backend_address_pools: list[~azure.mgmt.network.v2017_08_01.models.BackendAddressPool] - :param load_balancing_rules: Object collection representing the load balancing rules Gets the - provisioning. - :type load_balancing_rules: list[~azure.mgmt.network.v2017_08_01.models.LoadBalancingRule] - :param probes: Collection of probe objects used in the load balancer. - :type probes: list[~azure.mgmt.network.v2017_08_01.models.Probe] - :param inbound_nat_rules: 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. - :type inbound_nat_rules: list[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] - :param inbound_nat_pools: 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. - :type inbound_nat_pools: list[~azure.mgmt.network.v2017_08_01.models.InboundNatPool] - :param outbound_nat_rules: The outbound NAT rules. - :type outbound_nat_rules: list[~azure.mgmt.network.v2017_08_01.models.OutboundNatRule] - :param resource_guid: The resource GUID property of the load balancer resource. - :type resource_guid: str - :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'LoadBalancerSku'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[FrontendIPConfiguration]'}, - 'backend_address_pools': {'key': 'properties.backendAddressPools', 'type': '[BackendAddressPool]'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[LoadBalancingRule]'}, - 'probes': {'key': 'properties.probes', 'type': '[Probe]'}, - 'inbound_nat_rules': {'key': 'properties.inboundNatRules', 'type': '[InboundNatRule]'}, - 'inbound_nat_pools': {'key': 'properties.inboundNatPools', 'type': '[InboundNatPool]'}, - 'outbound_nat_rules': {'key': 'properties.outboundNatRules', 'type': '[OutboundNatRule]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["LoadBalancerSku"] = None, - etag: Optional[str] = None, - frontend_ip_configurations: Optional[List["FrontendIPConfiguration"]] = None, - backend_address_pools: Optional[List["BackendAddressPool"]] = None, - load_balancing_rules: Optional[List["LoadBalancingRule"]] = None, - probes: Optional[List["Probe"]] = None, - inbound_nat_rules: Optional[List["InboundNatRule"]] = None, - inbound_nat_pools: Optional[List["InboundNatPool"]] = None, - outbound_nat_rules: Optional[List["OutboundNatRule"]] = None, - resource_guid: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(LoadBalancer, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.sku = sku - self.etag = etag - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pools = backend_address_pools - self.load_balancing_rules = load_balancing_rules - self.probes = probes - self.inbound_nat_rules = inbound_nat_rules - self.inbound_nat_pools = inbound_nat_pools - self.outbound_nat_rules = outbound_nat_rules - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - - -class LoadBalancerBackendAddressPoolListResult(msrest.serialization.Model): - """Response for ListBackendAddressPool API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of backend address pools in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.BackendAddressPool] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[BackendAddressPool]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["BackendAddressPool"]] = None, - **kwargs - ): - super(LoadBalancerBackendAddressPoolListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class LoadBalancerFrontendIPConfigurationListResult(msrest.serialization.Model): - """Response for ListFrontendIPConfiguration API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of frontend IP configurations in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.FrontendIPConfiguration] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[FrontendIPConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["FrontendIPConfiguration"]] = None, - **kwargs - ): - super(LoadBalancerFrontendIPConfigurationListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class LoadBalancerListResult(msrest.serialization.Model): - """Response for ListLoadBalancers API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of load balancers in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.LoadBalancer] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LoadBalancer]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["LoadBalancer"]] = None, - **kwargs - ): - super(LoadBalancerListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class LoadBalancerLoadBalancingRuleListResult(msrest.serialization.Model): - """Response for ListLoadBalancingRule API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of load balancing rules in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.LoadBalancingRule] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LoadBalancingRule]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["LoadBalancingRule"]] = None, - **kwargs - ): - super(LoadBalancerLoadBalancingRuleListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class LoadBalancerProbeListResult(msrest.serialization.Model): - """Response for ListProbe API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of probes in a load balancer. - :type value: list[~azure.mgmt.network.v2017_08_01.models.Probe] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Probe]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Probe"]] = None, - **kwargs - ): - super(LoadBalancerProbeListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class LoadBalancerSku(msrest.serialization.Model): - """SKU of a load balancer. - - :param name: Name of a load balancer SKU. Possible values include: "Basic", "Standard". - :type name: str or ~azure.mgmt.network.v2017_08_01.models.LoadBalancerSkuName - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[Union[str, "LoadBalancerSkuName"]] = None, - **kwargs - ): - super(LoadBalancerSku, self).__init__(**kwargs) - self.name = name - - -class LoadBalancingRule(SubResource): - """A load balancing rule for a load balancer. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param frontend_ip_configuration: A reference to frontend IP addresses. - :type frontend_ip_configuration: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param backend_address_pool: A reference to a pool of DIPs. Inbound traffic is randomly load - balanced across IPs in the backend IPs. - :type backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param probe: The reference of the load balancer probe used by the load balancing rule. - :type probe: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param protocol: The transport protocol for the external endpoint. Possible values are 'Udp' or - 'Tcp'. Possible values include: "Udp", "Tcp". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.TransportProtocol - :param load_distribution: The load distribution policy for this rule. Possible values are - 'Default', 'SourceIP', and 'SourceIPProtocol'. Possible values include: "Default", "SourceIP", - "SourceIPProtocol". - :type load_distribution: str or ~azure.mgmt.network.v2017_08_01.models.LoadDistribution - :param frontend_port: The port for the external endpoint. Port numbers for each rule must be - unique within the Load Balancer. Acceptable values are between 1 and 65534. - :type frontend_port: int - :param backend_port: The port used for internal connections on the endpoint. Acceptable values - are between 1 and 65535. - :type backend_port: int - :param idle_timeout_in_minutes: 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. - :type idle_timeout_in_minutes: int - :param enable_floating_ip: 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. - :type enable_floating_ip: bool - :param disable_outbound_snat: Configures SNAT for the VMs in the backend pool to use the - publicIP address specified in the frontend of the load balancing rule. - :type disable_outbound_snat: bool - :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'frontend_ip_configuration': {'key': 'properties.frontendIPConfiguration', 'type': 'SubResource'}, - 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, - 'probe': {'key': 'properties.probe', 'type': 'SubResource'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'load_distribution': {'key': 'properties.loadDistribution', 'type': 'str'}, - 'frontend_port': {'key': 'properties.frontendPort', 'type': 'int'}, - 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, - 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, - 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, - 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - frontend_ip_configuration: Optional["SubResource"] = None, - backend_address_pool: Optional["SubResource"] = None, - probe: Optional["SubResource"] = None, - protocol: Optional[Union[str, "TransportProtocol"]] = None, - load_distribution: Optional[Union[str, "LoadDistribution"]] = None, - frontend_port: Optional[int] = None, - backend_port: Optional[int] = None, - idle_timeout_in_minutes: Optional[int] = None, - enable_floating_ip: Optional[bool] = None, - disable_outbound_snat: Optional[bool] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(LoadBalancingRule, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.frontend_ip_configuration = frontend_ip_configuration - self.backend_address_pool = backend_address_pool - self.probe = probe - self.protocol = protocol - self.load_distribution = load_distribution - self.frontend_port = frontend_port - self.backend_port = backend_port - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_floating_ip = enable_floating_ip - self.disable_outbound_snat = disable_outbound_snat - self.provisioning_state = provisioning_state - - -class LocalNetworkGateway(Resource): - """A common class for general resource information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param local_network_address_space: Local network site address space. - :type local_network_address_space: ~azure.mgmt.network.v2017_08_01.models.AddressSpace - :param gateway_ip_address: IP address of local network gateway. - :type gateway_ip_address: str - :param bgp_settings: Local network gateway's BGP speaker settings. - :type bgp_settings: ~azure.mgmt.network.v2017_08_01.models.BgpSettings - :param resource_guid: The resource GUID property of the LocalNetworkGateway resource. - :type resource_guid: str - :ivar provisioning_state: The provisioning state of the LocalNetworkGateway resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'local_network_address_space': {'key': 'properties.localNetworkAddressSpace', 'type': 'AddressSpace'}, - 'gateway_ip_address': {'key': 'properties.gatewayIpAddress', 'type': 'str'}, - 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - local_network_address_space: Optional["AddressSpace"] = None, - gateway_ip_address: Optional[str] = None, - bgp_settings: Optional["BgpSettings"] = None, - resource_guid: Optional[str] = None, - **kwargs - ): - super(LocalNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.local_network_address_space = local_network_address_space - self.gateway_ip_address = gateway_ip_address - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid - self.provisioning_state = None - - -class LocalNetworkGatewayListResult(msrest.serialization.Model): - """Response for ListLocalNetworkGateways API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of local network gateways that exists in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LocalNetworkGateway]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["LocalNetworkGateway"]] = None, - **kwargs - ): - super(LocalNetworkGatewayListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkInterface(Resource): - """A network interface in a resource group. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param virtual_machine: The reference of a virtual machine. - :type virtual_machine: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param network_security_group: The reference of the NetworkSecurityGroup resource. - :type network_security_group: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup - :param ip_configurations: A list of IPConfigurations of the network interface. - :type ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] - :param dns_settings: The DNS settings in network interface. - :type dns_settings: ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceDnsSettings - :param mac_address: The MAC address of the network interface. - :type mac_address: str - :param primary: Gets whether this is a primary network interface on a virtual machine. - :type primary: bool - :param enable_accelerated_networking: If the network interface is accelerated networking - enabled. - :type enable_accelerated_networking: bool - :param enable_ip_forwarding: Indicates whether IP forwarding is enabled on this network - interface. - :type enable_ip_forwarding: bool - :param resource_guid: The resource GUID property of the network interface resource. - :type resource_guid: str - :param provisioning_state: The provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'virtual_machine': {'key': 'properties.virtualMachine', 'type': 'SubResource'}, - 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, - 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[NetworkInterfaceIPConfiguration]'}, - 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'NetworkInterfaceDnsSettings'}, - 'mac_address': {'key': 'properties.macAddress', 'type': 'str'}, - 'primary': {'key': 'properties.primary', 'type': 'bool'}, - 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworking', 'type': 'bool'}, - 'enable_ip_forwarding': {'key': 'properties.enableIPForwarding', 'type': 'bool'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - virtual_machine: Optional["SubResource"] = None, - network_security_group: Optional["NetworkSecurityGroup"] = None, - ip_configurations: Optional[List["NetworkInterfaceIPConfiguration"]] = None, - dns_settings: Optional["NetworkInterfaceDnsSettings"] = None, - mac_address: Optional[str] = None, - primary: Optional[bool] = None, - enable_accelerated_networking: Optional[bool] = None, - enable_ip_forwarding: Optional[bool] = None, - resource_guid: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(NetworkInterface, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.virtual_machine = virtual_machine - self.network_security_group = network_security_group - self.ip_configurations = ip_configurations - self.dns_settings = dns_settings - self.mac_address = mac_address - self.primary = primary - self.enable_accelerated_networking = enable_accelerated_networking - self.enable_ip_forwarding = enable_ip_forwarding - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - - -class NetworkInterfaceAssociation(msrest.serialization.Model): - """Network interface and its custom security rules. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Network interface ID. - :vartype id: str - :param security_rules: Collection of custom security rules. - :type security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, - } - - def __init__( - self, - *, - security_rules: Optional[List["SecurityRule"]] = None, - **kwargs - ): - super(NetworkInterfaceAssociation, self).__init__(**kwargs) - self.id = None - self.security_rules = security_rules - - -class NetworkInterfaceDnsSettings(msrest.serialization.Model): - """DNS settings of a network interface. - - :param dns_servers: 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. - :type dns_servers: list[str] - :param applied_dns_servers: 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. - :type applied_dns_servers: list[str] - :param internal_dns_name_label: Relative DNS name for this NIC used for internal communications - between VMs in the same virtual network. - :type internal_dns_name_label: str - :param internal_fqdn: Fully qualified DNS name supporting internal communications between VMs - in the same virtual network. - :type internal_fqdn: str - :param internal_domain_name_suffix: Even if internalDnsNameLabel is not specified, a DNS entry - is created for the primary NIC of the VM. This DNS name can be constructed by concatenating the - VM name with the value of internalDomainNameSuffix. - :type internal_domain_name_suffix: str - """ - - _attribute_map = { - 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, - 'applied_dns_servers': {'key': 'appliedDnsServers', 'type': '[str]'}, - 'internal_dns_name_label': {'key': 'internalDnsNameLabel', 'type': 'str'}, - 'internal_fqdn': {'key': 'internalFqdn', 'type': 'str'}, - 'internal_domain_name_suffix': {'key': 'internalDomainNameSuffix', 'type': 'str'}, - } - - def __init__( - self, - *, - dns_servers: Optional[List[str]] = None, - applied_dns_servers: Optional[List[str]] = None, - internal_dns_name_label: Optional[str] = None, - internal_fqdn: Optional[str] = None, - internal_domain_name_suffix: Optional[str] = None, - **kwargs - ): - super(NetworkInterfaceDnsSettings, self).__init__(**kwargs) - self.dns_servers = dns_servers - self.applied_dns_servers = applied_dns_servers - self.internal_dns_name_label = internal_dns_name_label - self.internal_fqdn = internal_fqdn - self.internal_domain_name_suffix = internal_domain_name_suffix - - -class NetworkInterfaceIPConfiguration(SubResource): - """IPConfiguration in a network interface. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param application_gateway_backend_address_pools: The reference of - ApplicationGatewayBackendAddressPool resource. - :type application_gateway_backend_address_pools: - list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendAddressPool] - :param load_balancer_backend_address_pools: The reference of LoadBalancerBackendAddressPool - resource. - :type load_balancer_backend_address_pools: - list[~azure.mgmt.network.v2017_08_01.models.BackendAddressPool] - :param load_balancer_inbound_nat_rules: A list of references of LoadBalancerInboundNatRules. - :type load_balancer_inbound_nat_rules: - list[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] - :param private_ip_address: Private IP address of the IP configuration. - :type private_ip_address: str - :param private_ip_allocation_method: Defines how a private IP address is assigned. Possible - values are: 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param private_ip_address_version: 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'. Possible values include: "IPv4", "IPv6". - :type private_ip_address_version: str or ~azure.mgmt.network.v2017_08_01.models.IPVersion - :param subnet: Subnet bound to the IP configuration. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.Subnet - :param primary: Gets whether this is a primary customer address on the network interface. - :type primary: bool - :param public_ip_address: Public IP address bound to the IP configuration. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :param provisioning_state: The provisioning state of the network interface IP configuration. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'application_gateway_backend_address_pools': {'key': 'properties.applicationGatewayBackendAddressPools', 'type': '[ApplicationGatewayBackendAddressPool]'}, - 'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'}, - 'load_balancer_inbound_nat_rules': {'key': 'properties.loadBalancerInboundNatRules', 'type': '[InboundNatRule]'}, - 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'private_ip_address_version': {'key': 'properties.privateIPAddressVersion', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'Subnet'}, - 'primary': {'key': 'properties.primary', 'type': 'bool'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'PublicIPAddress'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - application_gateway_backend_address_pools: Optional[List["ApplicationGatewayBackendAddressPool"]] = None, - load_balancer_backend_address_pools: Optional[List["BackendAddressPool"]] = None, - load_balancer_inbound_nat_rules: Optional[List["InboundNatRule"]] = None, - private_ip_address: Optional[str] = None, - private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, - private_ip_address_version: Optional[Union[str, "IPVersion"]] = None, - subnet: Optional["Subnet"] = None, - primary: Optional[bool] = None, - public_ip_address: Optional["PublicIPAddress"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(NetworkInterfaceIPConfiguration, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.application_gateway_backend_address_pools = application_gateway_backend_address_pools - self.load_balancer_backend_address_pools = load_balancer_backend_address_pools - self.load_balancer_inbound_nat_rules = load_balancer_inbound_nat_rules - self.private_ip_address = private_ip_address - self.private_ip_allocation_method = private_ip_allocation_method - self.private_ip_address_version = private_ip_address_version - self.subnet = subnet - self.primary = primary - self.public_ip_address = public_ip_address - self.provisioning_state = provisioning_state - - -class NetworkInterfaceIPConfigurationListResult(msrest.serialization.Model): - """Response for list ip configurations API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of ip configurations. - :type value: list[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkInterfaceIPConfiguration]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkInterfaceIPConfiguration"]] = None, - **kwargs - ): - super(NetworkInterfaceIPConfigurationListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkInterfaceListResult(msrest.serialization.Model): - """Response for the ListNetworkInterface API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of network interfaces in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.NetworkInterface] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkInterface]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkInterface"]] = None, - **kwargs - ): - super(NetworkInterfaceListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkInterfaceLoadBalancerListResult(msrest.serialization.Model): - """Response for list ip configurations API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: A list of load balancers. - :type value: list[~azure.mgmt.network.v2017_08_01.models.LoadBalancer] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LoadBalancer]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["LoadBalancer"]] = None, - **kwargs - ): - super(NetworkInterfaceLoadBalancerListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkSecurityGroup(Resource): - """NetworkSecurityGroup resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param security_rules: A collection of security rules of the network security group. - :type security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :param default_security_rules: The default security rules of network security group. - :type default_security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :ivar network_interfaces: A collection of references to network interfaces. - :vartype network_interfaces: list[~azure.mgmt.network.v2017_08_01.models.NetworkInterface] - :ivar subnets: A collection of references to subnets. - :vartype subnets: list[~azure.mgmt.network.v2017_08_01.models.Subnet] - :param resource_guid: The resource GUID property of the network security group resource. - :type resource_guid: str - :param provisioning_state: The provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'network_interfaces': {'readonly': True}, - 'subnets': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'security_rules': {'key': 'properties.securityRules', 'type': '[SecurityRule]'}, - 'default_security_rules': {'key': 'properties.defaultSecurityRules', 'type': '[SecurityRule]'}, - 'network_interfaces': {'key': 'properties.networkInterfaces', 'type': '[NetworkInterface]'}, - 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - security_rules: Optional[List["SecurityRule"]] = None, - default_security_rules: Optional[List["SecurityRule"]] = None, - resource_guid: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(NetworkSecurityGroup, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.security_rules = security_rules - self.default_security_rules = default_security_rules - self.network_interfaces = None - self.subnets = None - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - - -class NetworkSecurityGroupListResult(msrest.serialization.Model): - """Response for ListNetworkSecurityGroups API service call. - - :param value: A list of NetworkSecurityGroup resources. - :type value: list[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkSecurityGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkSecurityGroup"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(NetworkSecurityGroupListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class NetworkWatcher(Resource): - """Network watcher in a resource group. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :ivar provisioning_state: The provisioning state of the resource. Possible values include: - "Succeeded", "Updating", "Deleting", "Failed". - :vartype provisioning_state: str or ~azure.mgmt.network.v2017_08_01.models.ProvisioningState - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - **kwargs - ): - super(NetworkWatcher, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.provisioning_state = None - - -class NetworkWatcherListResult(msrest.serialization.Model): - """List of network watcher resources. - - :param value: - :type value: list[~azure.mgmt.network.v2017_08_01.models.NetworkWatcher] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkWatcher]'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkWatcher"]] = None, - **kwargs - ): - super(NetworkWatcherListResult, self).__init__(**kwargs) - self.value = value - - -class NextHopParameters(msrest.serialization.Model): - """Parameters that define the source and destination endpoint. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The resource identifier of the target resource against - which the action is to be performed. - :type target_resource_id: str - :param source_ip_address: Required. The source IP address. - :type source_ip_address: str - :param destination_ip_address: Required. The destination IP address. - :type destination_ip_address: str - :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is - enabled on any of the nics, then this parameter must be specified. Otherwise optional). - :type target_nic_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - 'source_ip_address': {'required': True}, - 'destination_ip_address': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'source_ip_address': {'key': 'sourceIPAddress', 'type': 'str'}, - 'destination_ip_address': {'key': 'destinationIPAddress', 'type': 'str'}, - 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - target_resource_id: str, - source_ip_address: str, - destination_ip_address: str, - target_nic_resource_id: Optional[str] = None, - **kwargs - ): - super(NextHopParameters, self).__init__(**kwargs) - self.target_resource_id = target_resource_id - self.source_ip_address = source_ip_address - self.destination_ip_address = destination_ip_address - self.target_nic_resource_id = target_nic_resource_id - - -class NextHopResult(msrest.serialization.Model): - """The information about next hop from the specified VM. - - :param next_hop_type: Next hop type. Possible values include: "Internet", "VirtualAppliance", - "VirtualNetworkGateway", "VnetLocal", "HyperNetGateway", "None". - :type next_hop_type: str or ~azure.mgmt.network.v2017_08_01.models.NextHopType - :param next_hop_ip_address: Next hop IP Address. - :type next_hop_ip_address: str - :param route_table_id: The resource identifier for the route table associated with the route - being returned. If the route being returned does not correspond to any user created routes then - this field will be the string 'System Route'. - :type route_table_id: str - """ - - _attribute_map = { - 'next_hop_type': {'key': 'nextHopType', 'type': 'str'}, - 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': 'str'}, - 'route_table_id': {'key': 'routeTableId', 'type': 'str'}, - } - - def __init__( - self, - *, - next_hop_type: Optional[Union[str, "NextHopType"]] = None, - next_hop_ip_address: Optional[str] = None, - route_table_id: Optional[str] = None, - **kwargs - ): - super(NextHopResult, self).__init__(**kwargs) - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.route_table_id = route_table_id - - -class OutboundNatRule(SubResource): - """Outbound NAT pool of the load balancer. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param allocated_outbound_ports: The number of outbound ports to be used for NAT. - :type allocated_outbound_ports: int - :param frontend_ip_configurations: The Frontend IP addresses of the load balancer. - :type frontend_ip_configurations: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param backend_address_pool: A reference to a pool of DIPs. Outbound traffic is randomly load - balanced across IPs in the backend IPs. - :type backend_address_pool: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, - 'frontend_ip_configurations': {'key': 'properties.frontendIPConfigurations', 'type': '[SubResource]'}, - 'backend_address_pool': {'key': 'properties.backendAddressPool', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - allocated_outbound_ports: Optional[int] = None, - frontend_ip_configurations: Optional[List["SubResource"]] = None, - backend_address_pool: Optional["SubResource"] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(OutboundNatRule, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.allocated_outbound_ports = allocated_outbound_ports - self.frontend_ip_configurations = frontend_ip_configurations - self.backend_address_pool = backend_address_pool - self.provisioning_state = provisioning_state - - -class PacketCapture(msrest.serialization.Model): - """Parameters that define the create packet capture operation. - - All required parameters must be populated in order to send to Azure. - - :param target: Required. The ID of the targeted resource, only VM is currently supported. - :type target: str - :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes - are truncated. - :type bytes_to_capture_per_packet: int - :param total_bytes_per_session: Maximum size of the capture output. - :type total_bytes_per_session: int - :param time_limit_in_seconds: Maximum duration of the capture session in seconds. - :type time_limit_in_seconds: int - :param storage_location: Required. Describes the storage location for a packet capture session. - :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation - :param filters: - :type filters: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] - """ - - _validation = { - 'target': {'required': True}, - 'storage_location': {'required': True}, - } - - _attribute_map = { - 'target': {'key': 'properties.target', 'type': 'str'}, - 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, - 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, - 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, - 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, - 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, - } - - def __init__( - self, - *, - target: str, - storage_location: "PacketCaptureStorageLocation", - bytes_to_capture_per_packet: Optional[int] = 0, - total_bytes_per_session: Optional[int] = 1073741824, - time_limit_in_seconds: Optional[int] = 18000, - filters: Optional[List["PacketCaptureFilter"]] = None, - **kwargs - ): - super(PacketCapture, self).__init__(**kwargs) - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - - -class PacketCaptureFilter(msrest.serialization.Model): - """Filter that is applied to packet capture request. Multiple filters can be applied. - - :param protocol: Protocol to be filtered on. Possible values include: "TCP", "UDP", "Any". - Default value: "Any". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.PcProtocol - :param local_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single - address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5"? for multiple entries. - Multiple ranges not currently supported. Mixing ranges with multiple entries not currently - supported. Default = null. - :type local_ip_address: str - :param remote_ip_address: Local IP Address to be filtered on. Notation: "127.0.0.1" for single - address entry. "127.0.0.1-127.0.0.255" for range. "127.0.0.1;127.0.0.5;" for multiple entries. - Multiple ranges not currently supported. Mixing ranges with multiple entries not currently - supported. Default = null. - :type remote_ip_address: str - :param local_port: Local port to be filtered on. Notation: "80" for single port entry."80-85" - for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing - ranges with multiple entries not currently supported. Default = null. - :type local_port: str - :param remote_port: Remote port to be filtered on. Notation: "80" for single port entry."80-85" - for range. "80;443;" for multiple entries. Multiple ranges not currently supported. Mixing - ranges with multiple entries not currently supported. Default = null. - :type remote_port: str - """ - - _attribute_map = { - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, - 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, - 'local_port': {'key': 'localPort', 'type': 'str'}, - 'remote_port': {'key': 'remotePort', 'type': 'str'}, - } - - def __init__( - self, - *, - protocol: Optional[Union[str, "PcProtocol"]] = "Any", - local_ip_address: Optional[str] = None, - remote_ip_address: Optional[str] = None, - local_port: Optional[str] = None, - remote_port: Optional[str] = None, - **kwargs - ): - super(PacketCaptureFilter, self).__init__(**kwargs) - self.protocol = protocol - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.local_port = local_port - self.remote_port = remote_port - - -class PacketCaptureListResult(msrest.serialization.Model): - """List of packet capture sessions. - - :param value: Information about packet capture sessions. - :type value: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PacketCaptureResult]'}, - } - - def __init__( - self, - *, - value: Optional[List["PacketCaptureResult"]] = None, - **kwargs - ): - super(PacketCaptureListResult, self).__init__(**kwargs) - self.value = value - - -class PacketCaptureParameters(msrest.serialization.Model): - """Parameters that define the create packet capture operation. - - All required parameters must be populated in order to send to Azure. - - :param target: Required. The ID of the targeted resource, only VM is currently supported. - :type target: str - :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes - are truncated. - :type bytes_to_capture_per_packet: int - :param total_bytes_per_session: Maximum size of the capture output. - :type total_bytes_per_session: int - :param time_limit_in_seconds: Maximum duration of the capture session in seconds. - :type time_limit_in_seconds: int - :param storage_location: Required. Describes the storage location for a packet capture session. - :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation - :param filters: - :type filters: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] - """ - - _validation = { - 'target': {'required': True}, - 'storage_location': {'required': True}, - } - - _attribute_map = { - 'target': {'key': 'target', 'type': 'str'}, - 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, - 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, - 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, - 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, - 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, - } - - def __init__( - self, - *, - target: str, - storage_location: "PacketCaptureStorageLocation", - bytes_to_capture_per_packet: Optional[int] = 0, - total_bytes_per_session: Optional[int] = 1073741824, - time_limit_in_seconds: Optional[int] = 18000, - filters: Optional[List["PacketCaptureFilter"]] = None, - **kwargs - ): - super(PacketCaptureParameters, self).__init__(**kwargs) - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - - -class PacketCaptureQueryStatusResult(msrest.serialization.Model): - """Status of packet capture session. - - :param name: The name of the packet capture resource. - :type name: str - :param id: The ID of the packet capture resource. - :type id: str - :param capture_start_time: The start time of the packet capture session. - :type capture_start_time: ~datetime.datetime - :param packet_capture_status: The status of the packet capture session. Possible values - include: "NotStarted", "Running", "Stopped", "Error", "Unknown". - :type packet_capture_status: str or ~azure.mgmt.network.v2017_08_01.models.PcStatus - :param stop_reason: The reason the current packet capture session was stopped. - :type stop_reason: str - :param packet_capture_error: List of errors of packet capture session. - :type packet_capture_error: list[str or ~azure.mgmt.network.v2017_08_01.models.PcError] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'capture_start_time': {'key': 'captureStartTime', 'type': 'iso-8601'}, - 'packet_capture_status': {'key': 'packetCaptureStatus', 'type': 'str'}, - 'stop_reason': {'key': 'stopReason', 'type': 'str'}, - 'packet_capture_error': {'key': 'packetCaptureError', 'type': '[str]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - id: Optional[str] = None, - capture_start_time: Optional[datetime.datetime] = None, - packet_capture_status: Optional[Union[str, "PcStatus"]] = None, - stop_reason: Optional[str] = None, - packet_capture_error: Optional[List[Union[str, "PcError"]]] = None, - **kwargs - ): - super(PacketCaptureQueryStatusResult, self).__init__(**kwargs) - self.name = name - self.id = id - self.capture_start_time = capture_start_time - self.packet_capture_status = packet_capture_status - self.stop_reason = stop_reason - self.packet_capture_error = packet_capture_error - - -class PacketCaptureResult(msrest.serialization.Model): - """Information about packet capture session. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the packet capture session. - :vartype name: str - :ivar id: ID of the packet capture operation. - :vartype id: str - :param etag: - :type etag: str - :param target: The ID of the targeted resource, only VM is currently supported. - :type target: str - :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes - are truncated. - :type bytes_to_capture_per_packet: int - :param total_bytes_per_session: Maximum size of the capture output. - :type total_bytes_per_session: int - :param time_limit_in_seconds: Maximum duration of the capture session in seconds. - :type time_limit_in_seconds: int - :param storage_location: Describes the storage location for a packet capture session. - :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation - :param filters: - :type filters: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] - :param provisioning_state: The provisioning state of the packet capture session. Possible - values include: "Succeeded", "Updating", "Deleting", "Failed". - :type provisioning_state: str or ~azure.mgmt.network.v2017_08_01.models.ProvisioningState - """ - - _validation = { - 'name': {'readonly': True}, - 'id': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'target': {'key': 'properties.target', 'type': 'str'}, - 'bytes_to_capture_per_packet': {'key': 'properties.bytesToCapturePerPacket', 'type': 'int'}, - 'total_bytes_per_session': {'key': 'properties.totalBytesPerSession', 'type': 'int'}, - 'time_limit_in_seconds': {'key': 'properties.timeLimitInSeconds', 'type': 'int'}, - 'storage_location': {'key': 'properties.storageLocation', 'type': 'PacketCaptureStorageLocation'}, - 'filters': {'key': 'properties.filters', 'type': '[PacketCaptureFilter]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - etag: Optional[str] = "A unique read-only string that changes whenever the resource is updated.", - target: Optional[str] = None, - bytes_to_capture_per_packet: Optional[int] = 0, - total_bytes_per_session: Optional[int] = 1073741824, - time_limit_in_seconds: Optional[int] = 18000, - storage_location: Optional["PacketCaptureStorageLocation"] = None, - filters: Optional[List["PacketCaptureFilter"]] = None, - provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, - **kwargs - ): - super(PacketCaptureResult, self).__init__(**kwargs) - self.name = None - self.id = None - self.etag = etag - self.target = target - self.bytes_to_capture_per_packet = bytes_to_capture_per_packet - self.total_bytes_per_session = total_bytes_per_session - self.time_limit_in_seconds = time_limit_in_seconds - self.storage_location = storage_location - self.filters = filters - self.provisioning_state = provisioning_state - - -class PacketCaptureResultProperties(PacketCaptureParameters): - """Describes the properties of a packet capture session. - - All required parameters must be populated in order to send to Azure. - - :param target: Required. The ID of the targeted resource, only VM is currently supported. - :type target: str - :param bytes_to_capture_per_packet: Number of bytes captured per packet, the remaining bytes - are truncated. - :type bytes_to_capture_per_packet: int - :param total_bytes_per_session: Maximum size of the capture output. - :type total_bytes_per_session: int - :param time_limit_in_seconds: Maximum duration of the capture session in seconds. - :type time_limit_in_seconds: int - :param storage_location: Required. Describes the storage location for a packet capture session. - :type storage_location: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureStorageLocation - :param filters: - :type filters: list[~azure.mgmt.network.v2017_08_01.models.PacketCaptureFilter] - :param provisioning_state: The provisioning state of the packet capture session. Possible - values include: "Succeeded", "Updating", "Deleting", "Failed". - :type provisioning_state: str or ~azure.mgmt.network.v2017_08_01.models.ProvisioningState - """ - - _validation = { - 'target': {'required': True}, - 'storage_location': {'required': True}, - } - - _attribute_map = { - 'target': {'key': 'target', 'type': 'str'}, - 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'}, - 'total_bytes_per_session': {'key': 'totalBytesPerSession', 'type': 'int'}, - 'time_limit_in_seconds': {'key': 'timeLimitInSeconds', 'type': 'int'}, - 'storage_location': {'key': 'storageLocation', 'type': 'PacketCaptureStorageLocation'}, - 'filters': {'key': 'filters', 'type': '[PacketCaptureFilter]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - target: str, - storage_location: "PacketCaptureStorageLocation", - bytes_to_capture_per_packet: Optional[int] = 0, - total_bytes_per_session: Optional[int] = 1073741824, - time_limit_in_seconds: Optional[int] = 18000, - filters: Optional[List["PacketCaptureFilter"]] = None, - provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, - **kwargs - ): - super(PacketCaptureResultProperties, self).__init__(target=target, bytes_to_capture_per_packet=bytes_to_capture_per_packet, total_bytes_per_session=total_bytes_per_session, time_limit_in_seconds=time_limit_in_seconds, storage_location=storage_location, filters=filters, **kwargs) - self.provisioning_state = provisioning_state - - -class PacketCaptureStorageLocation(msrest.serialization.Model): - """Describes the storage location for a packet capture session. - - :param storage_id: The ID of the storage account to save the packet capture session. Required - if no local file path is provided. - :type storage_id: str - :param storage_path: The URI of the storage path to save the packet capture. Must be a - well-formed URI describing the location to save the packet capture. - :type storage_path: str - :param file_path: A valid local path on the targeting VM. Must include the name of the capture - file (*.cap). For linux virtual machine it must start with /var/captures. Required if no - storage ID is provided, otherwise optional. - :type file_path: str - """ - - _attribute_map = { - 'storage_id': {'key': 'storageId', 'type': 'str'}, - 'storage_path': {'key': 'storagePath', 'type': 'str'}, - 'file_path': {'key': 'filePath', 'type': 'str'}, - } - - def __init__( - self, - *, - storage_id: Optional[str] = None, - storage_path: Optional[str] = None, - file_path: Optional[str] = None, - **kwargs - ): - super(PacketCaptureStorageLocation, self).__init__(**kwargs) - self.storage_id = storage_id - self.storage_path = storage_path - self.file_path = file_path - - -class PatchRouteFilter(SubResource): - """Route Filter Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :ivar type: Resource type. - :vartype type: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param rules: Collection of RouteFilterRules contained within a route filter. - :type rules: list[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :param peerings: A collection of references to express route circuit peerings. - :type peerings: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :ivar provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', 'Succeeded' and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'etag': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, - 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - rules: Optional[List["RouteFilterRule"]] = None, - peerings: Optional[List["ExpressRouteCircuitPeering"]] = None, - **kwargs - ): - super(PatchRouteFilter, self).__init__(id=id, **kwargs) - self.name = None - self.etag = None - self.type = None - self.tags = tags - self.rules = rules - self.peerings = peerings - self.provisioning_state = None - - -class PatchRouteFilterRule(SubResource): - """Route Filter Rule Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param access: The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values - include: "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access - :param route_filter_rule_type: The rule type of the rule. Valid value is: 'Community'. Possible - values include: "Community". - :type route_filter_rule_type: str or ~azure.mgmt.network.v2017_08_01.models.RouteFilterRuleType - :param communities: The collection for bgp community values to filter on. e.g. - ['12076:5010','12076:5020']. - :type communities: list[str] - :ivar provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', 'Succeeded' and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'access': {'key': 'properties.access', 'type': 'str'}, - 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, - 'communities': {'key': 'properties.communities', 'type': '[str]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - access: Optional[Union[str, "Access"]] = None, - route_filter_rule_type: Optional[Union[str, "RouteFilterRuleType"]] = None, - communities: Optional[List[str]] = None, - **kwargs - ): - super(PatchRouteFilterRule, self).__init__(id=id, **kwargs) - self.name = None - self.etag = None - self.tags = tags - self.access = access - self.route_filter_rule_type = route_filter_rule_type - self.communities = communities - self.provisioning_state = None - - -class Probe(SubResource): - """A load balancer probe. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Gets name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :ivar load_balancing_rules: The load balancer rules that use this probe. - :vartype load_balancing_rules: list[~azure.mgmt.network.v2017_08_01.models.SubResource] - :param protocol: The protocol of the end point. Possible values are: 'Http' or 'Tcp'. If 'Tcp' - is specified, a received ACK is required for the probe to be successful. If 'Http' is - specified, a 200 OK response from the specifies URI is required for the probe to be successful. - Possible values include: "Http", "Tcp". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.ProbeProtocol - :param port: The port for communicating the probe. Possible values range from 1 to 65535, - inclusive. - :type port: int - :param interval_in_seconds: The interval, in seconds, for how frequently to probe the endpoint - for health status. 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. - :type interval_in_seconds: int - :param number_of_probes: The number of probes where if no response, will result in stopping - further traffic from being delivered to the endpoint. This values allows endpoints to be taken - out of rotation faster or slower than the typical times used in Azure. - :type number_of_probes: int - :param request_path: 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. There is no default value. - :type request_path: str - :param provisioning_state: Gets the provisioning state of the public IP resource. Possible - values are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'load_balancing_rules': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'load_balancing_rules': {'key': 'properties.loadBalancingRules', 'type': '[SubResource]'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'port': {'key': 'properties.port', 'type': 'int'}, - 'interval_in_seconds': {'key': 'properties.intervalInSeconds', 'type': 'int'}, - 'number_of_probes': {'key': 'properties.numberOfProbes', 'type': 'int'}, - 'request_path': {'key': 'properties.requestPath', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - protocol: Optional[Union[str, "ProbeProtocol"]] = None, - port: Optional[int] = None, - interval_in_seconds: Optional[int] = None, - number_of_probes: Optional[int] = None, - request_path: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(Probe, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.load_balancing_rules = None - self.protocol = protocol - self.port = port - self.interval_in_seconds = interval_in_seconds - self.number_of_probes = number_of_probes - self.request_path = request_path - self.provisioning_state = provisioning_state - - -class PublicIPAddress(Resource): - """Public IP address resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param sku: The public IP address SKU. - :type sku: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddressSku - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param zones: A list of availability zones denoting the IP allocated for the resource needs to - come from. - :type zones: list[str] - :param public_ip_allocation_method: The public IP allocation method. Possible values are: - 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type public_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param public_ip_address_version: The public IP address version. Possible values are: 'IPv4' - and 'IPv6'. Possible values include: "IPv4", "IPv6". - :type public_ip_address_version: str or ~azure.mgmt.network.v2017_08_01.models.IPVersion - :ivar ip_configuration: The IP configuration associated with the public IP address. - :vartype ip_configuration: ~azure.mgmt.network.v2017_08_01.models.IPConfiguration - :param dns_settings: The FQDN of the DNS record associated with the public IP address. - :type dns_settings: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddressDnsSettings - :param ip_address: The IP address associated with the public IP address resource. - :type ip_address: str - :param idle_timeout_in_minutes: The idle timeout of the public IP address. - :type idle_timeout_in_minutes: int - :param resource_guid: The resource GUID property of the public IP resource. - :type resource_guid: str - :param provisioning_state: The provisioning state of the PublicIP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'ip_configuration': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'PublicIPAddressSku'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'zones': {'key': 'zones', 'type': '[str]'}, - 'public_ip_allocation_method': {'key': 'properties.publicIPAllocationMethod', 'type': 'str'}, - 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, - 'ip_configuration': {'key': 'properties.ipConfiguration', 'type': 'IPConfiguration'}, - 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, - 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, - 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - sku: Optional["PublicIPAddressSku"] = None, - etag: Optional[str] = None, - zones: Optional[List[str]] = None, - public_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, - public_ip_address_version: Optional[Union[str, "IPVersion"]] = None, - dns_settings: Optional["PublicIPAddressDnsSettings"] = None, - ip_address: Optional[str] = None, - idle_timeout_in_minutes: Optional[int] = None, - resource_guid: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.sku = sku - self.etag = etag - self.zones = zones - self.public_ip_allocation_method = public_ip_allocation_method - self.public_ip_address_version = public_ip_address_version - self.ip_configuration = None - self.dns_settings = dns_settings - self.ip_address = ip_address - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - - -class PublicIPAddressDnsSettings(msrest.serialization.Model): - """Contains FQDN of the DNS record associated with the public IP address. - - :param domain_name_label: 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. - :type domain_name_label: str - :param fqdn: 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. - :type fqdn: str - :param reverse_fqdn: 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. - :type reverse_fqdn: str - """ - - _attribute_map = { - 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, - 'fqdn': {'key': 'fqdn', 'type': 'str'}, - 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, - } - - def __init__( - self, - *, - domain_name_label: Optional[str] = None, - fqdn: Optional[str] = None, - reverse_fqdn: Optional[str] = None, - **kwargs - ): - super(PublicIPAddressDnsSettings, self).__init__(**kwargs) - self.domain_name_label = domain_name_label - self.fqdn = fqdn - self.reverse_fqdn = reverse_fqdn - - -class PublicIPAddressListResult(msrest.serialization.Model): - """Response for ListPublicIpAddresses API service call. - - :param value: A list of public IP addresses that exists in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.PublicIPAddress] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PublicIPAddress]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["PublicIPAddress"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(PublicIPAddressListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class PublicIPAddressSku(msrest.serialization.Model): - """SKU of a public IP address. - - :param name: Name of a public IP address SKU. Possible values include: "Basic", "Standard". - :type name: str or ~azure.mgmt.network.v2017_08_01.models.PublicIPAddressSkuName - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[Union[str, "PublicIPAddressSkuName"]] = None, - **kwargs - ): - super(PublicIPAddressSku, self).__init__(**kwargs) - self.name = name - - -class QueryTroubleshootingParameters(msrest.serialization.Model): - """Parameters that define the resource to query the troubleshooting result. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The target resource ID to query the troubleshooting - result. - :type target_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - target_resource_id: str, - **kwargs - ): - super(QueryTroubleshootingParameters, self).__init__(**kwargs) - self.target_resource_id = target_resource_id - - -class ResourceNavigationLink(SubResource): - """ResourceNavigationLink resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: Name of the resource that is unique within a resource group. This name can be used - to access the resource. - :type name: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param linked_resource_type: Resource type of the linked resource. - :type linked_resource_type: str - :param link: Link to the external resource. - :type link: str - :ivar provisioning_state: Provisioning state of the ResourceNavigationLink resource. - :vartype provisioning_state: str - """ - - _validation = { - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'linked_resource_type': {'key': 'properties.linkedResourceType', 'type': 'str'}, - 'link': {'key': 'properties.link', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - linked_resource_type: Optional[str] = None, - link: Optional[str] = None, - **kwargs - ): - super(ResourceNavigationLink, self).__init__(id=id, **kwargs) - self.name = name - self.etag = None - self.linked_resource_type = linked_resource_type - self.link = link - self.provisioning_state = None - - -class RetentionPolicyParameters(msrest.serialization.Model): - """Parameters that define the retention policy for flow log. - - :param days: Number of days to retain flow log records. - :type days: int - :param enabled: Flag to enable/disable retention. - :type enabled: bool - """ - - _attribute_map = { - 'days': {'key': 'days', 'type': 'int'}, - 'enabled': {'key': 'enabled', 'type': 'bool'}, - } - - def __init__( - self, - *, - days: Optional[int] = 0, - enabled: Optional[bool] = False, - **kwargs - ): - super(RetentionPolicyParameters, self).__init__(**kwargs) - self.days = days - self.enabled = enabled - - -class Route(SubResource): - """Route resource. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param address_prefix: The destination CIDR to which the route applies. - :type address_prefix: str - :param next_hop_type: The type of Azure hop the packet should be sent to. Possible values are: - 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. Possible - values include: "VirtualNetworkGateway", "VnetLocal", "Internet", "VirtualAppliance", "None". - :type next_hop_type: str or ~azure.mgmt.network.v2017_08_01.models.RouteNextHopType - :param next_hop_ip_address: The IP address packets should be forwarded to. Next hop values are - only allowed in routes where the next hop type is VirtualAppliance. - :type next_hop_ip_address: str - :param provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, - 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, - 'next_hop_ip_address': {'key': 'properties.nextHopIpAddress', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - address_prefix: Optional[str] = None, - next_hop_type: Optional[Union[str, "RouteNextHopType"]] = None, - next_hop_ip_address: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(Route, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.address_prefix = address_prefix - self.next_hop_type = next_hop_type - self.next_hop_ip_address = next_hop_ip_address - self.provisioning_state = provisioning_state - - -class RouteFilter(Resource): - """Route Filter Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :ivar etag: Gets a unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param rules: Collection of RouteFilterRules contained within a route filter. - :type rules: list[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :param peerings: A collection of references to express route circuit peerings. - :type peerings: list[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :ivar provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', 'Succeeded' and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'rules': {'key': 'properties.rules', 'type': '[RouteFilterRule]'}, - 'peerings': {'key': 'properties.peerings', 'type': '[ExpressRouteCircuitPeering]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - rules: Optional[List["RouteFilterRule"]] = None, - peerings: Optional[List["ExpressRouteCircuitPeering"]] = None, - **kwargs - ): - super(RouteFilter, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = None - self.rules = rules - self.peerings = peerings - self.provisioning_state = None - - -class RouteFilterListResult(msrest.serialization.Model): - """Response for the ListRouteFilters API service call. - - :param value: Gets a list of route filters in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.RouteFilter] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RouteFilter]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["RouteFilter"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(RouteFilterListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class RouteFilterRule(SubResource): - """Route Filter Rule Resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param location: Resource location. - :type location: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param access: The access type of the rule. Valid values are: 'Allow', 'Deny'. Possible values - include: "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access - :param route_filter_rule_type: The rule type of the rule. Valid value is: 'Community'. Possible - values include: "Community". - :type route_filter_rule_type: str or ~azure.mgmt.network.v2017_08_01.models.RouteFilterRuleType - :param communities: The collection for bgp community values to filter on. e.g. - ['12076:5010','12076:5020']. - :type communities: list[str] - :ivar provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', 'Succeeded' and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'access': {'key': 'properties.access', 'type': 'str'}, - 'route_filter_rule_type': {'key': 'properties.routeFilterRuleType', 'type': 'str'}, - 'communities': {'key': 'properties.communities', 'type': '[str]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - access: Optional[Union[str, "Access"]] = None, - route_filter_rule_type: Optional[Union[str, "RouteFilterRuleType"]] = None, - communities: Optional[List[str]] = None, - **kwargs - ): - super(RouteFilterRule, self).__init__(id=id, **kwargs) - self.name = name - self.location = location - self.etag = None - self.tags = tags - self.access = access - self.route_filter_rule_type = route_filter_rule_type - self.communities = communities - self.provisioning_state = None - - -class RouteFilterRuleListResult(msrest.serialization.Model): - """Response for the ListRouteFilterRules API service call. - - :param value: Gets a list of RouteFilterRules in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RouteFilterRule]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["RouteFilterRule"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(RouteFilterRuleListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class RouteListResult(msrest.serialization.Model): - """Response for the ListRoute API service call. - - :param value: Gets a list of routes in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.Route] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Route]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Route"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(RouteListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class RouteTable(Resource): - """Route table resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param routes: Collection of routes contained within a route table. - :type routes: list[~azure.mgmt.network.v2017_08_01.models.Route] - :ivar subnets: A collection of references to subnets. - :vartype subnets: list[~azure.mgmt.network.v2017_08_01.models.Subnet] - :param provisioning_state: The provisioning state of the resource. Possible values are: - 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'subnets': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'routes': {'key': 'properties.routes', 'type': '[Route]'}, - 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - routes: Optional[List["Route"]] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(RouteTable, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.routes = routes - self.subnets = None - self.provisioning_state = provisioning_state - - -class RouteTableListResult(msrest.serialization.Model): - """Response for the ListRouteTable API service call. - - :param value: Gets a list of route tables in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.RouteTable] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[RouteTable]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["RouteTable"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(RouteTableListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SecurityGroupNetworkInterface(msrest.serialization.Model): - """Network interface and all its associated security rules. - - :param id: ID of the network interface. - :type id: str - :param security_rule_associations: All security rules associated with the network interface. - :type security_rule_associations: - ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAssociations - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'security_rule_associations': {'key': 'securityRuleAssociations', 'type': 'SecurityRuleAssociations'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - security_rule_associations: Optional["SecurityRuleAssociations"] = None, - **kwargs - ): - super(SecurityGroupNetworkInterface, self).__init__(**kwargs) - self.id = id - self.security_rule_associations = security_rule_associations - - -class SecurityGroupViewParameters(msrest.serialization.Model): - """Parameters that define the VM to check security groups for. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. ID of the target VM. - :type target_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - target_resource_id: str, - **kwargs - ): - super(SecurityGroupViewParameters, self).__init__(**kwargs) - self.target_resource_id = target_resource_id - - -class SecurityGroupViewResult(msrest.serialization.Model): - """The information about security rules applied to the specified VM. - - :param network_interfaces: List of network interfaces on the specified VM. - :type network_interfaces: - list[~azure.mgmt.network.v2017_08_01.models.SecurityGroupNetworkInterface] - """ - - _attribute_map = { - 'network_interfaces': {'key': 'networkInterfaces', 'type': '[SecurityGroupNetworkInterface]'}, - } - - def __init__( - self, - *, - network_interfaces: Optional[List["SecurityGroupNetworkInterface"]] = None, - **kwargs - ): - super(SecurityGroupViewResult, self).__init__(**kwargs) - self.network_interfaces = network_interfaces - - -class SecurityRule(SubResource): - """Network security rule. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param description: A description for this rule. Restricted to 140 chars. - :type description: str - :param protocol: Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and - '*'. Possible values include: "Tcp", "Udp", "*". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleProtocol - :param source_port_range: The source port or range. Integer or range between 0 and 65535. - Asterisk '*' can also be used to match all ports. - :type source_port_range: str - :param destination_port_range: The destination port or range. Integer or range between 0 and - 65535. Asterisk '*' can also be used to match all ports. - :type destination_port_range: str - :param source_address_prefix: 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. - :type source_address_prefix: str - :param source_address_prefixes: The CIDR or source IP ranges. - :type source_address_prefixes: list[str] - :param destination_address_prefix: 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. - :type destination_address_prefix: str - :param destination_address_prefixes: The destination address prefixes. CIDR or destination IP - ranges. - :type destination_address_prefixes: list[str] - :param source_port_ranges: The source port ranges. - :type source_port_ranges: list[str] - :param destination_port_ranges: The destination port ranges. - :type destination_port_ranges: list[str] - :param access: The network traffic is allowed or denied. Possible values are: 'Allow' and - 'Deny'. Possible values include: "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleAccess - :param priority: 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. - :type priority: int - :param direction: The direction of the rule. The direction specifies if rule will be evaluated - on incoming or outgoing traffic. Possible values are: 'Inbound' and 'Outbound'. Possible values - include: "Inbound", "Outbound". - :type direction: str or ~azure.mgmt.network.v2017_08_01.models.SecurityRuleDirection - :param provisioning_state: The provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'protocol': {'key': 'properties.protocol', 'type': 'str'}, - 'source_port_range': {'key': 'properties.sourcePortRange', 'type': 'str'}, - 'destination_port_range': {'key': 'properties.destinationPortRange', 'type': 'str'}, - 'source_address_prefix': {'key': 'properties.sourceAddressPrefix', 'type': 'str'}, - 'source_address_prefixes': {'key': 'properties.sourceAddressPrefixes', 'type': '[str]'}, - 'destination_address_prefix': {'key': 'properties.destinationAddressPrefix', 'type': 'str'}, - 'destination_address_prefixes': {'key': 'properties.destinationAddressPrefixes', 'type': '[str]'}, - 'source_port_ranges': {'key': 'properties.sourcePortRanges', 'type': '[str]'}, - 'destination_port_ranges': {'key': 'properties.destinationPortRanges', 'type': '[str]'}, - 'access': {'key': 'properties.access', 'type': 'str'}, - 'priority': {'key': 'properties.priority', 'type': 'int'}, - 'direction': {'key': 'properties.direction', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - description: Optional[str] = None, - protocol: Optional[Union[str, "SecurityRuleProtocol"]] = None, - source_port_range: Optional[str] = None, - destination_port_range: Optional[str] = None, - source_address_prefix: Optional[str] = None, - source_address_prefixes: Optional[List[str]] = None, - destination_address_prefix: Optional[str] = None, - destination_address_prefixes: Optional[List[str]] = None, - source_port_ranges: Optional[List[str]] = None, - destination_port_ranges: Optional[List[str]] = None, - access: Optional[Union[str, "SecurityRuleAccess"]] = None, - priority: Optional[int] = None, - direction: Optional[Union[str, "SecurityRuleDirection"]] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(SecurityRule, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.description = description - self.protocol = protocol - self.source_port_range = source_port_range - self.destination_port_range = destination_port_range - self.source_address_prefix = source_address_prefix - self.source_address_prefixes = source_address_prefixes - self.destination_address_prefix = destination_address_prefix - self.destination_address_prefixes = destination_address_prefixes - self.source_port_ranges = source_port_ranges - self.destination_port_ranges = destination_port_ranges - self.access = access - self.priority = priority - self.direction = direction - self.provisioning_state = provisioning_state - - -class SecurityRuleAssociations(msrest.serialization.Model): - """All security rules associated with the network interface. - - :param network_interface_association: Network interface and its custom security rules. - :type network_interface_association: - ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceAssociation - :param subnet_association: Network interface and its custom security rules. - :type subnet_association: ~azure.mgmt.network.v2017_08_01.models.SubnetAssociation - :param default_security_rules: Collection of default security rules of the network security - group. - :type default_security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :param effective_security_rules: Collection of effective security rules. - :type effective_security_rules: - list[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityRule] - """ - - _attribute_map = { - 'network_interface_association': {'key': 'networkInterfaceAssociation', 'type': 'NetworkInterfaceAssociation'}, - 'subnet_association': {'key': 'subnetAssociation', 'type': 'SubnetAssociation'}, - 'default_security_rules': {'key': 'defaultSecurityRules', 'type': '[SecurityRule]'}, - 'effective_security_rules': {'key': 'effectiveSecurityRules', 'type': '[EffectiveNetworkSecurityRule]'}, - } - - def __init__( - self, - *, - network_interface_association: Optional["NetworkInterfaceAssociation"] = None, - subnet_association: Optional["SubnetAssociation"] = None, - default_security_rules: Optional[List["SecurityRule"]] = None, - effective_security_rules: Optional[List["EffectiveNetworkSecurityRule"]] = None, - **kwargs - ): - super(SecurityRuleAssociations, self).__init__(**kwargs) - self.network_interface_association = network_interface_association - self.subnet_association = subnet_association - self.default_security_rules = default_security_rules - self.effective_security_rules = effective_security_rules - - -class SecurityRuleListResult(msrest.serialization.Model): - """Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security group. - - :param value: The security rules in a network security group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SecurityRule]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["SecurityRule"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(SecurityRuleListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ServiceEndpointPropertiesFormat(msrest.serialization.Model): - """The service endpoint properties. - - :param service: The type of the endpoint service. - :type service: str - :param locations: A list of locations. - :type locations: list[str] - :param provisioning_state: The provisioning state of the resource. - :type provisioning_state: str - """ - - _attribute_map = { - 'service': {'key': 'service', 'type': 'str'}, - 'locations': {'key': 'locations', 'type': '[str]'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - service: Optional[str] = None, - locations: Optional[List[str]] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(ServiceEndpointPropertiesFormat, self).__init__(**kwargs) - self.service = service - self.locations = locations - self.provisioning_state = provisioning_state - - -class Subnet(SubResource): - """Subnet in a virtual network resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param address_prefix: The address prefix for the subnet. - :type address_prefix: str - :param network_security_group: The reference of the NetworkSecurityGroup resource. - :type network_security_group: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup - :param route_table: The reference of the RouteTable resource. - :type route_table: ~azure.mgmt.network.v2017_08_01.models.RouteTable - :param service_endpoints: An array of service endpoints. - :type service_endpoints: - list[~azure.mgmt.network.v2017_08_01.models.ServiceEndpointPropertiesFormat] - :ivar ip_configurations: Gets an array of references to the network interface IP configurations - using subnet. - :vartype ip_configurations: list[~azure.mgmt.network.v2017_08_01.models.IPConfiguration] - :param resource_navigation_links: Gets an array of references to the external resources using - subnet. - :type resource_navigation_links: - list[~azure.mgmt.network.v2017_08_01.models.ResourceNavigationLink] - :param provisioning_state: The provisioning state of the resource. - :type provisioning_state: str - """ - - _validation = { - 'ip_configurations': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, - 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, - 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, - 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, - 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, - 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - address_prefix: Optional[str] = None, - network_security_group: Optional["NetworkSecurityGroup"] = None, - route_table: Optional["RouteTable"] = None, - service_endpoints: Optional[List["ServiceEndpointPropertiesFormat"]] = None, - resource_navigation_links: Optional[List["ResourceNavigationLink"]] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(Subnet, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.address_prefix = address_prefix - self.network_security_group = network_security_group - self.route_table = route_table - self.service_endpoints = service_endpoints - self.ip_configurations = None - self.resource_navigation_links = resource_navigation_links - self.provisioning_state = provisioning_state - - -class SubnetAssociation(msrest.serialization.Model): - """Network interface and its custom security rules. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Subnet ID. - :vartype id: str - :param security_rules: Collection of custom security rules. - :type security_rules: list[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - """ - - _validation = { - 'id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'security_rules': {'key': 'securityRules', 'type': '[SecurityRule]'}, - } - - def __init__( - self, - *, - security_rules: Optional[List["SecurityRule"]] = None, - **kwargs - ): - super(SubnetAssociation, self).__init__(**kwargs) - self.id = None - self.security_rules = security_rules - - -class SubnetListResult(msrest.serialization.Model): - """Response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network. - - :param value: The subnets in a virtual network. - :type value: list[~azure.mgmt.network.v2017_08_01.models.Subnet] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Subnet]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Subnet"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(SubnetListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class Topology(msrest.serialization.Model): - """Topology of the specified resource group. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: GUID representing the operation id. - :vartype id: str - :ivar created_date_time: The datetime when the topology was initially created for the resource - group. - :vartype created_date_time: ~datetime.datetime - :ivar last_modified: The datetime when the topology was last modified. - :vartype last_modified: ~datetime.datetime - :param resources: - :type resources: list[~azure.mgmt.network.v2017_08_01.models.TopologyResource] - """ - - _validation = { - 'id': {'readonly': True}, - 'created_date_time': {'readonly': True}, - 'last_modified': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, - 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, - 'resources': {'key': 'resources', 'type': '[TopologyResource]'}, - } - - def __init__( - self, - *, - resources: Optional[List["TopologyResource"]] = None, - **kwargs - ): - super(Topology, self).__init__(**kwargs) - self.id = None - self.created_date_time = None - self.last_modified = None - self.resources = resources - - -class TopologyAssociation(msrest.serialization.Model): - """Resources that have an association with the parent resource. - - :param name: The name of the resource that is associated with the parent resource. - :type name: str - :param resource_id: The ID of the resource that is associated with the parent resource. - :type resource_id: str - :param association_type: The association type of the child resource to the parent resource. - Possible values include: "Associated", "Contains". - :type association_type: str or ~azure.mgmt.network.v2017_08_01.models.AssociationType - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'resource_id': {'key': 'resourceId', 'type': 'str'}, - 'association_type': {'key': 'associationType', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - resource_id: Optional[str] = None, - association_type: Optional[Union[str, "AssociationType"]] = None, - **kwargs - ): - super(TopologyAssociation, self).__init__(**kwargs) - self.name = name - self.resource_id = resource_id - self.association_type = association_type - - -class TopologyParameters(msrest.serialization.Model): - """Parameters that define the representation of topology. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_group_name: Required. The name of the target resource group to perform - topology on. - :type target_resource_group_name: str - """ - - _validation = { - 'target_resource_group_name': {'required': True}, - } - - _attribute_map = { - 'target_resource_group_name': {'key': 'targetResourceGroupName', 'type': 'str'}, - } - - def __init__( - self, - *, - target_resource_group_name: str, - **kwargs - ): - super(TopologyParameters, self).__init__(**kwargs) - self.target_resource_group_name = target_resource_group_name - - -class TopologyResource(msrest.serialization.Model): - """The network resource topology information for the given resource group. - - :param name: Name of the resource. - :type name: str - :param id: ID of the resource. - :type id: str - :param location: Resource location. - :type location: str - :param associations: Holds the associations the resource has with other resources in the - resource group. - :type associations: list[~azure.mgmt.network.v2017_08_01.models.TopologyAssociation] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'associations': {'key': 'associations', 'type': '[TopologyAssociation]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - id: Optional[str] = None, - location: Optional[str] = None, - associations: Optional[List["TopologyAssociation"]] = None, - **kwargs - ): - super(TopologyResource, self).__init__(**kwargs) - self.name = name - self.id = id - self.location = location - self.associations = associations - - -class TroubleshootingDetails(msrest.serialization.Model): - """Information gained from troubleshooting of specified resource. - - :param id: The id of the get troubleshoot operation. - :type id: str - :param reason_type: Reason type of failure. - :type reason_type: str - :param summary: A summary of troubleshooting. - :type summary: str - :param detail: Details on troubleshooting results. - :type detail: str - :param recommended_actions: List of recommended actions. - :type recommended_actions: - list[~azure.mgmt.network.v2017_08_01.models.TroubleshootingRecommendedActions] - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'reason_type': {'key': 'reasonType', 'type': 'str'}, - 'summary': {'key': 'summary', 'type': 'str'}, - 'detail': {'key': 'detail', 'type': 'str'}, - 'recommended_actions': {'key': 'recommendedActions', 'type': '[TroubleshootingRecommendedActions]'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - reason_type: Optional[str] = None, - summary: Optional[str] = None, - detail: Optional[str] = None, - recommended_actions: Optional[List["TroubleshootingRecommendedActions"]] = None, - **kwargs - ): - super(TroubleshootingDetails, self).__init__(**kwargs) - self.id = id - self.reason_type = reason_type - self.summary = summary - self.detail = detail - self.recommended_actions = recommended_actions - - -class TroubleshootingParameters(msrest.serialization.Model): - """Parameters that define the resource to troubleshoot. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The target resource to troubleshoot. - :type target_resource_id: str - :param storage_id: Required. The ID for the storage account to save the troubleshoot result. - :type storage_id: str - :param storage_path: Required. The path to the blob to save the troubleshoot result in. - :type storage_path: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - 'storage_id': {'required': True}, - 'storage_path': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'storage_id': {'key': 'properties.storageId', 'type': 'str'}, - 'storage_path': {'key': 'properties.storagePath', 'type': 'str'}, - } - - def __init__( - self, - *, - target_resource_id: str, - storage_id: str, - storage_path: str, - **kwargs - ): - super(TroubleshootingParameters, self).__init__(**kwargs) - self.target_resource_id = target_resource_id - self.storage_id = storage_id - self.storage_path = storage_path - - -class TroubleshootingRecommendedActions(msrest.serialization.Model): - """Recommended actions based on discovered issues. - - :param action_id: ID of the recommended action. - :type action_id: str - :param action_text: Description of recommended actions. - :type action_text: str - :param action_uri: The uri linking to a documentation for the recommended troubleshooting - actions. - :type action_uri: str - :param action_uri_text: The information from the URI for the recommended troubleshooting - actions. - :type action_uri_text: str - """ - - _attribute_map = { - 'action_id': {'key': 'actionId', 'type': 'str'}, - 'action_text': {'key': 'actionText', 'type': 'str'}, - 'action_uri': {'key': 'actionUri', 'type': 'str'}, - 'action_uri_text': {'key': 'actionUriText', 'type': 'str'}, - } - - def __init__( - self, - *, - action_id: Optional[str] = None, - action_text: Optional[str] = None, - action_uri: Optional[str] = None, - action_uri_text: Optional[str] = None, - **kwargs - ): - super(TroubleshootingRecommendedActions, self).__init__(**kwargs) - self.action_id = action_id - self.action_text = action_text - self.action_uri = action_uri - self.action_uri_text = action_uri_text - - -class TroubleshootingResult(msrest.serialization.Model): - """Troubleshooting information gained from specified resource. - - :param start_time: The start time of the troubleshooting. - :type start_time: ~datetime.datetime - :param end_time: The end time of the troubleshooting. - :type end_time: ~datetime.datetime - :param code: The result code of the troubleshooting. - :type code: str - :param results: Information from troubleshooting. - :type results: list[~azure.mgmt.network.v2017_08_01.models.TroubleshootingDetails] - """ - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'code': {'key': 'code', 'type': 'str'}, - 'results': {'key': 'results', 'type': '[TroubleshootingDetails]'}, - } - - def __init__( - self, - *, - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = None, - code: Optional[str] = None, - results: Optional[List["TroubleshootingDetails"]] = None, - **kwargs - ): - super(TroubleshootingResult, self).__init__(**kwargs) - self.start_time = start_time - self.end_time = end_time - self.code = code - self.results = results - - -class TunnelConnectionHealth(msrest.serialization.Model): - """VirtualNetworkGatewayConnection properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tunnel: Tunnel name. - :vartype tunnel: str - :ivar connection_status: Virtual network Gateway connection status. Possible values include: - "Unknown", "Connecting", "Connected", "NotConnected". - :vartype connection_status: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionStatus - :ivar ingress_bytes_transferred: The Ingress Bytes Transferred in this connection. - :vartype ingress_bytes_transferred: long - :ivar egress_bytes_transferred: The Egress Bytes Transferred in this connection. - :vartype egress_bytes_transferred: long - :ivar last_connection_established_utc_time: The time at which connection was established in Utc - format. - :vartype last_connection_established_utc_time: str - """ - - _validation = { - 'tunnel': {'readonly': True}, - 'connection_status': {'readonly': True}, - 'ingress_bytes_transferred': {'readonly': True}, - 'egress_bytes_transferred': {'readonly': True}, - 'last_connection_established_utc_time': {'readonly': True}, - } - - _attribute_map = { - 'tunnel': {'key': 'tunnel', 'type': 'str'}, - 'connection_status': {'key': 'connectionStatus', 'type': 'str'}, - 'ingress_bytes_transferred': {'key': 'ingressBytesTransferred', 'type': 'long'}, - 'egress_bytes_transferred': {'key': 'egressBytesTransferred', 'type': 'long'}, - 'last_connection_established_utc_time': {'key': 'lastConnectionEstablishedUtcTime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TunnelConnectionHealth, self).__init__(**kwargs) - self.tunnel = None - self.connection_status = None - self.ingress_bytes_transferred = None - self.egress_bytes_transferred = None - self.last_connection_established_utc_time = None - - -class Usage(msrest.serialization.Model): - """Describes network resource usage. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource identifier. - :vartype id: str - :param unit: Required. An enum describing the unit of measurement. Possible values include: - "Count". - :type unit: str or ~azure.mgmt.network.v2017_08_01.models.UsageUnit - :param current_value: Required. The current value of the usage. - :type current_value: long - :param limit: Required. The limit of usage. - :type limit: long - :param name: Required. The name of the type of usage. - :type name: ~azure.mgmt.network.v2017_08_01.models.UsageName - """ - - _validation = { - 'id': {'readonly': True}, - 'unit': {'required': True}, - 'current_value': {'required': True}, - 'limit': {'required': True}, - 'name': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'long'}, - 'limit': {'key': 'limit', 'type': 'long'}, - 'name': {'key': 'name', 'type': 'UsageName'}, - } - - def __init__( - self, - *, - unit: Union[str, "UsageUnit"], - current_value: int, - limit: int, - name: "UsageName", - **kwargs - ): - super(Usage, self).__init__(**kwargs) - self.id = None - self.unit = unit - self.current_value = current_value - self.limit = limit - self.name = name - - -class UsageName(msrest.serialization.Model): - """The usage names. - - :param value: A string describing the resource name. - :type value: str - :param localized_value: A localized string describing the resource name. - :type localized_value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[str] = None, - localized_value: Optional[str] = None, - **kwargs - ): - super(UsageName, self).__init__(**kwargs) - self.value = value - self.localized_value = localized_value - - -class UsagesListResult(msrest.serialization.Model): - """The list usages operation response. - - :param value: The list network resource usages. - :type value: list[~azure.mgmt.network.v2017_08_01.models.Usage] - :param next_link: URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Usage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Usage"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(UsagesListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class VerificationIPFlowParameters(msrest.serialization.Model): - """Parameters that define the IP flow to be verified. - - All required parameters must be populated in order to send to Azure. - - :param target_resource_id: Required. The ID of the target resource to perform next-hop on. - :type target_resource_id: str - :param direction: Required. The direction of the packet represented as a 5-tuple. Possible - values include: "Inbound", "Outbound". - :type direction: str or ~azure.mgmt.network.v2017_08_01.models.Direction - :param protocol: Required. Protocol to be verified on. Possible values include: "TCP", "UDP". - :type protocol: str or ~azure.mgmt.network.v2017_08_01.models.Protocol - :param local_port: Required. The local port. Acceptable values are a single integer in the - range (0-65535). Support for * for the source port, which depends on the direction. - :type local_port: str - :param remote_port: Required. The remote port. Acceptable values are a single integer in the - range (0-65535). Support for * for the source port, which depends on the direction. - :type remote_port: str - :param local_ip_address: Required. The local IP address. Acceptable values are valid IPv4 - addresses. - :type local_ip_address: str - :param remote_ip_address: Required. The remote IP address. Acceptable values are valid IPv4 - addresses. - :type remote_ip_address: str - :param target_nic_resource_id: The NIC ID. (If VM has multiple NICs and IP forwarding is - enabled on any of them, then this parameter must be specified. Otherwise optional). - :type target_nic_resource_id: str - """ - - _validation = { - 'target_resource_id': {'required': True}, - 'direction': {'required': True}, - 'protocol': {'required': True}, - 'local_port': {'required': True}, - 'remote_port': {'required': True}, - 'local_ip_address': {'required': True}, - 'remote_ip_address': {'required': True}, - } - - _attribute_map = { - 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, - 'direction': {'key': 'direction', 'type': 'str'}, - 'protocol': {'key': 'protocol', 'type': 'str'}, - 'local_port': {'key': 'localPort', 'type': 'str'}, - 'remote_port': {'key': 'remotePort', 'type': 'str'}, - 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, - 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, - 'target_nic_resource_id': {'key': 'targetNicResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - target_resource_id: str, - direction: Union[str, "Direction"], - protocol: Union[str, "Protocol"], - local_port: str, - remote_port: str, - local_ip_address: str, - remote_ip_address: str, - target_nic_resource_id: Optional[str] = None, - **kwargs - ): - super(VerificationIPFlowParameters, self).__init__(**kwargs) - self.target_resource_id = target_resource_id - self.direction = direction - self.protocol = protocol - self.local_port = local_port - self.remote_port = remote_port - self.local_ip_address = local_ip_address - self.remote_ip_address = remote_ip_address - self.target_nic_resource_id = target_nic_resource_id - - -class VerificationIPFlowResult(msrest.serialization.Model): - """Results of IP flow verification on the target resource. - - :param access: Indicates whether the traffic is allowed or denied. Possible values include: - "Allow", "Deny". - :type access: str or ~azure.mgmt.network.v2017_08_01.models.Access - :param rule_name: Name of the rule. If input is not matched against any security rule, it is - not displayed. - :type rule_name: str - """ - - _attribute_map = { - 'access': {'key': 'access', 'type': 'str'}, - 'rule_name': {'key': 'ruleName', 'type': 'str'}, - } - - def __init__( - self, - *, - access: Optional[Union[str, "Access"]] = None, - rule_name: Optional[str] = None, - **kwargs - ): - super(VerificationIPFlowResult, self).__init__(**kwargs) - self.access = access - self.rule_name = rule_name - - -class VirtualNetwork(Resource): - """Virtual Network resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param address_space: The AddressSpace that contains an array of IP address ranges that can be - used by subnets. - :type address_space: ~azure.mgmt.network.v2017_08_01.models.AddressSpace - :param dhcp_options: The dhcpOptions that contains an array of DNS servers available to VMs - deployed in the virtual network. - :type dhcp_options: ~azure.mgmt.network.v2017_08_01.models.DhcpOptions - :param subnets: A list of subnets in a Virtual Network. - :type subnets: list[~azure.mgmt.network.v2017_08_01.models.Subnet] - :param virtual_network_peerings: A list of peerings in a Virtual Network. - :type virtual_network_peerings: - list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering] - :param resource_guid: The resourceGuid property of the Virtual Network resource. - :type resource_guid: str - :param provisioning_state: The provisioning state of the PublicIP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :type provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'address_space': {'key': 'properties.addressSpace', 'type': 'AddressSpace'}, - 'dhcp_options': {'key': 'properties.dhcpOptions', 'type': 'DhcpOptions'}, - 'subnets': {'key': 'properties.subnets', 'type': '[Subnet]'}, - 'virtual_network_peerings': {'key': 'properties.virtualNetworkPeerings', 'type': '[VirtualNetworkPeering]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - address_space: Optional["AddressSpace"] = None, - dhcp_options: Optional["DhcpOptions"] = None, - subnets: Optional[List["Subnet"]] = None, - virtual_network_peerings: Optional[List["VirtualNetworkPeering"]] = None, - resource_guid: Optional[str] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(VirtualNetwork, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.address_space = address_space - self.dhcp_options = dhcp_options - self.subnets = subnets - self.virtual_network_peerings = virtual_network_peerings - self.resource_guid = resource_guid - self.provisioning_state = provisioning_state - - -class VirtualNetworkConnectionGatewayReference(msrest.serialization.Model): - """A reference to VirtualNetworkGateway or LocalNetworkGateway resource. - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The ID of VirtualNetworkGateway or LocalNetworkGateway resource. - :type id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: str, - **kwargs - ): - super(VirtualNetworkConnectionGatewayReference, self).__init__(**kwargs) - self.id = id - - -class VirtualNetworkGateway(Resource): - """A common class for general resource information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param ip_configurations: IP configurations for virtual network gateway. - :type ip_configurations: - list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayIPConfiguration] - :param gateway_type: The type of this virtual network gateway. Possible values are: 'Vpn' and - 'ExpressRoute'. Possible values include: "Vpn", "ExpressRoute". - :type gateway_type: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayType - :param vpn_type: The type of this virtual network gateway. Possible values are: 'PolicyBased' - and 'RouteBased'. Possible values include: "PolicyBased", "RouteBased". - :type vpn_type: str or ~azure.mgmt.network.v2017_08_01.models.VpnType - :param enable_bgp: Whether BGP is enabled for this virtual network gateway or not. - :type enable_bgp: bool - :param active: ActiveActive flag. - :type active: bool - :param gateway_default_site: The reference of the LocalNetworkGateway resource which represents - local network site having default routes. Assign Null value in case of removing existing - default site setting. - :type gateway_default_site: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param sku: The reference of the VirtualNetworkGatewaySku resource which represents the SKU - selected for Virtual network gateway. - :type sku: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewaySku - :param vpn_client_configuration: The reference of the VpnClientConfiguration resource which - represents the P2S VpnClient configurations. - :type vpn_client_configuration: ~azure.mgmt.network.v2017_08_01.models.VpnClientConfiguration - :param bgp_settings: Virtual network gateway's BGP speaker settings. - :type bgp_settings: ~azure.mgmt.network.v2017_08_01.models.BgpSettings - :param resource_guid: The resource GUID property of the VirtualNetworkGateway resource. - :type resource_guid: str - :ivar provisioning_state: The provisioning state of the VirtualNetworkGateway resource. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[VirtualNetworkGatewayIPConfiguration]'}, - 'gateway_type': {'key': 'properties.gatewayType', 'type': 'str'}, - 'vpn_type': {'key': 'properties.vpnType', 'type': 'str'}, - 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, - 'active': {'key': 'properties.activeActive', 'type': 'bool'}, - 'gateway_default_site': {'key': 'properties.gatewayDefaultSite', 'type': 'SubResource'}, - 'sku': {'key': 'properties.sku', 'type': 'VirtualNetworkGatewaySku'}, - 'vpn_client_configuration': {'key': 'properties.vpnClientConfiguration', 'type': 'VpnClientConfiguration'}, - 'bgp_settings': {'key': 'properties.bgpSettings', 'type': 'BgpSettings'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - ip_configurations: Optional[List["VirtualNetworkGatewayIPConfiguration"]] = None, - gateway_type: Optional[Union[str, "VirtualNetworkGatewayType"]] = None, - vpn_type: Optional[Union[str, "VpnType"]] = None, - enable_bgp: Optional[bool] = None, - active: Optional[bool] = None, - gateway_default_site: Optional["SubResource"] = None, - sku: Optional["VirtualNetworkGatewaySku"] = None, - vpn_client_configuration: Optional["VpnClientConfiguration"] = None, - bgp_settings: Optional["BgpSettings"] = None, - resource_guid: Optional[str] = None, - **kwargs - ): - super(VirtualNetworkGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.ip_configurations = ip_configurations - self.gateway_type = gateway_type - self.vpn_type = vpn_type - self.enable_bgp = enable_bgp - self.active = active - self.gateway_default_site = gateway_default_site - self.sku = sku - self.vpn_client_configuration = vpn_client_configuration - self.bgp_settings = bgp_settings - self.resource_guid = resource_guid - self.provisioning_state = None - - -class VirtualNetworkGatewayConnection(Resource): - """A common class for general resource information. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param authorization_key: The authorizationKey. - :type authorization_key: str - :param virtual_network_gateway1: Required. The reference to virtual network gateway resource. - :type virtual_network_gateway1: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway - :param virtual_network_gateway2: The reference to virtual network gateway resource. - :type virtual_network_gateway2: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway - :param local_network_gateway2: The reference to local network gateway resource. - :type local_network_gateway2: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway - :param connection_type: Required. Gateway connection type. Possible values are: - 'IPsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: "IPsec", - "Vnet2Vnet", "ExpressRoute", "VPNClient". - :type connection_type: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionType - :param routing_weight: The routing weight. - :type routing_weight: int - :param shared_key: The IPSec shared key. - :type shared_key: str - :ivar connection_status: Virtual network Gateway connection status. Possible values are - 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: "Unknown", - "Connecting", "Connected", "NotConnected". - :vartype connection_status: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionStatus - :ivar tunnel_connection_status: Collection of all tunnels' connection health status. - :vartype tunnel_connection_status: - list[~azure.mgmt.network.v2017_08_01.models.TunnelConnectionHealth] - :ivar egress_bytes_transferred: The egress bytes transferred in this connection. - :vartype egress_bytes_transferred: long - :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. - :vartype ingress_bytes_transferred: long - :param peer: The reference to peerings resource. - :type peer: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param enable_bgp: EnableBgp flag. - :type enable_bgp: bool - :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. - :type use_policy_based_traffic_selectors: bool - :param ipsec_policies: The IPSec Policies to be considered by this connection. - :type ipsec_policies: list[~azure.mgmt.network.v2017_08_01.models.IpsecPolicy] - :param resource_guid: The resource GUID property of the VirtualNetworkGatewayConnection - resource. - :type resource_guid: str - :ivar provisioning_state: The provisioning state of the VirtualNetworkGatewayConnection - resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'virtual_network_gateway1': {'required': True}, - 'connection_type': {'required': True}, - 'connection_status': {'readonly': True}, - 'tunnel_connection_status': {'readonly': True}, - 'egress_bytes_transferred': {'readonly': True}, - 'ingress_bytes_transferred': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, - 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkGateway'}, - 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkGateway'}, - 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'LocalNetworkGateway'}, - 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, - 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, - 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, - 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, - 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, - 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, - 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, - 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, - 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, - 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, - 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - virtual_network_gateway1: "VirtualNetworkGateway", - connection_type: Union[str, "VirtualNetworkGatewayConnectionType"], - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - authorization_key: Optional[str] = None, - virtual_network_gateway2: Optional["VirtualNetworkGateway"] = None, - local_network_gateway2: Optional["LocalNetworkGateway"] = None, - routing_weight: Optional[int] = None, - shared_key: Optional[str] = None, - peer: Optional["SubResource"] = None, - enable_bgp: Optional[bool] = None, - use_policy_based_traffic_selectors: Optional[bool] = None, - ipsec_policies: Optional[List["IpsecPolicy"]] = None, - resource_guid: Optional[str] = None, - **kwargs - ): - super(VirtualNetworkGatewayConnection, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key - self.connection_status = None - self.tunnel_connection_status = None - self.egress_bytes_transferred = None - self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid - self.provisioning_state = None - - -class VirtualNetworkGatewayConnectionListEntity(Resource): - """A common class for general resource information. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Resource ID. - :type id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :param etag: Gets a unique read-only string that changes whenever the resource is updated. - :type etag: str - :param authorization_key: The authorizationKey. - :type authorization_key: str - :param virtual_network_gateway1: Required. The reference to virtual network gateway resource. - :type virtual_network_gateway1: - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference - :param virtual_network_gateway2: The reference to virtual network gateway resource. - :type virtual_network_gateway2: - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference - :param local_network_gateway2: The reference to local network gateway resource. - :type local_network_gateway2: - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkConnectionGatewayReference - :param connection_type: Required. Gateway connection type. Possible values are: - 'IPsec','Vnet2Vnet','ExpressRoute', and 'VPNClient. Possible values include: "IPsec", - "Vnet2Vnet", "ExpressRoute", "VPNClient". - :type connection_type: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionType - :param routing_weight: The routing weight. - :type routing_weight: int - :param shared_key: The IPSec shared key. - :type shared_key: str - :ivar connection_status: Virtual network Gateway connection status. Possible values are - 'Unknown', 'Connecting', 'Connected' and 'NotConnected'. Possible values include: "Unknown", - "Connecting", "Connected", "NotConnected". - :vartype connection_status: str or - ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionStatus - :ivar tunnel_connection_status: Collection of all tunnels' connection health status. - :vartype tunnel_connection_status: - list[~azure.mgmt.network.v2017_08_01.models.TunnelConnectionHealth] - :ivar egress_bytes_transferred: The egress bytes transferred in this connection. - :vartype egress_bytes_transferred: long - :ivar ingress_bytes_transferred: The ingress bytes transferred in this connection. - :vartype ingress_bytes_transferred: long - :param peer: The reference to peerings resource. - :type peer: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param enable_bgp: EnableBgp flag. - :type enable_bgp: bool - :param use_policy_based_traffic_selectors: Enable policy-based traffic selectors. - :type use_policy_based_traffic_selectors: bool - :param ipsec_policies: The IPSec Policies to be considered by this connection. - :type ipsec_policies: list[~azure.mgmt.network.v2017_08_01.models.IpsecPolicy] - :param resource_guid: The resource GUID property of the VirtualNetworkGatewayConnection - resource. - :type resource_guid: str - :ivar provisioning_state: The provisioning state of the VirtualNetworkGatewayConnection - resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'virtual_network_gateway1': {'required': True}, - 'connection_type': {'required': True}, - 'connection_status': {'readonly': True}, - 'tunnel_connection_status': {'readonly': True}, - 'egress_bytes_transferred': {'readonly': True}, - 'ingress_bytes_transferred': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'authorization_key': {'key': 'properties.authorizationKey', 'type': 'str'}, - 'virtual_network_gateway1': {'key': 'properties.virtualNetworkGateway1', 'type': 'VirtualNetworkConnectionGatewayReference'}, - 'virtual_network_gateway2': {'key': 'properties.virtualNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, - 'local_network_gateway2': {'key': 'properties.localNetworkGateway2', 'type': 'VirtualNetworkConnectionGatewayReference'}, - 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, - 'routing_weight': {'key': 'properties.routingWeight', 'type': 'int'}, - 'shared_key': {'key': 'properties.sharedKey', 'type': 'str'}, - 'connection_status': {'key': 'properties.connectionStatus', 'type': 'str'}, - 'tunnel_connection_status': {'key': 'properties.tunnelConnectionStatus', 'type': '[TunnelConnectionHealth]'}, - 'egress_bytes_transferred': {'key': 'properties.egressBytesTransferred', 'type': 'long'}, - 'ingress_bytes_transferred': {'key': 'properties.ingressBytesTransferred', 'type': 'long'}, - 'peer': {'key': 'properties.peer', 'type': 'SubResource'}, - 'enable_bgp': {'key': 'properties.enableBgp', 'type': 'bool'}, - 'use_policy_based_traffic_selectors': {'key': 'properties.usePolicyBasedTrafficSelectors', 'type': 'bool'}, - 'ipsec_policies': {'key': 'properties.ipsecPolicies', 'type': '[IpsecPolicy]'}, - 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - virtual_network_gateway1: "VirtualNetworkConnectionGatewayReference", - connection_type: Union[str, "VirtualNetworkGatewayConnectionType"], - id: Optional[str] = None, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - authorization_key: Optional[str] = None, - virtual_network_gateway2: Optional["VirtualNetworkConnectionGatewayReference"] = None, - local_network_gateway2: Optional["VirtualNetworkConnectionGatewayReference"] = None, - routing_weight: Optional[int] = None, - shared_key: Optional[str] = None, - peer: Optional["SubResource"] = None, - enable_bgp: Optional[bool] = None, - use_policy_based_traffic_selectors: Optional[bool] = None, - ipsec_policies: Optional[List["IpsecPolicy"]] = None, - resource_guid: Optional[str] = None, - **kwargs - ): - super(VirtualNetworkGatewayConnectionListEntity, self).__init__(id=id, location=location, tags=tags, **kwargs) - self.etag = etag - self.authorization_key = authorization_key - self.virtual_network_gateway1 = virtual_network_gateway1 - self.virtual_network_gateway2 = virtual_network_gateway2 - self.local_network_gateway2 = local_network_gateway2 - self.connection_type = connection_type - self.routing_weight = routing_weight - self.shared_key = shared_key - self.connection_status = None - self.tunnel_connection_status = None - self.egress_bytes_transferred = None - self.ingress_bytes_transferred = None - self.peer = peer - self.enable_bgp = enable_bgp - self.use_policy_based_traffic_selectors = use_policy_based_traffic_selectors - self.ipsec_policies = ipsec_policies - self.resource_guid = resource_guid - self.provisioning_state = None - - -class VirtualNetworkGatewayConnectionListResult(msrest.serialization.Model): - """Response for the ListVirtualNetworkGatewayConnections API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: Gets a list of VirtualNetworkGatewayConnection resources that exists in a - resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkGatewayConnection]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualNetworkGatewayConnection"]] = None, - **kwargs - ): - super(VirtualNetworkGatewayConnectionListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class VirtualNetworkGatewayIPConfiguration(SubResource): - """IP configuration for virtual network gateway. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param private_ip_allocation_method: The private IP allocation method. Possible values are: - 'Static' and 'Dynamic'. Possible values include: "Static", "Dynamic". - :type private_ip_allocation_method: str or - ~azure.mgmt.network.v2017_08_01.models.IPAllocationMethod - :param subnet: The reference of the subnet resource. - :type subnet: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param public_ip_address: The reference of the public IP resource. - :type public_ip_address: ~azure.mgmt.network.v2017_08_01.models.SubResource - :ivar provisioning_state: The provisioning state of the public IP resource. Possible values - are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'private_ip_allocation_method': {'key': 'properties.privateIPAllocationMethod', 'type': 'str'}, - 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, - 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - private_ip_allocation_method: Optional[Union[str, "IPAllocationMethod"]] = None, - subnet: Optional["SubResource"] = None, - public_ip_address: Optional["SubResource"] = None, - **kwargs - ): - super(VirtualNetworkGatewayIPConfiguration, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.private_ip_allocation_method = private_ip_allocation_method - self.subnet = subnet - self.public_ip_address = public_ip_address - self.provisioning_state = None - - -class VirtualNetworkGatewayListConnectionsResult(msrest.serialization.Model): - """Response for the VirtualNetworkGatewayListConnections API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: Gets a list of VirtualNetworkGatewayConnection resources that exists in a - resource group. - :type value: - list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionListEntity] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkGatewayConnectionListEntity]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualNetworkGatewayConnectionListEntity"]] = None, - **kwargs - ): - super(VirtualNetworkGatewayListConnectionsResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class VirtualNetworkGatewayListResult(msrest.serialization.Model): - """Response for the ListVirtualNetworkGateways API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param value: Gets a list of VirtualNetworkGateway resources that exists in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkGateway]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualNetworkGateway"]] = None, - **kwargs - ): - super(VirtualNetworkGatewayListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class VirtualNetworkGatewaySku(msrest.serialization.Model): - """VirtualNetworkGatewaySku details. - - :param name: Gateway SKU name. Possible values include: "Basic", "HighPerformance", "Standard", - "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3". - :type name: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewaySkuName - :param tier: Gateway SKU tier. Possible values include: "Basic", "HighPerformance", "Standard", - "UltraPerformance", "VpnGw1", "VpnGw2", "VpnGw3". - :type tier: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewaySkuTier - :param capacity: The capacity. - :type capacity: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, - } - - def __init__( - self, - *, - name: Optional[Union[str, "VirtualNetworkGatewaySkuName"]] = None, - tier: Optional[Union[str, "VirtualNetworkGatewaySkuTier"]] = None, - capacity: Optional[int] = None, - **kwargs - ): - super(VirtualNetworkGatewaySku, self).__init__(**kwargs) - self.name = name - self.tier = tier - self.capacity = capacity - - -class VirtualNetworkListResult(msrest.serialization.Model): - """Response for the ListVirtualNetworks API service call. - - :param value: Gets a list of VirtualNetwork resources in a resource group. - :type value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetwork] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetwork]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualNetwork"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(VirtualNetworkListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class VirtualNetworkListUsageResult(msrest.serialization.Model): - """Response for the virtual networks GetUsage API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: VirtualNetwork usage stats. - :vartype value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkUsage] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkUsage]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - next_link: Optional[str] = None, - **kwargs - ): - super(VirtualNetworkListUsageResult, self).__init__(**kwargs) - self.value = None - self.next_link = next_link - - -class VirtualNetworkPeering(SubResource): - """Peerings in a virtual network resource. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param allow_virtual_network_access: Whether the VMs in the linked virtual network space would - be able to access all the VMs in local Virtual network space. - :type allow_virtual_network_access: bool - :param allow_forwarded_traffic: Whether the forwarded traffic from the VMs in the remote - virtual network will be allowed/disallowed. - :type allow_forwarded_traffic: bool - :param allow_gateway_transit: If gateway links can be used in remote virtual networking to link - to this virtual network. - :type allow_gateway_transit: bool - :param use_remote_gateways: If remote gateways can be used on this virtual network. If the flag - is set to true, and allowGatewayTransit on remote peering is also true, virtual network will - use gateways of remote virtual network for transit. Only one peering can have this flag set to - true. This flag cannot be set if virtual network already has a gateway. - :type use_remote_gateways: bool - :param remote_virtual_network: The reference of the remote virtual network. - :type remote_virtual_network: ~azure.mgmt.network.v2017_08_01.models.SubResource - :param peering_state: The status of the virtual network peering. Possible values are - 'Initiated', 'Connected', and 'Disconnected'. Possible values include: "Initiated", - "Connected", "Disconnected". - :type peering_state: str or ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeeringState - :param provisioning_state: The provisioning state of the resource. - :type provisioning_state: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'allow_virtual_network_access': {'key': 'properties.allowVirtualNetworkAccess', 'type': 'bool'}, - 'allow_forwarded_traffic': {'key': 'properties.allowForwardedTraffic', 'type': 'bool'}, - 'allow_gateway_transit': {'key': 'properties.allowGatewayTransit', 'type': 'bool'}, - 'use_remote_gateways': {'key': 'properties.useRemoteGateways', 'type': 'bool'}, - 'remote_virtual_network': {'key': 'properties.remoteVirtualNetwork', 'type': 'SubResource'}, - 'peering_state': {'key': 'properties.peeringState', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - allow_virtual_network_access: Optional[bool] = None, - allow_forwarded_traffic: Optional[bool] = None, - allow_gateway_transit: Optional[bool] = None, - use_remote_gateways: Optional[bool] = None, - remote_virtual_network: Optional["SubResource"] = None, - peering_state: Optional[Union[str, "VirtualNetworkPeeringState"]] = None, - provisioning_state: Optional[str] = None, - **kwargs - ): - super(VirtualNetworkPeering, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.allow_virtual_network_access = allow_virtual_network_access - self.allow_forwarded_traffic = allow_forwarded_traffic - self.allow_gateway_transit = allow_gateway_transit - self.use_remote_gateways = use_remote_gateways - self.remote_virtual_network = remote_virtual_network - self.peering_state = peering_state - self.provisioning_state = provisioning_state - - -class VirtualNetworkPeeringListResult(msrest.serialization.Model): - """Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. - - :param value: The peerings in a virtual network. - :type value: list[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering] - :param next_link: The URL to get the next set of results. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[VirtualNetworkPeering]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["VirtualNetworkPeering"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(VirtualNetworkPeeringListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class VirtualNetworkUsage(msrest.serialization.Model): - """Usage details for subnet. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_value: Indicates number of IPs used from the Subnet. - :vartype current_value: float - :ivar id: Subnet identifier. - :vartype id: str - :ivar limit: Indicates the size of the subnet. - :vartype limit: float - :ivar name: The name containing common and localized value for usage. - :vartype name: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkUsageName - :ivar unit: Usage units. Returns 'Count'. - :vartype unit: str - """ - - _validation = { - 'current_value': {'readonly': True}, - 'id': {'readonly': True}, - 'limit': {'readonly': True}, - 'name': {'readonly': True}, - 'unit': {'readonly': True}, - } - - _attribute_map = { - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'id': {'key': 'id', 'type': 'str'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'name': {'key': 'name', 'type': 'VirtualNetworkUsageName'}, - 'unit': {'key': 'unit', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkUsage, self).__init__(**kwargs) - self.current_value = None - self.id = None - self.limit = None - self.name = None - self.unit = None - - -class VirtualNetworkUsageName(msrest.serialization.Model): - """Usage strings container. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar localized_value: Localized subnet size and usage string. - :vartype localized_value: str - :ivar value: Subnet size and usage string. - :vartype value: str - """ - - _validation = { - 'localized_value': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VirtualNetworkUsageName, self).__init__(**kwargs) - self.localized_value = None - self.value = None - - -class VpnClientConfiguration(msrest.serialization.Model): - """VpnClientConfiguration for P2S client. - - :param vpn_client_address_pool: The reference of the address space resource which represents - Address space for P2S VpnClient. - :type vpn_client_address_pool: ~azure.mgmt.network.v2017_08_01.models.AddressSpace - :param vpn_client_root_certificates: VpnClientRootCertificate for virtual network gateway. - :type vpn_client_root_certificates: - list[~azure.mgmt.network.v2017_08_01.models.VpnClientRootCertificate] - :param vpn_client_revoked_certificates: VpnClientRevokedCertificate for Virtual network - gateway. - :type vpn_client_revoked_certificates: - list[~azure.mgmt.network.v2017_08_01.models.VpnClientRevokedCertificate] - :param vpn_client_protocols: VpnClientProtocols for Virtual network gateway. - :type vpn_client_protocols: list[str or - ~azure.mgmt.network.v2017_08_01.models.VpnClientProtocol] - :param radius_server_address: The radius server address property of the VirtualNetworkGateway - resource for vpn client connection. - :type radius_server_address: str - :param radius_server_secret: The radius secret property of the VirtualNetworkGateway resource - for vpn client connection. - :type radius_server_secret: str - """ - - _attribute_map = { - 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, - 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, - 'vpn_client_revoked_certificates': {'key': 'vpnClientRevokedCertificates', 'type': '[VpnClientRevokedCertificate]'}, - 'vpn_client_protocols': {'key': 'vpnClientProtocols', 'type': '[str]'}, - 'radius_server_address': {'key': 'radiusServerAddress', 'type': 'str'}, - 'radius_server_secret': {'key': 'radiusServerSecret', 'type': 'str'}, - } - - def __init__( - self, - *, - vpn_client_address_pool: Optional["AddressSpace"] = None, - vpn_client_root_certificates: Optional[List["VpnClientRootCertificate"]] = None, - vpn_client_revoked_certificates: Optional[List["VpnClientRevokedCertificate"]] = None, - vpn_client_protocols: Optional[List[Union[str, "VpnClientProtocol"]]] = None, - radius_server_address: Optional[str] = None, - radius_server_secret: Optional[str] = None, - **kwargs - ): - super(VpnClientConfiguration, self).__init__(**kwargs) - self.vpn_client_address_pool = vpn_client_address_pool - self.vpn_client_root_certificates = vpn_client_root_certificates - self.vpn_client_revoked_certificates = vpn_client_revoked_certificates - self.vpn_client_protocols = vpn_client_protocols - self.radius_server_address = radius_server_address - self.radius_server_secret = radius_server_secret - - -class VpnClientParameters(msrest.serialization.Model): - """Vpn Client Parameters for package generation. - - :param processor_architecture: VPN client Processor Architecture. Possible values are: 'AMD64' - and 'X86'. Possible values include: "Amd64", "X86". - :type processor_architecture: str or - ~azure.mgmt.network.v2017_08_01.models.ProcessorArchitecture - :param authentication_method: VPN client Authentication Method. Possible values are: 'EAPTLS' - and 'EAPMSCHAPv2'. Possible values include: "EAPTLS", "EAPMSCHAPv2". - :type authentication_method: str or ~azure.mgmt.network.v2017_08_01.models.AuthenticationMethod - :param radius_server_auth_certificate: 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. - :type radius_server_auth_certificate: str - :param client_root_certificates: A list of client root certificates public certificate data - encoded as Base-64 strings. Optional parameter for external radius based authentication with - EAPTLS. - :type client_root_certificates: list[str] - """ - - _attribute_map = { - 'processor_architecture': {'key': 'processorArchitecture', 'type': 'str'}, - 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, - 'radius_server_auth_certificate': {'key': 'radiusServerAuthCertificate', 'type': 'str'}, - 'client_root_certificates': {'key': 'clientRootCertificates', 'type': '[str]'}, - } - - def __init__( - self, - *, - processor_architecture: Optional[Union[str, "ProcessorArchitecture"]] = None, - authentication_method: Optional[Union[str, "AuthenticationMethod"]] = None, - radius_server_auth_certificate: Optional[str] = None, - client_root_certificates: Optional[List[str]] = None, - **kwargs - ): - super(VpnClientParameters, self).__init__(**kwargs) - self.processor_architecture = processor_architecture - self.authentication_method = authentication_method - self.radius_server_auth_certificate = radius_server_auth_certificate - self.client_root_certificates = client_root_certificates - - -class VpnClientRevokedCertificate(SubResource): - """VPN client revoked certificate of virtual network gateway. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param thumbprint: The revoked VPN client certificate thumbprint. - :type thumbprint: str - :ivar provisioning_state: The provisioning state of the VPN client revoked certificate - resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - thumbprint: Optional[str] = None, - **kwargs - ): - super(VpnClientRevokedCertificate, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.thumbprint = thumbprint - self.provisioning_state = None - - -class VpnClientRootCertificate(SubResource): - """VPN client root certificate of virtual network gateway. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :param id: Resource ID. - :type id: str - :param name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :type name: str - :param etag: A unique read-only string that changes whenever the resource is updated. - :type etag: str - :param public_cert_data: Required. The certificate public data. - :type public_cert_data: str - :ivar provisioning_state: The provisioning state of the VPN client root certificate resource. - Possible values are: 'Updating', 'Deleting', and 'Failed'. - :vartype provisioning_state: str - """ - - _validation = { - 'public_cert_data': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'public_cert_data': {'key': 'properties.publicCertData', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - public_cert_data: str, - id: Optional[str] = None, - name: Optional[str] = None, - etag: Optional[str] = None, - **kwargs - ): - super(VpnClientRootCertificate, self).__init__(id=id, **kwargs) - self.name = name - self.etag = etag - self.public_cert_data = public_cert_data - self.provisioning_state = None diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_network_management_client_enums.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_network_management_client_enums.py deleted file mode 100644 index db6b5c4fce88..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/_network_management_client_enums.py +++ /dev/null @@ -1,623 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class Access(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates whether the traffic is allowed or denied. - """ - - ALLOW = "Allow" - DENY = "Deny" - -class ApplicationGatewayBackendHealthServerHealth(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Health of backend server. - """ - - UNKNOWN = "Unknown" - UP = "Up" - DOWN = "Down" - PARTIAL = "Partial" - DRAINING = "Draining" - -class ApplicationGatewayCookieBasedAffinity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Cookie based affinity. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ApplicationGatewayFirewallMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Web application firewall mode. - """ - - DETECTION = "Detection" - PREVENTION = "Prevention" - -class ApplicationGatewayOperationalState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Operational state of the application gateway resource. - """ - - STOPPED = "Stopped" - STARTING = "Starting" - RUNNING = "Running" - STOPPING = "Stopping" - -class ApplicationGatewayProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Protocol. - """ - - HTTP = "Http" - HTTPS = "Https" - -class ApplicationGatewayRedirectType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - PERMANENT = "Permanent" - FOUND = "Found" - SEE_OTHER = "SeeOther" - TEMPORARY = "Temporary" - -class ApplicationGatewayRequestRoutingRuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Rule type. - """ - - BASIC = "Basic" - PATH_BASED_ROUTING = "PathBasedRouting" - -class ApplicationGatewaySkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of an application gateway SKU. - """ - - STANDARD_SMALL = "Standard_Small" - STANDARD_MEDIUM = "Standard_Medium" - STANDARD_LARGE = "Standard_Large" - WAF_MEDIUM = "WAF_Medium" - WAF_LARGE = "WAF_Large" - -class ApplicationGatewaySslCipherSuite(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Ssl cipher suites enums. - """ - - TLS_ECDHE_RSA_WITH_AES256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - TLS_ECDHE_RSA_WITH_AES128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - TLS_ECDHE_RSA_WITH_AES256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - TLS_ECDHE_RSA_WITH_AES128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - TLS_DHE_RSA_WITH_AES256_GCM_SHA384 = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - TLS_DHE_RSA_WITH_AES128_GCM_SHA256 = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - TLS_DHE_RSA_WITH_AES256_CBC_SHA = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - TLS_DHE_RSA_WITH_AES128_CBC_SHA = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - TLS_RSA_WITH_AES256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" - TLS_RSA_WITH_AES128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" - TLS_RSA_WITH_AES256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" - TLS_RSA_WITH_AES128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" - TLS_RSA_WITH_AES256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" - TLS_RSA_WITH_AES128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" - TLS_ECDHE_ECDSA_WITH_AES256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - TLS_ECDHE_ECDSA_WITH_AES128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - TLS_ECDHE_ECDSA_WITH_AES256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - TLS_ECDHE_ECDSA_WITH_AES128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - TLS_ECDHE_ECDSA_WITH_AES256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - TLS_ECDHE_ECDSA_WITH_AES128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - TLS_DHE_DSS_WITH_AES256_CBC_SHA256 = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - TLS_DHE_DSS_WITH_AES128_CBC_SHA256 = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - TLS_DHE_DSS_WITH_AES256_CBC_SHA = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - TLS_DHE_DSS_WITH_AES128_CBC_SHA = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - TLS_RSA_WITH3_DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" - TLS_DHE_DSS_WITH3_DES_EDE_CBC_SHA = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - TLS_ECDHE_RSA_WITH_AES128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - TLS_ECDHE_RSA_WITH_AES256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - -class ApplicationGatewaySslPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Ssl predefined policy name enums. - """ - - APP_GW_SSL_POLICY20150501 = "AppGwSslPolicy20150501" - APP_GW_SSL_POLICY20170401 = "AppGwSslPolicy20170401" - APP_GW_SSL_POLICY20170401_S = "AppGwSslPolicy20170401S" - -class ApplicationGatewaySslPolicyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of Ssl Policy - """ - - PREDEFINED = "Predefined" - CUSTOM = "Custom" - -class ApplicationGatewaySslProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Ssl protocol enums. - """ - - TL_SV1_0 = "TLSv1_0" - TL_SV1_1 = "TLSv1_1" - TL_SV1_2 = "TLSv1_2" - -class ApplicationGatewayTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Tier of an application gateway. - """ - - STANDARD = "Standard" - WAF = "WAF" - -class AssociationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The association type of the child resource to the parent resource. - """ - - ASSOCIATED = "Associated" - CONTAINS = "Contains" - -class AuthenticationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """VPN client Authentication Method. Possible values are: 'EAPTLS' and 'EAPMSCHAPv2'. - """ - - EAPTLS = "EAPTLS" - EAPMSCHA_PV2 = "EAPMSCHAPv2" - -class AuthorizationUseStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """AuthorizationUseStatus. Possible values are: 'Available' and 'InUse'. - """ - - AVAILABLE = "Available" - IN_USE = "InUse" - -class BgpPeerState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The BGP peer state - """ - - UNKNOWN = "Unknown" - STOPPED = "Stopped" - IDLE = "Idle" - CONNECTING = "Connecting" - CONNECTED = "Connected" - -class ConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The connection status. - """ - - UNKNOWN = "Unknown" - CONNECTED = "Connected" - DISCONNECTED = "Disconnected" - DEGRADED = "Degraded" - -class DhGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The DH Groups used in IKE Phase 1 for initial SA. - """ - - NONE = "None" - DH_GROUP1 = "DHGroup1" - DH_GROUP2 = "DHGroup2" - DH_GROUP14 = "DHGroup14" - DH_GROUP2048 = "DHGroup2048" - ECP256 = "ECP256" - ECP384 = "ECP384" - DH_GROUP24 = "DHGroup24" - -class Direction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The direction of the packet represented as a 5-tuple. - """ - - INBOUND = "Inbound" - OUTBOUND = "Outbound" - -class EffectiveRouteSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Who created the route. Possible values are: 'Unknown', 'User', 'VirtualNetworkGateway', and - 'Default'. - """ - - UNKNOWN = "Unknown" - USER = "User" - VIRTUAL_NETWORK_GATEWAY = "VirtualNetworkGateway" - DEFAULT = "Default" - -class EffectiveRouteState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The value of effective route. Possible values are: 'Active' and 'Invalid'. - """ - - ACTIVE = "Active" - INVALID = "Invalid" - -class EffectiveSecurityRuleProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The network protocol this rule applies to. Possible values are: 'Tcp', 'Udp', and 'All'. - """ - - TCP = "Tcp" - UDP = "Udp" - ALL = "All" - -class ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """AdvertisedPublicPrefixState of the Peering resource. Possible values are 'NotConfigured', - 'Configuring', 'Configured', and 'ValidationNeeded'. - """ - - NOT_CONFIGURED = "NotConfigured" - CONFIGURING = "Configuring" - CONFIGURED = "Configured" - VALIDATION_NEEDED = "ValidationNeeded" - -class ExpressRouteCircuitPeeringState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The state of peering. Possible values are: 'Disabled' and 'Enabled' - """ - - DISABLED = "Disabled" - ENABLED = "Enabled" - -class ExpressRouteCircuitPeeringType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The PeeringType. Possible values are: 'AzurePublicPeering', 'AzurePrivatePeering', and - 'MicrosoftPeering'. - """ - - AZURE_PUBLIC_PEERING = "AzurePublicPeering" - AZURE_PRIVATE_PEERING = "AzurePrivatePeering" - MICROSOFT_PEERING = "MicrosoftPeering" - -class ExpressRouteCircuitSkuFamily(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The family of the SKU. Possible values are: 'UnlimitedData' and 'MeteredData'. - """ - - UNLIMITED_DATA = "UnlimitedData" - METERED_DATA = "MeteredData" - -class ExpressRouteCircuitSkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The tier of the SKU. Possible values are 'Standard' and 'Premium'. - """ - - STANDARD = "Standard" - PREMIUM = "Premium" - -class IkeEncryption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The IKE encryption algorithm (IKE phase 2). - """ - - DES = "DES" - DES3 = "DES3" - AES128 = "AES128" - AES192 = "AES192" - AES256 = "AES256" - -class IkeIntegrity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The IKE integrity algorithm (IKE phase 2). - """ - - MD5 = "MD5" - SHA1 = "SHA1" - SHA256 = "SHA256" - SHA384 = "SHA384" - -class IPAllocationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """PrivateIP allocation method. - """ - - STATIC = "Static" - DYNAMIC = "Dynamic" - -class IpsecEncryption(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The IPSec encryption algorithm (IKE phase 1). - """ - - NONE = "None" - DES = "DES" - DES3 = "DES3" - AES128 = "AES128" - AES192 = "AES192" - AES256 = "AES256" - GCMAES128 = "GCMAES128" - GCMAES192 = "GCMAES192" - GCMAES256 = "GCMAES256" - -class IpsecIntegrity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The IPSec integrity algorithm (IKE phase 1). - """ - - MD5 = "MD5" - SHA1 = "SHA1" - SHA256 = "SHA256" - GCMAES128 = "GCMAES128" - GCMAES192 = "GCMAES192" - GCMAES256 = "GCMAES256" - -class IPVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """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'. - """ - - I_PV4 = "IPv4" - I_PV6 = "IPv6" - -class IssueType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of issue. - """ - - UNKNOWN = "Unknown" - AGENT_STOPPED = "AgentStopped" - GUEST_FIREWALL = "GuestFirewall" - DNS_RESOLUTION = "DnsResolution" - SOCKET_BIND = "SocketBind" - NETWORK_SECURITY_RULE = "NetworkSecurityRule" - USER_DEFINED_ROUTE = "UserDefinedRoute" - PORT_THROTTLED = "PortThrottled" - PLATFORM = "Platform" - -class LoadBalancerSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of a load balancer SKU. - """ - - BASIC = "Basic" - STANDARD = "Standard" - -class LoadDistribution(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The load distribution policy for this rule. Possible values are 'Default', 'SourceIP', and - 'SourceIPProtocol'. - """ - - DEFAULT = "Default" - SOURCE_IP = "SourceIP" - SOURCE_IP_PROTOCOL = "SourceIPProtocol" - -class NetworkOperationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and - 'Failed'. - """ - - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - -class NextHopType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Next hop type. - """ - - INTERNET = "Internet" - VIRTUAL_APPLIANCE = "VirtualAppliance" - VIRTUAL_NETWORK_GATEWAY = "VirtualNetworkGateway" - VNET_LOCAL = "VnetLocal" - HYPER_NET_GATEWAY = "HyperNetGateway" - NONE = "None" - -class Origin(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The origin of the issue. - """ - - LOCAL = "Local" - INBOUND = "Inbound" - OUTBOUND = "Outbound" - -class PcError(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - - INTERNAL_ERROR = "InternalError" - AGENT_STOPPED = "AgentStopped" - CAPTURE_FAILED = "CaptureFailed" - LOCAL_FILE_FAILED = "LocalFileFailed" - STORAGE_FAILED = "StorageFailed" - -class PcProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Protocol to be filtered on. - """ - - TCP = "TCP" - UDP = "UDP" - ANY = "Any" - -class PcStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the packet capture session. - """ - - NOT_STARTED = "NotStarted" - RUNNING = "Running" - STOPPED = "Stopped" - ERROR = "Error" - UNKNOWN = "Unknown" - -class PfsGroup(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The DH Groups used in IKE Phase 2 for new child SA. - """ - - NONE = "None" - PFS1 = "PFS1" - PFS2 = "PFS2" - PFS2048 = "PFS2048" - ECP256 = "ECP256" - ECP384 = "ECP384" - PFS24 = "PFS24" - -class ProbeProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The protocol of the end point. Possible values are: 'Http' or 'Tcp'. If 'Tcp' is specified, a - received ACK is required for the probe to be successful. If 'Http' is specified, a 200 OK - response from the specifies URI is required for the probe to be successful. - """ - - HTTP = "Http" - TCP = "Tcp" - -class ProcessorArchitecture(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """VPN client Processor Architecture. Possible values are: 'AMD64' and 'X86'. - """ - - AMD64 = "Amd64" - X86 = "X86" - -class Protocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Protocol to be verified on. - """ - - TCP = "TCP" - UDP = "UDP" - -class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The provisioning state of the resource. - """ - - SUCCEEDED = "Succeeded" - UPDATING = "Updating" - DELETING = "Deleting" - FAILED = "Failed" - -class PublicIPAddressSkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Name of a public IP address SKU. - """ - - BASIC = "Basic" - STANDARD = "Standard" - -class RouteFilterRuleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The rule type of the rule. Valid value is: 'Community' - """ - - COMMUNITY = "Community" - -class RouteNextHopType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of Azure hop the packet should be sent to. Possible values are: - 'VirtualNetworkGateway', 'VnetLocal', 'Internet', 'VirtualAppliance', and 'None'. - """ - - VIRTUAL_NETWORK_GATEWAY = "VirtualNetworkGateway" - VNET_LOCAL = "VnetLocal" - INTERNET = "Internet" - VIRTUAL_APPLIANCE = "VirtualAppliance" - NONE = "None" - -class SecurityRuleAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Whether network traffic is allowed or denied. Possible values are: 'Allow' and 'Deny'. - """ - - ALLOW = "Allow" - DENY = "Deny" - -class SecurityRuleDirection(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The direction of the rule. Possible values are: 'Inbound and Outbound'. - """ - - INBOUND = "Inbound" - OUTBOUND = "Outbound" - -class SecurityRuleProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Network protocol this rule applies to. Possible values are 'Tcp', 'Udp', and '*'. - """ - - TCP = "Tcp" - UDP = "Udp" - ASTERISK = "*" - -class ServiceProviderProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The ServiceProviderProvisioningState state of the resource. Possible values are - 'NotProvisioned', 'Provisioning', 'Provisioned', and 'Deprovisioning'. - """ - - NOT_PROVISIONED = "NotProvisioned" - PROVISIONING = "Provisioning" - PROVISIONED = "Provisioned" - DEPROVISIONING = "Deprovisioning" - -class Severity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The severity of the issue. - """ - - ERROR = "Error" - WARNING = "Warning" - -class TransportProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The transport protocol for the external endpoint. Possible values are 'Udp' or 'Tcp' - """ - - UDP = "Udp" - TCP = "Tcp" - -class UsageUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """An enum describing the unit of measurement. - """ - - COUNT = "Count" - -class VirtualNetworkGatewayConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Virtual network Gateway connection status - """ - - UNKNOWN = "Unknown" - CONNECTING = "Connecting" - CONNECTED = "Connected" - NOT_CONNECTED = "NotConnected" - -class VirtualNetworkGatewayConnectionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Gateway connection type. Possible values are: 'IPsec','Vnet2Vnet','ExpressRoute', and - 'VPNClient. - """ - - I_PSEC = "IPsec" - VNET2_VNET = "Vnet2Vnet" - EXPRESS_ROUTE = "ExpressRoute" - VPN_CLIENT = "VPNClient" - -class VirtualNetworkGatewaySkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Gateway SKU name. - """ - - BASIC = "Basic" - HIGH_PERFORMANCE = "HighPerformance" - STANDARD = "Standard" - ULTRA_PERFORMANCE = "UltraPerformance" - VPN_GW1 = "VpnGw1" - VPN_GW2 = "VpnGw2" - VPN_GW3 = "VpnGw3" - -class VirtualNetworkGatewaySkuTier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Gateway SKU tier. - """ - - BASIC = "Basic" - HIGH_PERFORMANCE = "HighPerformance" - STANDARD = "Standard" - ULTRA_PERFORMANCE = "UltraPerformance" - VPN_GW1 = "VpnGw1" - VPN_GW2 = "VpnGw2" - VPN_GW3 = "VpnGw3" - -class VirtualNetworkGatewayType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of this virtual network gateway. Possible values are: 'Vpn' and 'ExpressRoute'. - """ - - VPN = "Vpn" - EXPRESS_ROUTE = "ExpressRoute" - -class VirtualNetworkPeeringState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the virtual network peering. Possible values are 'Initiated', 'Connected', and - 'Disconnected'. - """ - - INITIATED = "Initiated" - CONNECTED = "Connected" - DISCONNECTED = "Disconnected" - -class VpnClientProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """VPN client protocol enabled for the virtual network gateway. - """ - - IKE_V2 = "IkeV2" - SSTP = "SSTP" - -class VpnType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of this virtual network gateway. Possible values are: 'PolicyBased' and 'RouteBased'. - """ - - POLICY_BASED = "PolicyBased" - ROUTE_BASED = "RouteBased" diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/__init__.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/__init__.py deleted file mode 100644 index cca1cde6acc2..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/__init__.py +++ /dev/null @@ -1,81 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._application_gateways_operations import ApplicationGatewaysOperations -from ._network_management_client_operations import NetworkManagementClientOperationsMixin -from ._available_endpoint_services_operations import AvailableEndpointServicesOperations -from ._express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations -from ._express_route_circuit_peerings_operations import ExpressRouteCircuitPeeringsOperations -from ._express_route_circuits_operations import ExpressRouteCircuitsOperations -from ._express_route_service_providers_operations import ExpressRouteServiceProvidersOperations -from ._load_balancers_operations import LoadBalancersOperations -from ._load_balancer_backend_address_pools_operations import LoadBalancerBackendAddressPoolsOperations -from ._load_balancer_frontend_ip_configurations_operations import LoadBalancerFrontendIPConfigurationsOperations -from ._inbound_nat_rules_operations import InboundNatRulesOperations -from ._load_balancer_load_balancing_rules_operations import LoadBalancerLoadBalancingRulesOperations -from ._load_balancer_network_interfaces_operations import LoadBalancerNetworkInterfacesOperations -from ._load_balancer_probes_operations import LoadBalancerProbesOperations -from ._network_interfaces_operations import NetworkInterfacesOperations -from ._network_interface_ip_configurations_operations import NetworkInterfaceIPConfigurationsOperations -from ._network_interface_load_balancers_operations import NetworkInterfaceLoadBalancersOperations -from ._network_security_groups_operations import NetworkSecurityGroupsOperations -from ._security_rules_operations import SecurityRulesOperations -from ._default_security_rules_operations import DefaultSecurityRulesOperations -from ._network_watchers_operations import NetworkWatchersOperations -from ._packet_captures_operations import PacketCapturesOperations -from ._public_ip_addresses_operations import PublicIPAddressesOperations -from ._route_filters_operations import RouteFiltersOperations -from ._route_filter_rules_operations import RouteFilterRulesOperations -from ._route_tables_operations import RouteTablesOperations -from ._routes_operations import RoutesOperations -from ._bgp_service_communities_operations import BgpServiceCommunitiesOperations -from ._usages_operations import UsagesOperations -from ._virtual_networks_operations import VirtualNetworksOperations -from ._subnets_operations import SubnetsOperations -from ._virtual_network_peerings_operations import VirtualNetworkPeeringsOperations -from ._virtual_network_gateways_operations import VirtualNetworkGatewaysOperations -from ._virtual_network_gateway_connections_operations import VirtualNetworkGatewayConnectionsOperations -from ._local_network_gateways_operations import LocalNetworkGatewaysOperations - -__all__ = [ - 'ApplicationGatewaysOperations', - 'NetworkManagementClientOperationsMixin', - 'AvailableEndpointServicesOperations', - 'ExpressRouteCircuitAuthorizationsOperations', - 'ExpressRouteCircuitPeeringsOperations', - 'ExpressRouteCircuitsOperations', - 'ExpressRouteServiceProvidersOperations', - 'LoadBalancersOperations', - 'LoadBalancerBackendAddressPoolsOperations', - 'LoadBalancerFrontendIPConfigurationsOperations', - 'InboundNatRulesOperations', - 'LoadBalancerLoadBalancingRulesOperations', - 'LoadBalancerNetworkInterfacesOperations', - 'LoadBalancerProbesOperations', - 'NetworkInterfacesOperations', - 'NetworkInterfaceIPConfigurationsOperations', - 'NetworkInterfaceLoadBalancersOperations', - 'NetworkSecurityGroupsOperations', - 'SecurityRulesOperations', - 'DefaultSecurityRulesOperations', - 'NetworkWatchersOperations', - 'PacketCapturesOperations', - 'PublicIPAddressesOperations', - 'RouteFiltersOperations', - 'RouteFilterRulesOperations', - 'RouteTablesOperations', - 'RoutesOperations', - 'BgpServiceCommunitiesOperations', - 'UsagesOperations', - 'VirtualNetworksOperations', - 'SubnetsOperations', - 'VirtualNetworkPeeringsOperations', - 'VirtualNetworkGatewaysOperations', - 'VirtualNetworkGatewayConnectionsOperations', - 'LocalNetworkGatewaysOperations', -] diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_application_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_application_gateways_operations.py deleted file mode 100644 index 05c415346c5e..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_application_gateways_operations.py +++ /dev/null @@ -1,1048 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ApplicationGatewaysOperations(object): - """ApplicationGatewaysOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified application gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ApplicationGateway" - """Gets the specified application gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGateway - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - parameters, # type: "_models.ApplicationGateway" - **kwargs # type: Any - ): - # type: (...) -> "_models.ApplicationGateway" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ApplicationGateway') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ApplicationGateway', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ApplicationGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - parameters, # type: "_models.ApplicationGateway" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ApplicationGateway"] - """Creates or updates the specified application gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :param parameters: Parameters supplied to the create or update application gateway operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ApplicationGateway - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ApplicationGateway or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ApplicationGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGateway"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ApplicationGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] - """Lists all application gateways in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGatewayListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationGatewayListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways'} # type: ignore - - def list_all( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ApplicationGatewayListResult"] - """Gets all the application gateways in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGatewayListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationGatewayListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways'} # type: ignore - - def _start_initial( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._start_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _start_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} # type: ignore - - def begin_start( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Starts the specified application gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._start_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start'} # type: ignore - - def _stop_initial( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} # type: ignore - - def begin_stop( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Stops the specified application gateway in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop'} # type: ignore - - def _backend_health_initial( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ApplicationGatewayBackendHealth"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ApplicationGatewayBackendHealth"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self._backend_health_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ApplicationGatewayBackendHealth', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _backend_health_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} # type: ignore - - def begin_backend_health( - self, - resource_group_name, # type: str - application_gateway_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ApplicationGatewayBackendHealth"] - """Gets the backend health of the specified application gateway in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param application_gateway_name: The name of the application gateway. - :type application_gateway_name: str - :param expand: Expands BackendAddressPool and BackendHttpSettings referenced in backend health. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ApplicationGatewayBackendHealth or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayBackendHealth] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayBackendHealth"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._backend_health_initial( - resource_group_name=resource_group_name, - application_gateway_name=application_gateway_name, - expand=expand, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ApplicationGatewayBackendHealth', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'applicationGatewayName': self._serialize.url("application_gateway_name", application_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_backend_health.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth'} # type: ignore - - def list_available_waf_rule_sets( - self, - **kwargs # type: Any - ): - # type: (...) -> "_models.ApplicationGatewayAvailableWafRuleSetsResult" - """Lists all available web application firewall rule sets. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGatewayAvailableWafRuleSetsResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableWafRuleSetsResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableWafRuleSetsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.list_available_waf_rule_sets.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGatewayAvailableWafRuleSetsResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_available_waf_rule_sets.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets'} # type: ignore - - def list_available_ssl_options( - self, - **kwargs # type: Any - ): - # type: (...) -> "_models.ApplicationGatewayAvailableSslOptions" - """Lists available Ssl options for configuring Ssl policy. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGatewayAvailableSslOptions, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableSslOptions - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslOptions"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.list_available_ssl_options.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGatewayAvailableSslOptions', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list_available_ssl_options.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default'} # type: ignore - - def list_available_ssl_predefined_policies( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] - """Lists all SSL predefined policies for configuring Ssl policy. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationGatewayAvailableSslPredefinedPolicies or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayAvailableSslPredefinedPolicies] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewayAvailableSslPredefinedPolicies"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_available_ssl_predefined_policies.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ApplicationGatewayAvailableSslPredefinedPolicies', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_available_ssl_predefined_policies.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies'} # type: ignore - - def get_ssl_predefined_policy( - self, - predefined_policy_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ApplicationGatewaySslPredefinedPolicy" - """Gets Ssl predefined policy with the specified policy name. - - :param predefined_policy_name: Name of Ssl predefined policy. - :type predefined_policy_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationGatewaySslPredefinedPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ApplicationGatewaySslPredefinedPolicy - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationGatewaySslPredefinedPolicy"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.get_ssl_predefined_policy.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'predefinedPolicyName': self._serialize.url("predefined_policy_name", predefined_policy_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationGatewaySslPredefinedPolicy', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_ssl_predefined_policy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_available_endpoint_services_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_available_endpoint_services_operations.py deleted file mode 100644 index c4171bf78c42..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_available_endpoint_services_operations.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class AvailableEndpointServicesOperations(object): - """AvailableEndpointServicesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.EndpointServicesListResult"] - """List what values of endpoint services are available for use. - - :param location: The location to check available endpoint services. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either EndpointServicesListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.EndpointServicesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EndpointServicesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('EndpointServicesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_bgp_service_communities_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_bgp_service_communities_operations.py deleted file mode 100644 index a8c648324ca8..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_bgp_service_communities_operations.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class BgpServiceCommunitiesOperations(object): - """BgpServiceCommunitiesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.BgpServiceCommunityListResult"] - """Gets all the available bgp service communities. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BgpServiceCommunityListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.BgpServiceCommunityListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpServiceCommunityListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('BgpServiceCommunityListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/bgpServiceCommunities'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_default_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_default_security_rules_operations.py deleted file mode 100644 index 635960a5088e..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_default_security_rules_operations.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class DefaultSecurityRulesOperations(object): - """DefaultSecurityRulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SecurityRuleListResult"] - """Gets all default security rules in a network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SecurityRuleListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.SecurityRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SecurityRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules'} # type: ignore - - def get( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - default_security_rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.SecurityRule" - """Get the specified default network security rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param default_security_rule_name: The name of the default security rule. - :type default_security_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'defaultSecurityRuleName': self._serialize.url("default_security_rule_name", default_security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_authorizations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_authorizations_operations.py deleted file mode 100644 index b4700138ba1b..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_authorizations_operations.py +++ /dev/null @@ -1,439 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ExpressRouteCircuitAuthorizationsOperations(object): - """ExpressRouteCircuitAuthorizationsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - circuit_name, # type: str - authorization_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - circuit_name, # type: str - authorization_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified authorization from the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param authorization_name: The name of the authorization. - :type authorization_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - authorization_name=authorization_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - circuit_name, # type: str - authorization_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExpressRouteCircuitAuthorization" - """Gets the specified authorization from the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param authorization_name: The name of the authorization. - :type authorization_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuitAuthorization, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - circuit_name, # type: str - authorization_name, # type: str - authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" - **kwargs # type: Any - ): - # type: (...) -> "_models.ExpressRouteCircuitAuthorization" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(authorization_parameters, 'ExpressRouteCircuitAuthorization') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - circuit_name, # type: str - authorization_name, # type: str - authorization_parameters, # type: "_models.ExpressRouteCircuitAuthorization" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExpressRouteCircuitAuthorization"] - """Creates or updates an authorization in the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param authorization_name: The name of the authorization. - :type authorization_name: str - :param authorization_parameters: Parameters supplied to the create or update express route - circuit authorization operation. - :type authorization_parameters: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ExpressRouteCircuitAuthorization or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitAuthorization] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitAuthorization"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - authorization_name=authorization_name, - authorization_parameters=authorization_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitAuthorization', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'authorizationName': self._serialize.url("authorization_name", authorization_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - circuit_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.AuthorizationListResult"] - """Gets all authorizations in an express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AuthorizationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.AuthorizationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('AuthorizationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_peerings_operations.py deleted file mode 100644 index 3bd1fb53d0a4..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuit_peerings_operations.py +++ /dev/null @@ -1,439 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ExpressRouteCircuitPeeringsOperations(object): - """ExpressRouteCircuitPeeringsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified peering from the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExpressRouteCircuitPeering" - """Gets the specified authorization from the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuitPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - peering_parameters, # type: "_models.ExpressRouteCircuitPeering" - **kwargs # type: Any - ): - # type: (...) -> "_models.ExpressRouteCircuitPeering" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(peering_parameters, 'ExpressRouteCircuitPeering') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - peering_parameters, # type: "_models.ExpressRouteCircuitPeering" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"] - """Creates or updates a peering in the specified express route circuits. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :param peering_parameters: Parameters supplied to the create or update express route circuit - peering operation. - :type peering_parameters: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeering] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeering"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - peering_parameters=peering_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - circuit_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExpressRouteCircuitPeeringListResult"] - """Gets all peerings in a specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressRouteCircuitPeeringListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitPeeringListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitPeeringListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitPeeringListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuits_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuits_operations.py deleted file mode 100644 index d6dc663a189c..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_circuits_operations.py +++ /dev/null @@ -1,1004 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ExpressRouteCircuitsOperations(object): - """ExpressRouteCircuitsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - circuit_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - circuit_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - circuit_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExpressRouteCircuit" - """Gets information about the specified express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of express route circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuit, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - circuit_name, # type: str - parameters, # type: "_models.ExpressRouteCircuit" - **kwargs # type: Any - ): - # type: (...) -> "_models.ExpressRouteCircuit" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ExpressRouteCircuit') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - circuit_name, # type: str - parameters, # type: "_models.ExpressRouteCircuit" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExpressRouteCircuit"] - """Creates or updates an express route circuit. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the circuit. - :type circuit_name: str - :param parameters: Parameters supplied to the create or update express route circuit operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ExpressRouteCircuit or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuit] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuit"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuit', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}'} # type: ignore - - def _list_arp_table_initial( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - device_path, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExpressRouteCircuitsArpTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsArpTableListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._list_arp_table_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _list_arp_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore - - def begin_list_arp_table( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - device_path, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExpressRouteCircuitsArpTableListResult"] - """Gets the currently advertised ARP table associated with the express route circuit in a resource - group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :param device_path: The path of the device. - :type device_path: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ExpressRouteCircuitsArpTableListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsArpTableListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsArpTableListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._list_arp_table_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - device_path=device_path, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitsArpTableListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_list_arp_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}'} # type: ignore - - def _list_routes_table_initial( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - device_path, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._list_routes_table_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _list_routes_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore - - def begin_list_routes_table( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - device_path, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableListResult"] - """Gets the currently advertised routes table associated with the express route circuit in a - resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :param device_path: The path of the device. - :type device_path: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ExpressRouteCircuitsRoutesTableListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._list_routes_table_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - device_path=device_path, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_list_routes_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}'} # type: ignore - - def _list_routes_table_summary_initial( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - device_path, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._list_routes_table_summary_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _list_routes_table_summary_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore - - def begin_list_routes_table_summary( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - device_path, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - """Gets the currently advertised routes table summary associated with the express route circuit in - a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :param device_path: The path of the device. - :type device_path: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ExpressRouteCircuitsRoutesTableSummaryListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitsRoutesTableSummaryListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitsRoutesTableSummaryListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._list_routes_table_summary_initial( - resource_group_name=resource_group_name, - circuit_name=circuit_name, - peering_name=peering_name, - device_path=device_path, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitsRoutesTableSummaryListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'devicePath': self._serialize.url("device_path", device_path, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_list_routes_table_summary.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}'} # type: ignore - - def get_stats( - self, - resource_group_name, # type: str - circuit_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExpressRouteCircuitStats" - """Gets all the stats from an express route circuit in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuitStats, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get_stats.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuitStats', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats'} # type: ignore - - def get_peering_stats( - self, - resource_group_name, # type: str - circuit_name, # type: str - peering_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ExpressRouteCircuitStats" - """Gets all stats from an express route circuit in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param circuit_name: The name of the express route circuit. - :type circuit_name: str - :param peering_name: The name of the peering. - :type peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ExpressRouteCircuitStats, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitStats - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitStats"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get_peering_stats.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'), - 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ExpressRouteCircuitStats', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_peering_stats.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] - """Gets all the express route circuits in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressRouteCircuitListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits'} # type: ignore - - def list_all( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExpressRouteCircuitListResult"] - """Gets all the express route circuits in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressRouteCircuitListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteCircuitListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteCircuitListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExpressRouteCircuitListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_service_providers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_service_providers_operations.py deleted file mode 100644 index cdc524349dc5..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_express_route_service_providers_operations.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class ExpressRouteServiceProvidersOperations(object): - """ExpressRouteServiceProvidersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ExpressRouteServiceProviderListResult"] - """Gets all the available express route service providers. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressRouteServiceProviderListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.ExpressRouteServiceProviderListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressRouteServiceProviderListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('ExpressRouteServiceProviderListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_inbound_nat_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_inbound_nat_rules_operations.py deleted file mode 100644 index f6e9b94a4e5b..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_inbound_nat_rules_operations.py +++ /dev/null @@ -1,444 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class InboundNatRulesOperations(object): - """InboundNatRulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.InboundNatRuleListResult"] - """Gets all the inbound nat rules in a load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either InboundNatRuleListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.InboundNatRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('InboundNatRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - inbound_nat_rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - inbound_nat_rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified load balancer inbound nat rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param inbound_nat_rule_name: The name of the inbound nat rule. - :type inbound_nat_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - load_balancer_name=load_balancer_name, - inbound_nat_rule_name=inbound_nat_rule_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - inbound_nat_rule_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.InboundNatRule" - """Gets the specified load balancer inbound nat rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param inbound_nat_rule_name: The name of the inbound nat rule. - :type inbound_nat_rule_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: InboundNatRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.InboundNatRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('InboundNatRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "_models.InboundNatRule" - **kwargs # type: Any - ): - # type: (...) -> "_models.InboundNatRule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(inbound_nat_rule_parameters, 'InboundNatRule') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('InboundNatRule', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('InboundNatRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - inbound_nat_rule_name, # type: str - inbound_nat_rule_parameters, # type: "_models.InboundNatRule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.InboundNatRule"] - """Creates or updates a load balancer inbound nat rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param inbound_nat_rule_name: The name of the inbound nat rule. - :type inbound_nat_rule_name: str - :param inbound_nat_rule_parameters: Parameters supplied to the create or update inbound nat - rule operation. - :type inbound_nat_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.InboundNatRule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either InboundNatRule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.InboundNatRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.InboundNatRule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - load_balancer_name=load_balancer_name, - inbound_nat_rule_name=inbound_nat_rule_name, - inbound_nat_rule_parameters=inbound_nat_rule_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('InboundNatRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'inboundNatRuleName': self._serialize.url("inbound_nat_rule_name", inbound_nat_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_backend_address_pools_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_backend_address_pools_operations.py deleted file mode 100644 index a5193e1de003..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_backend_address_pools_operations.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerBackendAddressPoolsOperations(object): - """LoadBalancerBackendAddressPoolsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LoadBalancerBackendAddressPoolListResult"] - """Gets all the load balancer backed address pools. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerBackendAddressPoolListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerBackendAddressPoolListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerBackendAddressPoolListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerBackendAddressPoolListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools'} # type: ignore - - def get( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - backend_address_pool_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.BackendAddressPool" - """Gets load balancer backend address pool. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param backend_address_pool_name: The name of the backend address pool. - :type backend_address_pool_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: BackendAddressPool, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.BackendAddressPool - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendAddressPool"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'backendAddressPoolName': self._serialize.url("backend_address_pool_name", backend_address_pool_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('BackendAddressPool', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py deleted file mode 100644 index 55d3975a5c31..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_frontend_ip_configurations_operations.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerFrontendIPConfigurationsOperations(object): - """LoadBalancerFrontendIPConfigurationsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LoadBalancerFrontendIPConfigurationListResult"] - """Gets all the load balancer frontend IP configurations. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerFrontendIPConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerFrontendIPConfigurationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerFrontendIPConfigurationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerFrontendIPConfigurationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations'} # type: ignore - - def get( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - frontend_ip_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.FrontendIPConfiguration" - """Gets load balancer frontend IP configuration. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param frontend_ip_configuration_name: The name of the frontend IP configuration. - :type frontend_ip_configuration_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: FrontendIPConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.FrontendIPConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.FrontendIPConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'frontendIPConfigurationName': self._serialize.url("frontend_ip_configuration_name", frontend_ip_configuration_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('FrontendIPConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_load_balancing_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_load_balancing_rules_operations.py deleted file mode 100644 index 04f974eb0bee..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_load_balancing_rules_operations.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerLoadBalancingRulesOperations(object): - """LoadBalancerLoadBalancingRulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LoadBalancerLoadBalancingRuleListResult"] - """Gets all the load balancing rules in a load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerLoadBalancingRuleListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerLoadBalancingRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerLoadBalancingRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerLoadBalancingRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules'} # type: ignore - - def get( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - load_balancing_rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LoadBalancingRule" - """Gets the specified load balancer load balancing rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param load_balancing_rule_name: The name of the load balancing rule. - :type load_balancing_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LoadBalancingRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.LoadBalancingRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancingRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'loadBalancingRuleName': self._serialize.url("load_balancing_rule_name", load_balancing_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LoadBalancingRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_network_interfaces_operations.py deleted file mode 100644 index efdc13f1dd7a..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_network_interfaces_operations.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerNetworkInterfacesOperations(object): - """LoadBalancerNetworkInterfacesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] - """Gets associated load balancer network interfaces. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_probes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_probes_operations.py deleted file mode 100644 index 7e7d2d5e65c7..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancer_probes_operations.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancerProbesOperations(object): - """LoadBalancerProbesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LoadBalancerProbeListResult"] - """Gets all the load balancer probes. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerProbeListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerProbeListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerProbeListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerProbeListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes'} # type: ignore - - def get( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - probe_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Probe" - """Gets load balancer probe. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param probe_name: The name of the probe. - :type probe_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Probe, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Probe - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Probe"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'probeName': self._serialize.url("probe_name", probe_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Probe', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancers_operations.py deleted file mode 100644 index 198461d9c69f..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_load_balancers_operations.py +++ /dev/null @@ -1,488 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class LoadBalancersOperations(object): - """LoadBalancersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - load_balancer_name=load_balancer_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.LoadBalancer" - """Gets the specified load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LoadBalancer, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.LoadBalancer - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LoadBalancer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - parameters, # type: "_models.LoadBalancer" - **kwargs # type: Any - ): - # type: (...) -> "_models.LoadBalancer" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'LoadBalancer') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('LoadBalancer', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('LoadBalancer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - load_balancer_name, # type: str - parameters, # type: "_models.LoadBalancer" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LoadBalancer"] - """Creates or updates a load balancer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param load_balancer_name: The name of the load balancer. - :type load_balancer_name: str - :param parameters: Parameters supplied to the create or update load balancer operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.LoadBalancer - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either LoadBalancer or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.LoadBalancer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancer"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - load_balancer_name=load_balancer_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('LoadBalancer', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'loadBalancerName': self._serialize.url("load_balancer_name", load_balancer_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}'} # type: ignore - - def list_all( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LoadBalancerListResult"] - """Gets all the load balancers in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LoadBalancerListResult"] - """Gets all the load balancers in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LoadBalancerListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LoadBalancerListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LoadBalancerListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('LoadBalancerListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_local_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_local_network_gateways_operations.py deleted file mode 100644 index eac9a1a09b98..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_local_network_gateways_operations.py +++ /dev/null @@ -1,416 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class LocalNetworkGatewaysOperations(object): - """LocalNetworkGatewaysOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _create_or_update_initial( - self, - resource_group_name, # type: str - local_network_gateway_name, # type: str - parameters, # type: "_models.LocalNetworkGateway" - **kwargs # type: Any - ): - # type: (...) -> "_models.LocalNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'LocalNetworkGateway') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - local_network_gateway_name, # type: str - parameters, # type: "_models.LocalNetworkGateway" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.LocalNetworkGateway"] - """Creates or updates a local network gateway in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param local_network_gateway_name: The name of the local network gateway. - :type local_network_gateway_name: str - :param parameters: Parameters supplied to the create or update local network gateway operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either LocalNetworkGateway or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - local_network_gateway_name=local_network_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - local_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LocalNetworkGateway" - """Gets the specified local network gateway in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param local_network_gateway_name: The name of the local network gateway. - :type local_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LocalNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.LocalNetworkGateway - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LocalNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - local_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - local_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified local network gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param local_network_gateway_name: The name of the local network gateway. - :type local_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - local_network_gateway_name=local_network_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'localNetworkGatewayName': self._serialize.url("local_network_gateway_name", local_network_gateway_name, 'str', min_length=1), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LocalNetworkGatewayListResult"] - """Gets all the local network gateways in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LocalNetworkGatewayListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.LocalNetworkGatewayListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LocalNetworkGatewayListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('LocalNetworkGatewayListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_ip_configurations_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_ip_configurations_operations.py deleted file mode 100644 index 0c4fb9028662..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_ip_configurations_operations.py +++ /dev/null @@ -1,184 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class NetworkInterfaceIPConfigurationsOperations(object): - """NetworkInterfaceIPConfigurationsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - network_interface_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkInterfaceIPConfigurationListResult"] - """Get all ip configurations in a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceIPConfigurationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfigurationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfigurationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceIPConfigurationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations'} # type: ignore - - def get( - self, - resource_group_name, # type: str - network_interface_name, # type: str - ip_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkInterfaceIPConfiguration" - """Gets the specified network interface ip configuration. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param ip_configuration_name: The name of the ip configuration name. - :type ip_configuration_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkInterfaceIPConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceIPConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceIPConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkInterfaceIPConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_load_balancers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_load_balancers_operations.py deleted file mode 100644 index 195642500ea4..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interface_load_balancers_operations.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class NetworkInterfaceLoadBalancersOperations(object): - """NetworkInterfaceLoadBalancersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - network_interface_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkInterfaceLoadBalancerListResult"] - """List all load balancers in a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceLoadBalancerListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceLoadBalancerListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceLoadBalancerListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceLoadBalancerListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interfaces_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interfaces_operations.py deleted file mode 100644 index c0c9e6734578..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_interfaces_operations.py +++ /dev/null @@ -1,951 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class NetworkInterfacesOperations(object): - """NetworkInterfacesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - network_interface_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - network_interface_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - network_interface_name=network_interface_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - network_interface_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkInterface" - """Gets information about the specified network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - network_interface_name, # type: str - parameters, # type: "_models.NetworkInterface" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkInterface" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NetworkInterface') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - network_interface_name, # type: str - parameters, # type: "_models.NetworkInterface" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkInterface"] - """Creates or updates a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param parameters: Parameters supplied to the create or update network interface operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkInterface or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.NetworkInterface] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - network_interface_name=network_interface_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}'} # type: ignore - - def list_all( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] - """Gets all network interfaces in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] - """Gets all network interfaces in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces'} # type: ignore - - def _get_effective_route_table_initial( - self, - resource_group_name, # type: str - network_interface_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EffectiveRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveRouteListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_effective_route_table_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EffectiveRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_effective_route_table_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} # type: ignore - - def begin_get_effective_route_table( - self, - resource_group_name, # type: str - network_interface_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EffectiveRouteListResult"] - """Gets all route tables applied to a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either EffectiveRouteListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.EffectiveRouteListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveRouteListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_effective_route_table_initial( - resource_group_name=resource_group_name, - network_interface_name=network_interface_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('EffectiveRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_effective_route_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable'} # type: ignore - - def _list_effective_network_security_groups_initial( - self, - resource_group_name, # type: str - network_interface_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.EffectiveNetworkSecurityGroupListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EffectiveNetworkSecurityGroupListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._list_effective_network_security_groups_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _list_effective_network_security_groups_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} # type: ignore - - def begin_list_effective_network_security_groups( - self, - resource_group_name, # type: str - network_interface_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.EffectiveNetworkSecurityGroupListResult"] - """Gets all network security groups applied to a network interface. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either EffectiveNetworkSecurityGroupListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.EffectiveNetworkSecurityGroupListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.EffectiveNetworkSecurityGroupListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._list_effective_network_security_groups_initial( - resource_group_name=resource_group_name, - network_interface_name=network_interface_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('EffectiveNetworkSecurityGroupListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_list_effective_network_security_groups.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups'} # type: ignore - - def list_virtual_machine_scale_set_vm_network_interfaces( - self, - resource_group_name, # type: str - virtual_machine_scale_set_name, # type: str - virtualmachine_index, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] - """Gets information about all network interfaces in a virtual machine in a virtual machine scale - set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :param virtualmachine_index: The virtual machine index. - :type virtualmachine_index: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_virtual_machine_scale_set_vm_network_interfaces.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_virtual_machine_scale_set_vm_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces'} # type: ignore - - def list_virtual_machine_scale_set_network_interfaces( - self, - resource_group_name, # type: str - virtual_machine_scale_set_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkInterfaceListResult"] - """Gets all network interfaces in a virtual machine scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkInterfaceListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkInterfaceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterfaceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_virtual_machine_scale_set_network_interfaces.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkInterfaceListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_virtual_machine_scale_set_network_interfaces.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces'} # type: ignore - - def get_virtual_machine_scale_set_network_interface( - self, - resource_group_name, # type: str - virtual_machine_scale_set_name, # type: str - virtualmachine_index, # type: str - network_interface_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkInterface" - """Get the specified network interface in a virtual machine scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :param virtualmachine_index: The virtual machine index. - :type virtualmachine_index: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkInterface, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkInterface - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkInterface"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - # Construct URL - url = self.get_virtual_machine_scale_set_network_interface.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkInterface', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_virtual_machine_scale_set_network_interface.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_management_client_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_management_client_operations.py deleted file mode 100644 index b493357a9e0b..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_management_client_operations.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class NetworkManagementClientOperationsMixin(object): - - def check_dns_name_availability( - self, - location, # type: str - domain_name_label, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.DnsNameAvailabilityResult" - """Checks whether a domain name in the cloudapp.azure.com zone is available for use. - - :param location: The location of the domain name. - :type location: str - :param domain_name_label: The domain name to be verified. It must conform to the following - regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. - :type domain_name_label: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DnsNameAvailabilityResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.DnsNameAvailabilityResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.DnsNameAvailabilityResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.check_dns_name_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['domainNameLabel'] = self._serialize.query("domain_name_label", domain_name_label, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('DnsNameAvailabilityResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - check_dns_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_security_groups_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_security_groups_operations.py deleted file mode 100644 index 83b9962476e4..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_security_groups_operations.py +++ /dev/null @@ -1,489 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class NetworkSecurityGroupsOperations(object): - """NetworkSecurityGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - network_security_group_name=network_security_group_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkSecurityGroup" - """Gets the specified network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkSecurityGroup, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - parameters, # type: "_models.NetworkSecurityGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkSecurityGroup" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NetworkSecurityGroup') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - parameters, # type: "_models.NetworkSecurityGroup" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkSecurityGroup"] - """Creates or updates a network security group in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param parameters: Parameters supplied to the create or update network security group - operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkSecurityGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - network_security_group_name=network_security_group_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NetworkSecurityGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}'} # type: ignore - - def list_all( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] - """Gets all network security groups in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkSecurityGroupListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroupListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkSecurityGroupListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkSecurityGroupListResult"] - """Gets all network security groups in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkSecurityGroupListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkSecurityGroupListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkSecurityGroupListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkSecurityGroupListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_watchers_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_watchers_operations.py deleted file mode 100644 index 55f281b429b8..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_network_watchers_operations.py +++ /dev/null @@ -1,1532 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class NetworkWatchersOperations(object): - """NetworkWatchersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def create_or_update( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.NetworkWatcher" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkWatcher" - """Creates or updates a network watcher in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the network watcher resource. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkWatcher, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NetworkWatcher') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkWatcher', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkWatcher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkWatcher" - """Gets the specified network watcher by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkWatcher, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.NetworkWatcher - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkWatcher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified network watcher resource. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkWatcherListResult"] - """Gets all network watchers by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkWatcherListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkWatcherListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkWatcherListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers'} # type: ignore - - def list_all( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkWatcherListResult"] - """Gets all network watchers by subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkWatcherListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.NetworkWatcherListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkWatcherListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('NetworkWatcherListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkWatchers'} # type: ignore - - def get_topology( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.TopologyParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.Topology" - """Gets the current network topology by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the representation of topology. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.TopologyParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Topology, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Topology - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Topology"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self.get_topology.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TopologyParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Topology', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_topology.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/topology'} # type: ignore - - def _verify_ip_flow_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.VerificationIPFlowParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.VerificationIPFlowResult" - cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._verify_ip_flow_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VerificationIPFlowParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _verify_ip_flow_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} # type: ignore - - def begin_verify_ip_flow( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.VerificationIPFlowParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VerificationIPFlowResult"] - """Verify IP flow from the specified VM to a location given the currently configured NSG rules. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the IP flow to be verified. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VerificationIPFlowParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either VerificationIPFlowResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.VerificationIPFlowResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VerificationIPFlowResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._verify_ip_flow_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VerificationIPFlowResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_verify_ip_flow.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/ipFlowVerify'} # type: ignore - - def _get_next_hop_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.NextHopParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.NextHopResult" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_next_hop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'NextHopParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NextHopResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('NextHopResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_next_hop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} # type: ignore - - def begin_get_next_hop( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.NextHopParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NextHopResult"] - """Gets the next hop from the specified VM. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the source and destination endpoint. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.NextHopParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either NextHopResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.NextHopResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NextHopResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_next_hop_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('NextHopResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_next_hop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/nextHop'} # type: ignore - - def _get_vm_security_rules_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.SecurityGroupViewParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.SecurityGroupViewResult" - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_vm_security_rules_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'SecurityGroupViewParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_vm_security_rules_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} # type: ignore - - def begin_get_vm_security_rules( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.SecurityGroupViewParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.SecurityGroupViewResult"] - """Gets the configured and effective security group rules on the specified VM. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param parameters: Parameters that define the VM to check security groups for. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.SecurityGroupViewParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either SecurityGroupViewResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.SecurityGroupViewResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityGroupViewResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_vm_security_rules_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('SecurityGroupViewResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_vm_security_rules.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/securityGroupView'} # type: ignore - - def _get_troubleshooting_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.TroubleshootingParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_troubleshooting_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TroubleshootingParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_troubleshooting_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} # type: ignore - - def begin_get_troubleshooting( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.TroubleshootingParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.TroubleshootingResult"] - """Initiate troubleshooting on a specified resource. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that define the resource to troubleshoot. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.TroubleshootingParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either TroubleshootingResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_troubleshooting_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_troubleshooting.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/troubleshoot'} # type: ignore - - def _get_troubleshooting_result_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.QueryTroubleshootingParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.TroubleshootingResult" - cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_troubleshooting_result_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'QueryTroubleshootingParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_troubleshooting_result_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} # type: ignore - - def begin_get_troubleshooting_result( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.QueryTroubleshootingParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.TroubleshootingResult"] - """Get the last completed troubleshooting result on a specified resource. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that define the resource to query the troubleshooting result. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.QueryTroubleshootingParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either TroubleshootingResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.TroubleshootingResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.TroubleshootingResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_troubleshooting_result_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('TroubleshootingResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_troubleshooting_result.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryTroubleshootResult'} # type: ignore - - def _set_flow_log_configuration_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.FlowLogInformation" - **kwargs # type: Any - ): - # type: (...) -> "_models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._set_flow_log_configuration_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'FlowLogInformation') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _set_flow_log_configuration_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} # type: ignore - - def begin_set_flow_log_configuration( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.FlowLogInformation" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FlowLogInformation"] - """Configures flow log on a specified resource. - - :param resource_group_name: The name of the network watcher resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that define the configuration of flow log. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.FlowLogInformation - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either FlowLogInformation or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._set_flow_log_configuration_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_set_flow_log_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/configureFlowLog'} # type: ignore - - def _get_flow_log_status_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.FlowLogStatusParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.FlowLogInformation" - cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._get_flow_log_status_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'FlowLogStatusParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_flow_log_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} # type: ignore - - def begin_get_flow_log_status( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.FlowLogStatusParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.FlowLogInformation"] - """Queries status of flow log on a specified resource. - - :param resource_group_name: The name of the network watcher resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that define a resource to query flow log status. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.FlowLogStatusParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either FlowLogInformation or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.FlowLogInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.FlowLogInformation"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_flow_log_status_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FlowLogInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_flow_log_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryFlowLogStatus'} # type: ignore - - def _check_connectivity_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.ConnectivityParameters" - **kwargs # type: Any - ): - # type: (...) -> "_models.ConnectivityInformation" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._check_connectivity_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ConnectivityParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ConnectivityInformation', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('ConnectivityInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _check_connectivity_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} # type: ignore - - def begin_check_connectivity( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - parameters, # type: "_models.ConnectivityParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ConnectivityInformation"] - """Verifies the possibility of establishing a direct TCP connection from a virtual machine to a - given endpoint including another VM or an arbitrary remote server. - - :param resource_group_name: The name of the network watcher resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher resource. - :type network_watcher_name: str - :param parameters: Parameters that determine how the connectivity check will be performed. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ConnectivityParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ConnectivityInformation or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ConnectivityInformation] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityInformation"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._check_connectivity_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ConnectivityInformation', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_check_connectivity.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_packet_captures_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_packet_captures_operations.py deleted file mode 100644 index 062ef06cc32a..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_packet_captures_operations.py +++ /dev/null @@ -1,676 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class PacketCapturesOperations(object): - """PacketCapturesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _create_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - packet_capture_name, # type: str - parameters, # type: "_models.PacketCapture" - **kwargs # type: Any - ): - # type: (...) -> "_models.PacketCaptureResult" - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PacketCapture') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PacketCaptureResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - def begin_create( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - packet_capture_name, # type: str - parameters, # type: "_models.PacketCapture" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PacketCaptureResult"] - """Create and start a packet capture on the specified VM. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param packet_capture_name: The name of the packet capture session. - :type packet_capture_name: str - :param parameters: Parameters that define the create packet capture operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.PacketCapture - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either PacketCaptureResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - packet_capture_name=packet_capture_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PacketCaptureResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - packet_capture_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PacketCaptureResult" - """Gets a packet capture session by name. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param packet_capture_name: The name of the packet capture session. - :type packet_capture_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PacketCaptureResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.PacketCaptureResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PacketCaptureResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - packet_capture_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - packet_capture_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified packet capture session. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param packet_capture_name: The name of the packet capture session. - :type packet_capture_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - packet_capture_name=packet_capture_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}'} # type: ignore - - def _stop_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - packet_capture_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._stop_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _stop_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} # type: ignore - - def begin_stop( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - packet_capture_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Stops a specified packet capture session. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the network watcher. - :type network_watcher_name: str - :param packet_capture_name: The name of the packet capture session. - :type packet_capture_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._stop_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - packet_capture_name=packet_capture_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/stop'} # type: ignore - - def _get_status_initial( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - packet_capture_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PacketCaptureQueryStatusResult" - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_status_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) - - if response.status_code == 202: - deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} # type: ignore - - def begin_get_status( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - packet_capture_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PacketCaptureQueryStatusResult"] - """Query the status of a running packet capture session. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the Network Watcher resource. - :type network_watcher_name: str - :param packet_capture_name: The name given to the packet capture session. - :type packet_capture_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either PacketCaptureQueryStatusResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.PacketCaptureQueryStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureQueryStatusResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_status_initial( - resource_group_name=resource_group_name, - network_watcher_name=network_watcher_name, - packet_capture_name=packet_capture_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PacketCaptureQueryStatusResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'packetCaptureName': self._serialize.url("packet_capture_name", packet_capture_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}/queryStatus'} # type: ignore - - def list( - self, - resource_group_name, # type: str - network_watcher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PacketCaptureListResult"] - """Lists all packet capture sessions within the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_watcher_name: The name of the Network Watcher resource. - :type network_watcher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PacketCaptureListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PacketCaptureListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PacketCaptureListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkWatcherName': self._serialize.url("network_watcher_name", network_watcher_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PacketCaptureListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_public_ip_addresses_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_public_ip_addresses_operations.py deleted file mode 100644 index 375d77990a65..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_public_ip_addresses_operations.py +++ /dev/null @@ -1,731 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class PublicIPAddressesOperations(object): - """PublicIPAddressesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - public_ip_address_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - public_ip_address_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified public IP address. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param public_ip_address_name: The name of the subnet. - :type public_ip_address_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - public_ip_address_name=public_ip_address_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - public_ip_address_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.PublicIPAddress" - """Gets the specified public IP address in a specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param public_ip_address_name: The name of the subnet. - :type public_ip_address_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - public_ip_address_name, # type: str - parameters, # type: "_models.PublicIPAddress" - **kwargs # type: Any - ): - # type: (...) -> "_models.PublicIPAddress" - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'PublicIPAddress') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - public_ip_address_name, # type: str - parameters, # type: "_models.PublicIPAddress" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PublicIPAddress"] - """Creates or updates a static or dynamic public IP address. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param public_ip_address_name: The name of the public IP address. - :type public_ip_address_name: str - :param parameters: Parameters supplied to the create or update public IP address operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either PublicIPAddress or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.PublicIPAddress] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - public_ip_address_name=public_ip_address_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}'} # type: ignore - - def list_all( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PublicIPAddressListResult"] - """Gets all the public IP addresses in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PublicIPAddressListResult"] - """Gets all public IP addresses in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses'} # type: ignore - - def list_virtual_machine_scale_set_public_ip_addresses( - self, - resource_group_name, # type: str - virtual_machine_scale_set_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PublicIPAddressListResult"] - """Gets information about all public IP addresses on a virtual machine scale set level. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_virtual_machine_scale_set_public_ip_addresses.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_virtual_machine_scale_set_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses'} # type: ignore - - def list_virtual_machine_scale_set_vm_public_ip_addresses( - self, - resource_group_name, # type: str - virtual_machine_scale_set_name, # type: str - virtualmachine_index, # type: str - network_interface_name, # type: str - ip_configuration_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PublicIPAddressListResult"] - """Gets information about all public IP addresses in a virtual machine IP configuration in a - virtual machine scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :param virtualmachine_index: The virtual machine index. - :type virtualmachine_index: str - :param network_interface_name: The network interface name. - :type network_interface_name: str - :param ip_configuration_name: The IP configuration name. - :type ip_configuration_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublicIPAddressListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.PublicIPAddressListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddressListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_virtual_machine_scale_set_vm_public_ip_addresses.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('PublicIPAddressListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_virtual_machine_scale_set_vm_public_ip_addresses.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses'} # type: ignore - - def get_virtual_machine_scale_set_public_ip_address( - self, - resource_group_name, # type: str - virtual_machine_scale_set_name, # type: str - virtualmachine_index, # type: str - network_interface_name, # type: str - ip_configuration_name, # type: str - public_ip_address_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.PublicIPAddress" - """Get the specified public IP address in a virtual machine scale set. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_machine_scale_set_name: The name of the virtual machine scale set. - :type virtual_machine_scale_set_name: str - :param virtualmachine_index: The virtual machine index. - :type virtualmachine_index: str - :param network_interface_name: The name of the network interface. - :type network_interface_name: str - :param ip_configuration_name: The name of the IP configuration. - :type ip_configuration_name: str - :param public_ip_address_name: The name of the public IP Address. - :type public_ip_address_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PublicIPAddress, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.PublicIPAddress - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublicIPAddress"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-03-30" - accept = "application/json, text/json" - - # Construct URL - url = self.get_virtual_machine_scale_set_public_ip_address.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualMachineScaleSetName': self._serialize.url("virtual_machine_scale_set_name", virtual_machine_scale_set_name, 'str'), - 'virtualmachineIndex': self._serialize.url("virtualmachine_index", virtualmachine_index, 'str'), - 'networkInterfaceName': self._serialize.url("network_interface_name", network_interface_name, 'str'), - 'ipConfigurationName': self._serialize.url("ip_configuration_name", ip_configuration_name, 'str'), - 'publicIpAddressName': self._serialize.url("public_ip_address_name", public_ip_address_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PublicIPAddress', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_virtual_machine_scale_set_public_ip_address.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filter_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filter_rules_operations.py deleted file mode 100644 index d644fe2854fc..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filter_rules_operations.py +++ /dev/null @@ -1,573 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class RouteFilterRulesOperations(object): - """RouteFilterRulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - route_filter_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - route_filter_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified rule from a route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param rule_name: The name of the rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - rule_name=rule_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - route_filter_name, # type: str - rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.RouteFilterRule" - """Gets the specified rule from a route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param rule_name: The name of the rule. - :type rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RouteFilterRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilterRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - route_filter_name, # type: str - rule_name, # type: str - route_filter_rule_parameters, # type: "_models.RouteFilterRule" - **kwargs # type: Any - ): - # type: (...) -> "_models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_filter_rule_parameters, 'RouteFilterRule') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - route_filter_name, # type: str - rule_name, # type: str - route_filter_rule_parameters, # type: "_models.RouteFilterRule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RouteFilterRule"] - """Creates or updates a route in the specified route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param rule_name: The name of the route filter rule. - :type rule_name: str - :param route_filter_rule_parameters: Parameters supplied to the create or update route filter - rule operation. - :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.RouteFilterRule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either RouteFilterRule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - rule_name=rule_name, - route_filter_rule_parameters=route_filter_rule_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - route_filter_name, # type: str - rule_name, # type: str - route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" - **kwargs # type: Any - ): - # type: (...) -> "_models.RouteFilterRule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_filter_rule_parameters, 'PatchRouteFilterRule') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - def begin_update( - self, - resource_group_name, # type: str - route_filter_name, # type: str - rule_name, # type: str - route_filter_rule_parameters, # type: "_models.PatchRouteFilterRule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RouteFilterRule"] - """Updates a route in the specified route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param rule_name: The name of the route filter rule. - :type rule_name: str - :param route_filter_rule_parameters: Parameters supplied to the update route filter rule - operation. - :type route_filter_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.PatchRouteFilterRule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either RouteFilterRule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilterRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - rule_name=rule_name, - route_filter_rule_parameters=route_filter_rule_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteFilterRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}'} # type: ignore - - def list_by_route_filter( - self, - resource_group_name, # type: str - route_filter_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RouteFilterRuleListResult"] - """Gets all RouteFilterRules in a route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteFilterRuleListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_route_filter.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('RouteFilterRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_route_filter.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filters_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filters_operations.py deleted file mode 100644 index 8c71f1b2dae3..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_filters_operations.py +++ /dev/null @@ -1,615 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class RouteFiltersOperations(object): - """RouteFiltersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - route_filter_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - route_filter_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - route_filter_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.RouteFilter" - """Gets the specified route filter. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param expand: Expands referenced express route bgp peering resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RouteFilter, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteFilter - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - route_filter_name, # type: str - route_filter_parameters, # type: "_models.RouteFilter" - **kwargs # type: Any - ): - # type: (...) -> "_models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_filter_parameters, 'RouteFilter') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - route_filter_name, # type: str - route_filter_parameters, # type: "_models.RouteFilter" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RouteFilter"] - """Creates or updates a route filter in a specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param route_filter_parameters: Parameters supplied to the create or update route filter - operation. - :type route_filter_parameters: ~azure.mgmt.network.v2017_08_01.models.RouteFilter - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either RouteFilter or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilter] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - route_filter_parameters=route_filter_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - def _update_initial( - self, - resource_group_name, # type: str - route_filter_name, # type: str - route_filter_parameters, # type: "_models.PatchRouteFilter" - **kwargs # type: Any - ): - # type: (...) -> "_models.RouteFilter" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self._update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_filter_parameters, 'PatchRouteFilter') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - def begin_update( - self, - resource_group_name, # type: str - route_filter_name, # type: str - route_filter_parameters, # type: "_models.PatchRouteFilter" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RouteFilter"] - """Updates a route filter in a specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_filter_name: The name of the route filter. - :type route_filter_name: str - :param route_filter_parameters: Parameters supplied to the update route filter operation. - :type route_filter_parameters: ~azure.mgmt.network.v2017_08_01.models.PatchRouteFilter - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either RouteFilter or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.RouteFilter] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - route_filter_name=route_filter_name, - route_filter_parameters=route_filter_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteFilter', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RouteFilterListResult"] - """Gets all route filters in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteFilterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('RouteFilterListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} # type: ignore - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RouteFilterListResult"] - """Gets all route filters in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteFilterListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteFilterListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('RouteFilterListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_tables_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_tables_operations.py deleted file mode 100644 index 68b02d21f1e5..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_route_tables_operations.py +++ /dev/null @@ -1,488 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class RouteTablesOperations(object): - """RouteTablesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - route_table_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - route_table_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - route_table_name=route_table_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - route_table_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.RouteTable" - """Gets the specified route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: RouteTable, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.RouteTable - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('RouteTable', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - route_table_name, # type: str - parameters, # type: "_models.RouteTable" - **kwargs # type: Any - ): - # type: (...) -> "_models.RouteTable" - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'RouteTable') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('RouteTable', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('RouteTable', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - route_table_name, # type: str - parameters, # type: "_models.RouteTable" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.RouteTable"] - """Create or updates a route table in a specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param parameters: Parameters supplied to the create or update route table operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.RouteTable - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either RouteTable or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.RouteTable] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTable"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - route_table_name=route_table_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RouteTable', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RouteTableListResult"] - """Gets all route tables in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteTableListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteTableListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('RouteTableListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'} # type: ignore - - def list_all( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RouteTableListResult"] - """Gets all route tables in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteTableListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteTableListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteTableListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('RouteTableListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_routes_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_routes_operations.py deleted file mode 100644 index 8ce0df977505..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_routes_operations.py +++ /dev/null @@ -1,438 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class RoutesOperations(object): - """RoutesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - route_table_name, # type: str - route_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - route_table_name, # type: str - route_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified route from a route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param route_name: The name of the route. - :type route_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - route_table_name=route_table_name, - route_name=route_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - route_table_name, # type: str - route_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Route" - """Gets the specified route from a route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param route_name: The name of the route. - :type route_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Route, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Route - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Route', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - route_table_name, # type: str - route_name, # type: str - route_parameters, # type: "_models.Route" - **kwargs # type: Any - ): - # type: (...) -> "_models.Route" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(route_parameters, 'Route') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Route', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Route', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - route_table_name, # type: str - route_name, # type: str - route_parameters, # type: "_models.Route" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Route"] - """Creates or updates a route in the specified route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :param route_name: The name of the route. - :type route_name: str - :param route_parameters: Parameters supplied to the create or update route operation. - :type route_parameters: ~azure.mgmt.network.v2017_08_01.models.Route - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either Route or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.Route] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Route"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - route_table_name=route_table_name, - route_name=route_name, - route_parameters=route_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Route', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'routeName': self._serialize.url("route_name", route_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - route_table_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.RouteListResult"] - """Gets all routes in a route table. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param route_table_name: The name of the route table. - :type route_table_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RouteListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.RouteListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('RouteListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_security_rules_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_security_rules_operations.py deleted file mode 100644 index 77a7dfe76af2..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_security_rules_operations.py +++ /dev/null @@ -1,439 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class SecurityRulesOperations(object): - """SecurityRulesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - security_rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - security_rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified network security rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param security_rule_name: The name of the security rule. - :type security_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - network_security_group_name=network_security_group_name, - security_rule_name=security_rule_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - security_rule_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.SecurityRule" - """Get the specified network security rule. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param security_rule_name: The name of the security rule. - :type security_rule_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SecurityRule, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.SecurityRule - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - security_rule_name, # type: str - security_rule_parameters, # type: "_models.SecurityRule" - **kwargs # type: Any - ): - # type: (...) -> "_models.SecurityRule" - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(security_rule_parameters, 'SecurityRule') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - security_rule_name, # type: str - security_rule_parameters, # type: "_models.SecurityRule" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.SecurityRule"] - """Creates or updates a security rule in the specified network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :param security_rule_name: The name of the security rule. - :type security_rule_name: str - :param security_rule_parameters: Parameters supplied to the create or update network security - rule operation. - :type security_rule_parameters: ~azure.mgmt.network.v2017_08_01.models.SecurityRule - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either SecurityRule or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.SecurityRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRule"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - network_security_group_name=network_security_group_name, - security_rule_name=security_rule_name, - security_rule_parameters=security_rule_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('SecurityRule', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'securityRuleName': self._serialize.url("security_rule_name", security_rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - network_security_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SecurityRuleListResult"] - """Gets all security rules in a network security group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param network_security_group_name: The name of the network security group. - :type network_security_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SecurityRuleListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.SecurityRuleListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SecurityRuleListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'networkSecurityGroupName': self._serialize.url("network_security_group_name", network_security_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SecurityRuleListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_subnets_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_subnets_operations.py deleted file mode 100644 index 514d138b2e75..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_subnets_operations.py +++ /dev/null @@ -1,443 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class SubnetsOperations(object): - """SubnetsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - subnet_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - subnet_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified subnet. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param subnet_name: The name of the subnet. - :type subnet_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - subnet_name=subnet_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - subnet_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.Subnet" - """Gets the specified subnet by virtual network and resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param subnet_name: The name of the subnet. - :type subnet_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Subnet, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.Subnet - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Subnet', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - subnet_name, # type: str - subnet_parameters, # type: "_models.Subnet" - **kwargs # type: Any - ): - # type: (...) -> "_models.Subnet" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(subnet_parameters, 'Subnet') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Subnet', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Subnet', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - subnet_name, # type: str - subnet_parameters, # type: "_models.Subnet" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Subnet"] - """Creates or updates a subnet in the specified virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param subnet_name: The name of the subnet. - :type subnet_name: str - :param subnet_parameters: Parameters supplied to the create or update subnet operation. - :type subnet_parameters: ~azure.mgmt.network.v2017_08_01.models.Subnet - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either Subnet or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.Subnet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Subnet"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - subnet_name=subnet_name, - subnet_parameters=subnet_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Subnet', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subnetName': self._serialize.url("subnet_name", subnet_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SubnetListResult"] - """Gets all subnets in a virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SubnetListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.SubnetListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SubnetListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('SubnetListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_usages_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_usages_operations.py deleted file mode 100644 index 86675719184e..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_usages_operations.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class UsagesOperations(object): - """UsagesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - location, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.UsagesListResult"] - """List network usages for a subscription. - - :param location: The location where resource usage is queried. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either UsagesListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.UsagesListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('UsagesListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateway_connections_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateway_connections_operations.py deleted file mode 100644 index 29e3fa9bd02a..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateway_connections_operations.py +++ /dev/null @@ -1,747 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class VirtualNetworkGatewayConnectionsOperations(object): - """VirtualNetworkGatewayConnectionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _create_or_update_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - parameters, # type: "_models.VirtualNetworkGatewayConnection" - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualNetworkGatewayConnection" - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VirtualNetworkGatewayConnection') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - parameters, # type: "_models.VirtualNetworkGatewayConnection" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VirtualNetworkGatewayConnection"] - """Creates or updates a virtual network gateway connection in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The name of the virtual network gateway - connection. - :type virtual_network_gateway_connection_name: str - :param parameters: Parameters supplied to the create or update virtual network gateway - connection operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either VirtualNetworkGatewayConnection or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualNetworkGatewayConnection" - """Gets the specified virtual network gateway connection by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The name of the virtual network gateway - connection. - :type virtual_network_gateway_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualNetworkGatewayConnection, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnection - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualNetworkGatewayConnection', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified virtual network Gateway connection. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The name of the virtual network gateway - connection. - :type virtual_network_gateway_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}'} # type: ignore - - def _set_shared_key_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - parameters, # type: "_models.ConnectionSharedKey" - **kwargs # type: Any - ): - # type: (...) -> "_models.ConnectionSharedKey" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._set_shared_key_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ConnectionSharedKey') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _set_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore - - def begin_set_shared_key( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - parameters, # type: "_models.ConnectionSharedKey" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ConnectionSharedKey"] - """The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway - connection shared key for passed virtual network gateway connection in the specified resource - group through Network resource provider. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The virtual network gateway connection name. - :type virtual_network_gateway_connection_name: str - :param parameters: Parameters supplied to the Begin Set Virtual Network Gateway connection - Shared key operation throughNetwork resource provider. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ConnectionSharedKey or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._set_shared_key_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_set_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore - - def get_shared_key( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ConnectionSharedKey" - """The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the - specified virtual network gateway connection shared key through Network resource provider. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The virtual network gateway connection shared - key name. - :type virtual_network_gateway_connection_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConnectionSharedKey, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.ConnectionSharedKey - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionSharedKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get_shared_key.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConnectionSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VirtualNetworkGatewayConnectionListResult"] - """The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways - connections created. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkGatewayConnectionListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayConnectionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayConnectionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGatewayConnectionListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections'} # type: ignore - - def _reset_shared_key_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - parameters, # type: "_models.ConnectionResetSharedKey" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ConnectionResetSharedKey"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConnectionResetSharedKey"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._reset_shared_key_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ConnectionResetSharedKey') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _reset_shared_key_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} # type: ignore - - def begin_reset_shared_key( - self, - resource_group_name, # type: str - virtual_network_gateway_connection_name, # type: str - parameters, # type: "_models.ConnectionResetSharedKey" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ConnectionResetSharedKey"] - """The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway - connection shared key for passed virtual network gateway connection in the specified resource - group through Network resource provider. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_connection_name: The virtual network gateway connection reset - shared key Name. - :type virtual_network_gateway_connection_name: str - :param parameters: Parameters supplied to the begin reset virtual network gateway connection - shared key operation through network resource provider. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.ConnectionResetSharedKey - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either ConnectionResetSharedKey or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.ConnectionResetSharedKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectionResetSharedKey"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._reset_shared_key_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_connection_name=virtual_network_gateway_connection_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ConnectionResetSharedKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayConnectionName': self._serialize.url("virtual_network_gateway_connection_name", virtual_network_gateway_connection_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reset_shared_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateways_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateways_operations.py deleted file mode 100644 index 3e1647c43a3f..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_gateways_operations.py +++ /dev/null @@ -1,1365 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class VirtualNetworkGatewaysOperations(object): - """VirtualNetworkGatewaysOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _create_or_update_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - parameters, # type: "_models.VirtualNetworkGateway" - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualNetworkGateway" - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VirtualNetworkGateway') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - parameters, # type: "_models.VirtualNetworkGateway" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] - """Creates or updates a virtual network gateway in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to create or update virtual network gateway operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualNetworkGateway" - """Gets the specified virtual network gateway by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualNetworkGateway, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - def _delete_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified virtual network gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VirtualNetworkGatewayListResult"] - """Gets all virtual network gateways by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkGatewayListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGatewayListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways'} # type: ignore - - def list_connections( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VirtualNetworkGatewayListConnectionsResult"] - """Gets all the connections in a virtual network gateway. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkGatewayListConnectionsResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGatewayListConnectionsResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGatewayListConnectionsResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_connections.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGatewayListConnectionsResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_connections.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections'} # type: ignore - - def _reset_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - gateway_vip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.VirtualNetworkGateway"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VirtualNetworkGateway"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._reset_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if gateway_vip is not None: - query_parameters['gatewayVip'] = self._serialize.query("gateway_vip", gateway_vip, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _reset_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} # type: ignore - - def begin_reset( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - gateway_vip=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VirtualNetworkGateway"] - """Resets the primary of the virtual network gateway in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param gateway_vip: Virtual network gateway vip address supplied to the begin reset of the - active-active feature enabled gateway. - :type gateway_vip: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either VirtualNetworkGateway or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkGateway] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkGateway"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._reset_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - gateway_vip=gateway_vip, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetworkGateway', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reset.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset'} # type: ignore - - def _generatevpnclientpackage_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - parameters, # type: "_models.VpnClientParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._generatevpnclientpackage_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VpnClientParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _generatevpnclientpackage_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} # type: ignore - - def begin_generatevpnclientpackage( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - parameters, # type: "_models.VpnClientParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[str] - """Generates VPN client package for P2S client of the virtual network gateway in the specified - resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network gateway VPN client - package operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VpnClientParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either str or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[str] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._generatevpnclientpackage_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_generatevpnclientpackage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage'} # type: ignore - - def _generate_vpn_profile_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - parameters, # type: "_models.VpnClientParameters" - **kwargs # type: Any - ): - # type: (...) -> Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._generate_vpn_profile_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VpnClientParameters') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _generate_vpn_profile_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} # type: ignore - - def begin_generate_vpn_profile( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - parameters, # type: "_models.VpnClientParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[str] - """Generates VPN profile for P2S client of the virtual network gateway in the specified resource - group. Used for IKEV2 and radius based authentication. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param parameters: Parameters supplied to the generate virtual network gateway VPN client - package operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VpnClientParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either str or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[str] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._generate_vpn_profile_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_generate_vpn_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile'} # type: ignore - - def _get_vpn_profile_package_url_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[Optional[str]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_vpn_profile_package_url_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_vpn_profile_package_url_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} # type: ignore - - def begin_get_vpn_profile_package_url( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[str] - """Gets pre-generated VPN profile for P2S client of the virtual network gateway in the specified - resource group. The profile needs to be generated first using generateVpnProfile. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either str or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[str] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[str] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_vpn_profile_package_url_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('str', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_vpn_profile_package_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl'} # type: ignore - - def _get_bgp_peer_status_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - peer=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.BgpPeerStatusListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.BgpPeerStatusListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_bgp_peer_status_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if peer is not None: - query_parameters['peer'] = self._serialize.query("peer", peer, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('BgpPeerStatusListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_bgp_peer_status_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} # type: ignore - - def begin_get_bgp_peer_status( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - peer=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.BgpPeerStatusListResult"] - """The GetBgpPeerStatus operation retrieves the status of all BGP peers. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param peer: The IP address of the peer to retrieve the status of. - :type peer: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either BgpPeerStatusListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.BgpPeerStatusListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BgpPeerStatusListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_bgp_peer_status_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - peer=peer, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('BgpPeerStatusListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_bgp_peer_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getBgpPeerStatus'} # type: ignore - - def _get_learned_routes_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_learned_routes_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_learned_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} # type: ignore - - def begin_get_learned_routes( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.GatewayRouteListResult"] - """This operation retrieves a list of routes the virtual network gateway has learned, including - routes learned from BGP peers. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either GatewayRouteListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_learned_routes_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_learned_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getLearnedRoutes'} # type: ignore - - def _get_advertised_routes_initial( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - peer, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.GatewayRouteListResult"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GatewayRouteListResult"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self._get_advertised_routes_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['peer'] = self._serialize.query("peer", peer, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _get_advertised_routes_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} # type: ignore - - def begin_get_advertised_routes( - self, - resource_group_name, # type: str - virtual_network_gateway_name, # type: str - peer, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.GatewayRouteListResult"] - """This operation retrieves a list of routes the virtual network gateway is advertising to the - specified peer. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_gateway_name: The name of the virtual network gateway. - :type virtual_network_gateway_name: str - :param peer: The IP address of the peer. - :type peer: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either GatewayRouteListResult or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.GatewayRouteListResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayRouteListResult"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._get_advertised_routes_initial( - resource_group_name=resource_group_name, - virtual_network_gateway_name=virtual_network_gateway_name, - peer=peer, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('GatewayRouteListResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkGatewayName': self._serialize.url("virtual_network_gateway_name", virtual_network_gateway_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_get_advertised_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getAdvertisedRoutes'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_peerings_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_peerings_operations.py deleted file mode 100644 index 1bf372df425b..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_network_peerings_operations.py +++ /dev/null @@ -1,439 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class VirtualNetworkPeeringsOperations(object): - """VirtualNetworkPeeringsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - virtual_network_peering_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - virtual_network_peering_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified virtual network peering. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param virtual_network_peering_name: The name of the virtual network peering. - :type virtual_network_peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - virtual_network_peering_name=virtual_network_peering_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - virtual_network_peering_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualNetworkPeering" - """Gets the specified virtual network peering. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param virtual_network_peering_name: The name of the virtual network peering. - :type virtual_network_peering_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualNetworkPeering, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualNetworkPeering" - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(virtual_network_peering_parameters, 'VirtualNetworkPeering') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - virtual_network_peering_name, # type: str - virtual_network_peering_parameters, # type: "_models.VirtualNetworkPeering" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VirtualNetworkPeering"] - """Creates or updates a peering in the specified virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param virtual_network_peering_name: The name of the peering. - :type virtual_network_peering_name: str - :param virtual_network_peering_parameters: Parameters supplied to the create or update virtual - network peering operation. - :type virtual_network_peering_parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either VirtualNetworkPeering or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeering] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeering"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - virtual_network_peering_name=virtual_network_peering_name, - virtual_network_peering_parameters=virtual_network_peering_parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetworkPeering', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'virtualNetworkPeeringName': self._serialize.url("virtual_network_peering_name", virtual_network_peering_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}'} # type: ignore - - def list( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VirtualNetworkPeeringListResult"] - """Gets all virtual network peerings in a virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkPeeringListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkPeeringListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkPeeringListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkPeeringListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_networks_operations.py b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_networks_operations.py deleted file mode 100644 index bc6d1b0969fb..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/operations/_virtual_networks_operations.py +++ /dev/null @@ -1,627 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class VirtualNetworksOperations(object): - """VirtualNetworksOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.network.v2017_08_01.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - - # Construct URL - url = self._delete_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - def begin_delete( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified virtual network. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - expand=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualNetwork" - """Gets the specified virtual network by resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param expand: Expands referenced resources. - :type expand: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: VirtualNetwork, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.VirtualNetwork - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('VirtualNetwork', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - parameters, # type: "_models.VirtualNetwork" - **kwargs # type: Any - ): - # type: (...) -> "_models.VirtualNetwork" - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json, text/json" - - # Construct URL - url = self._create_or_update_initial.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'VirtualNetwork') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('VirtualNetwork', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('VirtualNetwork', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - def begin_create_or_update( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - parameters, # type: "_models.VirtualNetwork" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.VirtualNetwork"] - """Creates or updates a virtual network in the specified resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param parameters: Parameters supplied to the create or update virtual network operation. - :type parameters: ~azure.mgmt.network.v2017_08_01.models.VirtualNetwork - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. - Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: An instance of LROPoller that returns either VirtualNetwork or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_08_01.models.VirtualNetwork] - :raises ~azure.core.exceptions.HttpResponseError: - """ - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetwork"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - virtual_network_name=virtual_network_name, - parameters=parameters, - cls=lambda x,y,z: x, - **kwargs - ) - - kwargs.pop('error_map', None) - kwargs.pop('content_type', None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize('VirtualNetwork', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - - if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}'} # type: ignore - - def list_all( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VirtualNetworkListResult"] - """Gets all virtual networks in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_all.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks'} # type: ignore - - def list( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VirtualNetworkListResult"] - """Gets all virtual networks in a resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks'} # type: ignore - - def check_ip_address_availability( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - ip_address=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> "_models.IPAddressAvailabilityResult" - """Checks whether a private IP address is available for use. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :param ip_address: The private IP address to be verified. - :type ip_address: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: IPAddressAvailabilityResult, or the result of cls(response) - :rtype: ~azure.mgmt.network.v2017_08_01.models.IPAddressAvailabilityResult - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IPAddressAvailabilityResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - # Construct URL - url = self.check_ip_address_availability.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - if ip_address is not None: - query_parameters['ipAddress'] = self._serialize.query("ip_address", ip_address, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('IPAddressAvailabilityResult', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - check_ip_address_availability.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability'} # type: ignore - - def list_usage( - self, - resource_group_name, # type: str - virtual_network_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.VirtualNetworkListUsageResult"] - """Lists usage stats. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param virtual_network_name: The name of the virtual network. - :type virtual_network_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either VirtualNetworkListUsageResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2017_08_01.models.VirtualNetworkListUsageResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VirtualNetworkListUsageResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-08-01" - accept = "application/json, text/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_usage.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('VirtualNetworkListUsageResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'} # type: ignore diff --git a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/py.typed b/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_08_01/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file