diff --git a/azure-mgmt-network/azure/mgmt/network/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/network_management_client.py index 0480a46a5ffa..2b2a58cbf39e 100644 --- a/azure-mgmt-network/azure/mgmt/network/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/network_management_client.py @@ -1807,6 +1807,19 @@ def local_network_gateways(self): raise NotImplementedError("APIVersion {} is not available".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` + """ + api_version = self._get_api_version('nat_gateways') + if api_version == '2019-02-01': + from .v2019_02_01.operations import NatGatewaysOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".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: diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/__init__.py index d38c7489d54d..5e02d5873d65 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/__init__.py @@ -148,6 +148,8 @@ from .inbound_nat_pool_py3 import InboundNatPool from .outbound_rule_py3 import OutboundRule from .load_balancer_py3 import LoadBalancer + from .nat_gateway_sku_py3 import NatGatewaySku + from .nat_gateway_py3 import NatGateway from .azure_async_operation_result_py3 import AzureAsyncOperationResult from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule @@ -441,6 +443,8 @@ from .inbound_nat_pool import InboundNatPool from .outbound_rule import OutboundRule from .load_balancer import LoadBalancer + from .nat_gateway_sku import NatGatewaySku + from .nat_gateway import NatGateway from .azure_async_operation_result import AzureAsyncOperationResult from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation from .effective_network_security_rule import EffectiveNetworkSecurityRule @@ -623,6 +627,7 @@ from .outbound_rule_paged import OutboundRulePaged from .network_interface_paged import NetworkInterfacePaged from .probe_paged import ProbePaged +from .nat_gateway_paged import NatGatewayPaged from .network_interface_ip_configuration_paged import NetworkInterfaceIPConfigurationPaged from .network_interface_tap_configuration_paged import NetworkInterfaceTapConfigurationPaged from .network_profile_paged import NetworkProfilePaged @@ -710,6 +715,7 @@ LoadDistribution, ProbeProtocol, LoadBalancerOutboundRuleProtocol, + NatGatewaySkuName, NetworkOperationStatus, EffectiveSecurityRuleProtocol, EffectiveRouteSource, @@ -906,6 +912,8 @@ 'InboundNatPool', 'OutboundRule', 'LoadBalancer', + 'NatGatewaySku', + 'NatGateway', 'AzureAsyncOperationResult', 'EffectiveNetworkSecurityGroupAssociation', 'EffectiveNetworkSecurityRule', @@ -1088,6 +1096,7 @@ 'OutboundRulePaged', 'NetworkInterfacePaged', 'ProbePaged', + 'NatGatewayPaged', 'NetworkInterfaceIPConfigurationPaged', 'NetworkInterfaceTapConfigurationPaged', 'NetworkProfilePaged', @@ -1174,6 +1183,7 @@ 'LoadDistribution', 'ProbeProtocol', 'LoadBalancerOutboundRuleProtocol', + 'NatGatewaySkuName', 'NetworkOperationStatus', 'EffectiveSecurityRuleProtocol', 'EffectiveRouteSource', diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_redirect_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_redirect_configuration.py index 8336cc9e8904..b9a8d8a01d4d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_redirect_configuration.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_redirect_configuration.py @@ -17,9 +17,8 @@ class ApplicationGatewayRedirectConfiguration(SubResource): :param id: Resource ID. :type id: str - :param redirect_type: Supported http redirection types - Permanent, - Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', - 'SeeOther', 'Temporary' + :param redirect_type: HTTP redirection type. Possible values include: + 'Permanent', 'Found', 'SeeOther', 'Temporary' :type redirect_type: str or ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayRedirectType :param target_listener: Reference to a listener to redirect the request diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_redirect_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_redirect_configuration_py3.py index 28bbd5b4acc2..ce3deea2ca48 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_redirect_configuration_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/application_gateway_redirect_configuration_py3.py @@ -17,9 +17,8 @@ class ApplicationGatewayRedirectConfiguration(SubResource): :param id: Resource ID. :type id: str - :param redirect_type: Supported http redirection types - Permanent, - Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found', - 'SeeOther', 'Temporary' + :param redirect_type: HTTP redirection type. Possible values include: + 'Permanent', 'Found', 'SeeOther', 'Temporary' :type redirect_type: str or ~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayRedirectType :param target_listener: Reference to a listener to redirect the request diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway.py new file mode 100644 index 000000000000..f16f0e49697a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway.py @@ -0,0 +1,88 @@ +# 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 .resource import Resource + + +class NatGateway(Resource): + """Nat 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: Resource tags. + :type tags: dict[str, str] + :param sku: The nat gateway SKU. + :type sku: ~azure.mgmt.network.v2019_02_01.models.NatGatewaySku + :param idle_timeout_in_minutes: The idle timeout of the nat gateway. + :type idle_timeout_in_minutes: int + :param public_ip_addresses: An array of public ip addresses associated + with the nat gateway resource. + :type public_ip_addresses: + list[~azure.mgmt.network.v2019_02_01.models.SubResource] + :param public_ip_prefixes: An array of public ip prefixes associated with + the nat gateway resource. + :type public_ip_prefixes: + list[~azure.mgmt.network.v2019_02_01.models.SubResource] + :ivar subnets: An array of references to the subnets using this nat + gateway resource. + :vartype subnets: list[~azure.mgmt.network.v2019_02_01.models.SubResource] + :param resource_guid: The resource GUID property of the nat gateway + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the NatGateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: 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}'}, + 'sku': {'key': 'sku', 'type': 'NatGatewaySku'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'public_ip_addresses': {'key': 'properties.publicIpAddresses', 'type': '[SubResource]'}, + 'public_ip_prefixes': {'key': 'properties.publicIpPrefixes', 'type': '[SubResource]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[SubResource]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NatGateway, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None) + self.public_ip_addresses = kwargs.get('public_ip_addresses', None) + self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None) + self.subnets = None + self.resource_guid = kwargs.get('resource_guid', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_paged.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_paged.py new file mode 100644 index 000000000000..a65346590f9b --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class NatGatewayPaged(Paged): + """ + A paging container for iterating over a list of :class:`NatGateway ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[NatGateway]'} + } + + def __init__(self, *args, **kwargs): + + super(NatGatewayPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_py3.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_py3.py new file mode 100644 index 000000000000..3512ebdd507f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_py3.py @@ -0,0 +1,88 @@ +# 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 .resource_py3 import Resource + + +class NatGateway(Resource): + """Nat 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: Resource tags. + :type tags: dict[str, str] + :param sku: The nat gateway SKU. + :type sku: ~azure.mgmt.network.v2019_02_01.models.NatGatewaySku + :param idle_timeout_in_minutes: The idle timeout of the nat gateway. + :type idle_timeout_in_minutes: int + :param public_ip_addresses: An array of public ip addresses associated + with the nat gateway resource. + :type public_ip_addresses: + list[~azure.mgmt.network.v2019_02_01.models.SubResource] + :param public_ip_prefixes: An array of public ip prefixes associated with + the nat gateway resource. + :type public_ip_prefixes: + list[~azure.mgmt.network.v2019_02_01.models.SubResource] + :ivar subnets: An array of references to the subnets using this nat + gateway resource. + :vartype subnets: list[~azure.mgmt.network.v2019_02_01.models.SubResource] + :param resource_guid: The resource GUID property of the nat gateway + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the NatGateway + resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. + :type provisioning_state: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: 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}'}, + 'sku': {'key': 'sku', 'type': 'NatGatewaySku'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'public_ip_addresses': {'key': 'properties.publicIpAddresses', 'type': '[SubResource]'}, + 'public_ip_prefixes': {'key': 'properties.publicIpPrefixes', 'type': '[SubResource]'}, + 'subnets': {'key': 'properties.subnets', 'type': '[SubResource]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, idle_timeout_in_minutes: int=None, public_ip_addresses=None, public_ip_prefixes=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(NatGateway, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.public_ip_addresses = public_ip_addresses + self.public_ip_prefixes = public_ip_prefixes + self.subnets = None + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_sku.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_sku.py new file mode 100644 index 000000000000..5974f546c588 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_sku.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class NatGatewaySku(Model): + """SKU of nat gateway. + + :param name: Name of Nat Gateway SKU. Possible values include: 'Standard' + :type name: str or + ~azure.mgmt.network.v2019_02_01.models.NatGatewaySkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NatGatewaySku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_sku_py3.py new file mode 100644 index 000000000000..e98586b828fb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/nat_gateway_sku_py3.py @@ -0,0 +1,29 @@ +# 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 msrest.serialization import Model + + +class NatGatewaySku(Model): + """SKU of nat gateway. + + :param name: Name of Nat Gateway SKU. Possible values include: 'Standard' + :type name: str or + ~azure.mgmt.network.v2019_02_01.models.NatGatewaySkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(NatGatewaySku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/network_management_client_enums.py index e3fbde3e5a99..882b3f3a017d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/network_management_client_enums.py @@ -374,6 +374,11 @@ class LoadBalancerOutboundRuleProtocol(str, Enum): all = "All" +class NatGatewaySkuName(str, Enum): + + standard = "Standard" + + class NetworkOperationStatus(str, Enum): in_progress = "InProgress" diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/subnet.py index 5d11d65b6b0b..b109f42e5084 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/subnet.py @@ -30,6 +30,8 @@ class Subnet(SubResource): ~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroup :param route_table: The reference of the RouteTable resource. :type route_table: ~azure.mgmt.network.v2019_02_01.models.RouteTable + :param nat_gateway: Nat gateway associated with this subnet. + :type nat_gateway: ~azure.mgmt.network.v2019_02_01.models.SubResource :param service_endpoints: An array of service endpoints. :type service_endpoints: list[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPropertiesFormat] @@ -84,6 +86,7 @@ class Subnet(SubResource): 'address_prefixes': {'key': 'properties.addressPrefixes', 'type': '[str]'}, 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'nat_gateway': {'key': 'properties.natGateway', 'type': 'SubResource'}, 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, 'service_endpoint_policies': {'key': 'properties.serviceEndpointPolicies', 'type': '[ServiceEndpointPolicy]'}, 'interface_endpoints': {'key': 'properties.interfaceEndpoints', 'type': '[InterfaceEndpoint]'}, @@ -104,6 +107,7 @@ def __init__(self, **kwargs): self.address_prefixes = kwargs.get('address_prefixes', None) self.network_security_group = kwargs.get('network_security_group', None) self.route_table = kwargs.get('route_table', None) + self.nat_gateway = kwargs.get('nat_gateway', None) self.service_endpoints = kwargs.get('service_endpoints', None) self.service_endpoint_policies = kwargs.get('service_endpoint_policies', None) self.interface_endpoints = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/subnet_py3.py index aeb32ce5a55b..6094c68a4482 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/subnet_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/subnet_py3.py @@ -30,6 +30,8 @@ class Subnet(SubResource): ~azure.mgmt.network.v2019_02_01.models.NetworkSecurityGroup :param route_table: The reference of the RouteTable resource. :type route_table: ~azure.mgmt.network.v2019_02_01.models.RouteTable + :param nat_gateway: Nat gateway associated with this subnet. + :type nat_gateway: ~azure.mgmt.network.v2019_02_01.models.SubResource :param service_endpoints: An array of service endpoints. :type service_endpoints: list[~azure.mgmt.network.v2019_02_01.models.ServiceEndpointPropertiesFormat] @@ -84,6 +86,7 @@ class Subnet(SubResource): 'address_prefixes': {'key': 'properties.addressPrefixes', 'type': '[str]'}, 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, + 'nat_gateway': {'key': 'properties.natGateway', 'type': 'SubResource'}, 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, 'service_endpoint_policies': {'key': 'properties.serviceEndpointPolicies', 'type': '[ServiceEndpointPolicy]'}, 'interface_endpoints': {'key': 'properties.interfaceEndpoints', 'type': '[InterfaceEndpoint]'}, @@ -98,12 +101,13 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, *, id: str=None, address_prefix: str=None, address_prefixes=None, network_security_group=None, route_table=None, service_endpoints=None, service_endpoint_policies=None, resource_navigation_links=None, service_association_links=None, delegations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + def __init__(self, *, id: str=None, address_prefix: str=None, address_prefixes=None, network_security_group=None, route_table=None, nat_gateway=None, service_endpoints=None, service_endpoint_policies=None, resource_navigation_links=None, service_association_links=None, delegations=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: super(Subnet, self).__init__(id=id, **kwargs) self.address_prefix = address_prefix self.address_prefixes = address_prefixes self.network_security_group = network_security_group self.route_table = route_table + self.nat_gateway = nat_gateway self.service_endpoints = service_endpoints self.service_endpoint_policies = service_endpoint_policies self.interface_endpoints = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/network_management_client.py index 39094f54d8af..9e3aea895e88 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/network_management_client.py @@ -49,6 +49,7 @@ from .operations.load_balancer_outbound_rules_operations import LoadBalancerOutboundRulesOperations from .operations.load_balancer_network_interfaces_operations import LoadBalancerNetworkInterfacesOperations from .operations.load_balancer_probes_operations import LoadBalancerProbesOperations +from .operations.nat_gateways_operations import NatGatewaysOperations from .operations.network_interfaces_operations import NetworkInterfacesOperations from .operations.network_interface_ip_configurations_operations import NetworkInterfaceIPConfigurationsOperations from .operations.network_interface_load_balancers_operations import NetworkInterfaceLoadBalancersOperations @@ -193,6 +194,8 @@ class NetworkManagementClient(SDKClient): :vartype load_balancer_network_interfaces: azure.mgmt.network.v2019_02_01.operations.LoadBalancerNetworkInterfacesOperations :ivar load_balancer_probes: LoadBalancerProbes operations :vartype load_balancer_probes: azure.mgmt.network.v2019_02_01.operations.LoadBalancerProbesOperations + :ivar nat_gateways: NatGateways operations + :vartype nat_gateways: azure.mgmt.network.v2019_02_01.operations.NatGatewaysOperations :ivar network_interfaces: NetworkInterfaces operations :vartype network_interfaces: azure.mgmt.network.v2019_02_01.operations.NetworkInterfacesOperations :ivar network_interface_ip_configurations: NetworkInterfaceIPConfigurations operations @@ -354,6 +357,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.load_balancer_probes = LoadBalancerProbesOperations( self._client, self.config, self._serialize, self._deserialize) + self.nat_gateways = NatGatewaysOperations( + 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( diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/__init__.py index d9ad2fbcce01..af36d65a6f38 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/__init__.py @@ -40,6 +40,7 @@ from .load_balancer_outbound_rules_operations import LoadBalancerOutboundRulesOperations from .load_balancer_network_interfaces_operations import LoadBalancerNetworkInterfacesOperations from .load_balancer_probes_operations import LoadBalancerProbesOperations +from .nat_gateways_operations import NatGatewaysOperations from .network_interfaces_operations import NetworkInterfacesOperations from .network_interface_ip_configurations_operations import NetworkInterfaceIPConfigurationsOperations from .network_interface_load_balancers_operations import NetworkInterfaceLoadBalancersOperations @@ -112,6 +113,7 @@ 'LoadBalancerOutboundRulesOperations', 'LoadBalancerNetworkInterfacesOperations', 'LoadBalancerProbesOperations', + 'NatGatewaysOperations', 'NetworkInterfacesOperations', 'NetworkInterfaceIPConfigurationsOperations', 'NetworkInterfaceLoadBalancersOperations', diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/application_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/application_gateways_operations.py index 712b1de3809a..84bbc7ef6841 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/application_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/application_gateways_operations.py @@ -590,7 +590,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -669,7 +669,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -770,7 +770,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/connection_monitors_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/connection_monitors_operations.py index 36c3eb7c1957..a3d6c9801154 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/connection_monitors_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/connection_monitors_operations.py @@ -371,7 +371,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -454,7 +454,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -555,7 +555,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/express_route_circuits_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/express_route_circuits_operations.py index a526877894e4..1d4b30eb8aa0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/express_route_circuits_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/express_route_circuits_operations.py @@ -483,7 +483,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -587,7 +587,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -691,7 +691,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/express_route_cross_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/express_route_cross_connections_operations.py index a64723675c2f..9ee4fa732d5e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/express_route_cross_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/express_route_cross_connections_operations.py @@ -540,7 +540,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -645,7 +645,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -750,7 +750,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/nat_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/nat_gateways_operations.py new file mode 100644 index 000000000000..2b4eb005d378 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/nat_gateways_operations.py @@ -0,0 +1,491 @@ +# 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 uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class NatGatewaysOperations(object): + """NatGatewaysOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2019-02-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-02-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, nat_gateway_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, nat_gateway_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified nat gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} + + def get( + self, resource_group_name, nat_gateway_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified nat gateway in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param expand: Expands referenced resources. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NatGateway or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2019_02_01.models.NatGateway or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NatGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} + + + def _create_or_update_initial( + self, resource_group_name, nat_gateway_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'NatGateway') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NatGateway', response) + if response.status_code == 201: + deserialized = self._deserialize('NatGateway', response) + if response.status_code == 202: + deserialized = self._deserialize('NatGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, nat_gateway_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a nat gateway. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param parameters: Parameters supplied to the create or update nat + gateway operation. + :type parameters: ~azure.mgmt.network.v2019_02_01.models.NatGateway + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NatGateway or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_02_01.models.NatGateway] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_02_01.models.NatGateway]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + nat_gateway_name=nat_gateway_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('NatGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} + + def update_tags( + self, resource_group_name, nat_gateway_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates nat gateway tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param nat_gateway_name: The name of the nat gateway. + :type nat_gateway_name: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: NatGateway or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2019_02_01.models.NatGateway or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update_tags.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'natGatewayName': self._serialize.url("nat_gateway_name", nat_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'TagsObject') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('NatGateway', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways/{natGatewayName}'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the Nat Gateways in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NatGateway + :rtype: + ~azure.mgmt.network.v2019_02_01.models.NatGatewayPaged[~azure.mgmt.network.v2019_02_01.models.NatGateway] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NatGatewayPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NatGatewayPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/natGateways'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all nat gateways in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of NatGateway + :rtype: + ~azure.mgmt.network.v2019_02_01.models.NatGatewayPaged[~azure.mgmt.network.v2019_02_01.models.NatGateway] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.NatGatewayPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.NatGatewayPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/natGateways'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/network_interfaces_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/network_interfaces_operations.py index 39a8e5e48354..40055e3cec22 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/network_interfaces_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/network_interfaces_operations.py @@ -621,7 +621,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -718,7 +718,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/network_watchers_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/network_watchers_operations.py index 5bf856906b45..35298219e5e7 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/network_watchers_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/network_watchers_operations.py @@ -613,7 +613,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -716,7 +716,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -820,7 +820,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -923,7 +923,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1027,7 +1027,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1132,7 +1132,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1238,7 +1238,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1344,7 +1344,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1449,7 +1449,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1554,7 +1554,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/p2s_vpn_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/p2s_vpn_gateways_operations.py index a3ecaaee13dd..9ad7d4b1550e 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/p2s_vpn_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/p2s_vpn_gateways_operations.py @@ -619,7 +619,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/packet_captures_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/packet_captures_operations.py index bb348d88cf1a..c8e82744356b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/packet_captures_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/packet_captures_operations.py @@ -364,7 +364,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/subnets_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/subnets_operations.py index 36b2e427f589..ad0b287adfb0 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/subnets_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/subnets_operations.py @@ -384,7 +384,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/virtual_network_gateway_connections_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/virtual_network_gateway_connections_operations.py index 689a4ef9d00a..2c81a5b2a776 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/virtual_network_gateway_connections_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/virtual_network_gateway_connections_operations.py @@ -742,7 +742,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/virtual_network_gateways_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/virtual_network_gateways_operations.py index a999b6828e27..c78519a61409 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/virtual_network_gateways_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/virtual_network_gateways_operations.py @@ -625,7 +625,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -706,7 +706,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -943,7 +943,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1042,7 +1042,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1199,7 +1199,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1298,7 +1298,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1405,7 +1405,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) @@ -1501,7 +1501,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) diff --git a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/vpn_sites_configuration_operations.py b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/vpn_sites_configuration_operations.py index 61b1328ec175..0a179465effc 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/vpn_sites_configuration_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/vpn_sites_configuration_operations.py @@ -126,7 +126,7 @@ def get_long_running_output(response): lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method)