From 913ca95b0fea3e20010b683f25de5d470ed73eca Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 30 Jul 2018 18:37:50 +0000 Subject: [PATCH 1/3] Generated from 3ed88d4ee046320288e3c4c7b7ba5db96d348cb2 added global reach flag --- .../network/v2018_07_01/models/express_route_circuit.py | 4 ++++ .../network/v2018_07_01/models/express_route_circuit_py3.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/express_route_circuit.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/express_route_circuit.py index 0b0e420b264c..5465899a5bbf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/express_route_circuit.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/express_route_circuit.py @@ -60,6 +60,8 @@ class ExpressRouteCircuit(Resource): :type provisioning_state: str :param gateway_manager_etag: The GatewayManager Etag. :type gateway_manager_etag: str + :param allow_global_reach: Flag to enable Global Reach on the circuit. + :type allow_global_reach: bool :ivar etag: Gets a unique read-only string that changes whenever the resource is updated. :vartype etag: str @@ -88,6 +90,7 @@ class ExpressRouteCircuit(Resource): 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'allow_global_reach': {'key': 'properties.allowGlobalReach', 'type': 'bool'}, 'etag': {'key': 'etag', 'type': 'str'}, } @@ -104,4 +107,5 @@ def __init__(self, **kwargs): 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) + self.allow_global_reach = kwargs.get('allow_global_reach', None) self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/express_route_circuit_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/express_route_circuit_py3.py index 6d07350e607f..5bf7f80f5dcf 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/express_route_circuit_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/express_route_circuit_py3.py @@ -60,6 +60,8 @@ class ExpressRouteCircuit(Resource): :type provisioning_state: str :param gateway_manager_etag: The GatewayManager Etag. :type gateway_manager_etag: str + :param allow_global_reach: Flag to enable Global Reach on the circuit. + :type allow_global_reach: bool :ivar etag: Gets a unique read-only string that changes whenever the resource is updated. :vartype etag: str @@ -88,10 +90,11 @@ class ExpressRouteCircuit(Resource): 'service_provider_properties': {'key': 'properties.serviceProviderProperties', 'type': 'ExpressRouteCircuitServiceProviderProperties'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'gateway_manager_etag': {'key': 'properties.gatewayManagerEtag', 'type': 'str'}, + 'allow_global_reach': {'key': 'properties.allowGlobalReach', 'type': 'bool'}, 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, **kwargs) -> None: + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, allow_classic_operations: bool=None, circuit_provisioning_state: str=None, service_provider_provisioning_state=None, authorizations=None, peerings=None, service_key: str=None, service_provider_notes: str=None, service_provider_properties=None, provisioning_state: str=None, gateway_manager_etag: str=None, allow_global_reach: bool=None, **kwargs) -> None: super(ExpressRouteCircuit, self).__init__(id=id, location=location, tags=tags, **kwargs) self.sku = sku self.allow_classic_operations = allow_classic_operations @@ -104,4 +107,5 @@ def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, all self.service_provider_properties = service_provider_properties self.provisioning_state = provisioning_state self.gateway_manager_etag = gateway_manager_etag + self.allow_global_reach = allow_global_reach self.etag = None From 607a03fe71e681d395db79d4b324a62216a4168c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 31 Jul 2018 19:48:40 +0000 Subject: [PATCH 2/3] Generated from f4cf723a9e40c5283efc4573ecca3cc130d8a6a6 Merge branch 'Network-August-Release' into Network-August-Release --- .../mgmt/network/network_management_client.py | 13 + .../network/v2018_07_01/models/__init__.py | 13 + .../mgmt/network/v2018_07_01/models/ip_tag.py | 2 +- .../network/v2018_07_01/models/ip_tag_py3.py | 2 +- .../models/network_management_client_enums.py | 5 + .../v2018_07_01/models/public_ip_address.py | 6 + .../models/public_ip_address_py3.py | 8 +- .../v2018_07_01/models/public_ip_prefix.py | 98 ++++ .../models/public_ip_prefix_paged.py | 27 + .../models/public_ip_prefix_py3.py | 98 ++++ .../models/public_ip_prefix_sku.py | 30 + .../models/public_ip_prefix_sku_py3.py | 30 + .../models/referenced_public_ip_address.py | 28 + .../referenced_public_ip_address_py3.py | 28 + .../v2018_07_01/network_management_client.py | 5 + .../v2018_07_01/operations/__init__.py | 2 + .../public_ip_prefixes_operations.py | 522 ++++++++++++++++++ 17 files changed, 914 insertions(+), 3 deletions(-) create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_paged.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_py3.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_sku.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_sku_py3.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/referenced_public_ip_address.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/referenced_public_ip_address_py3.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/public_ip_prefixes_operations.py 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 9d6a67a860ff..5460c913190b 100644 --- a/azure-mgmt-network/azure/mgmt/network/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/network_management_client.py @@ -1516,6 +1516,19 @@ def public_ip_addresses(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 public_ip_prefixes(self): + """Instance depends on the API version: + + * 2018-07-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 + 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 route_filter_rules(self): """Instance depends on the API version: diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/__init__.py index 5dbefcc0eb66..8d3de9baf722 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/__init__.py @@ -33,6 +33,9 @@ from .public_ip_address_sku_py3 import PublicIPAddressSku from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings from .ip_tag_py3 import IpTag + from .public_ip_prefix_sku_py3 import PublicIPPrefixSku + from .referenced_public_ip_address_py3 import ReferencedPublicIpAddress + from .public_ip_prefix_py3 import PublicIPPrefix from .public_ip_address_py3 import PublicIPAddress from .ip_configuration_py3 import IPConfiguration from .resource_navigation_link_py3 import ResourceNavigationLink @@ -248,6 +251,9 @@ from .public_ip_address_sku import PublicIPAddressSku from .public_ip_address_dns_settings import PublicIPAddressDnsSettings from .ip_tag import IpTag + from .public_ip_prefix_sku import PublicIPPrefixSku + from .referenced_public_ip_address import ReferencedPublicIpAddress + from .public_ip_prefix import PublicIPPrefix from .public_ip_address import PublicIPAddress from .ip_configuration import IPConfiguration from .resource_navigation_link import ResourceNavigationLink @@ -466,6 +472,7 @@ from .connection_monitor_result_paged import ConnectionMonitorResultPaged from .operation_paged import OperationPaged from .public_ip_address_paged import PublicIPAddressPaged +from .public_ip_prefix_paged import PublicIPPrefixPaged from .route_filter_paged import RouteFilterPaged from .route_filter_rule_paged import RouteFilterRulePaged from .route_table_paged import RouteTablePaged @@ -499,6 +506,7 @@ SecurityRuleDirection, RouteNextHopType, PublicIPAddressSkuName, + PublicIPPrefixSkuName, ApplicationGatewayProtocol, ApplicationGatewayCookieBasedAffinity, ApplicationGatewayBackendHealthServerHealth, @@ -591,6 +599,9 @@ 'PublicIPAddressSku', 'PublicIPAddressDnsSettings', 'IpTag', + 'PublicIPPrefixSku', + 'ReferencedPublicIpAddress', + 'PublicIPPrefix', 'PublicIPAddress', 'IPConfiguration', 'ResourceNavigationLink', @@ -809,6 +820,7 @@ 'ConnectionMonitorResultPaged', 'OperationPaged', 'PublicIPAddressPaged', + 'PublicIPPrefixPaged', 'RouteFilterPaged', 'RouteFilterRulePaged', 'RouteTablePaged', @@ -841,6 +853,7 @@ 'SecurityRuleDirection', 'RouteNextHopType', 'PublicIPAddressSkuName', + 'PublicIPPrefixSkuName', 'ApplicationGatewayProtocol', 'ApplicationGatewayCookieBasedAffinity', 'ApplicationGatewayBackendHealthServerHealth', diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/ip_tag.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/ip_tag.py index b8690371226d..559dddc661d2 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/ip_tag.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/ip_tag.py @@ -13,7 +13,7 @@ class IpTag(Model): - """Contains the IpTag associated with the public IP address. + """Contains the IpTag associated with the object. :param ip_tag_type: Gets or sets the ipTag type: Example FirstPartyUsage. :type ip_tag_type: str diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/ip_tag_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/ip_tag_py3.py index fbb5338ff30e..2370c408761c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/ip_tag_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/ip_tag_py3.py @@ -13,7 +13,7 @@ class IpTag(Model): - """Contains the IpTag associated with the public IP address. + """Contains the IpTag associated with the object. :param ip_tag_type: Gets or sets the ipTag type: Example FirstPartyUsage. :type ip_tag_type: str diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/network_management_client_enums.py index 4bcd75a97a07..2dea047096aa 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/network_management_client_enums.py @@ -93,6 +93,11 @@ class PublicIPAddressSkuName(str, Enum): standard = "Standard" +class PublicIPPrefixSkuName(str, Enum): + + standard = "Standard" + + class ApplicationGatewayProtocol(str, Enum): http = "Http" diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_address.py index 5ca7f0d8becb..5581eb3e5414 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_address.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_address.py @@ -52,6 +52,10 @@ class PublicIPAddress(Resource): :param ip_address: The IP address associated with the public IP address resource. :type ip_address: str + :param public_ip_prefix: The Public IP Prefix this Public IP Address + should be allocated from. + :type public_ip_prefix: + ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix :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 @@ -87,6 +91,7 @@ class PublicIPAddress(Resource): 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'PublicIPPrefix'}, 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -103,6 +108,7 @@ def __init__(self, **kwargs): self.dns_settings = kwargs.get('dns_settings', None) self.ip_tags = kwargs.get('ip_tags', None) self.ip_address = kwargs.get('ip_address', None) + self.public_ip_prefix = kwargs.get('public_ip_prefix', 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) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_address_py3.py index 1906a4e39cce..33d3adc327f1 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_address_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_address_py3.py @@ -52,6 +52,10 @@ class PublicIPAddress(Resource): :param ip_address: The IP address associated with the public IP address resource. :type ip_address: str + :param public_ip_prefix: The Public IP Prefix this Public IP Address + should be allocated from. + :type public_ip_prefix: + ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix :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 @@ -87,6 +91,7 @@ class PublicIPAddress(Resource): 'dns_settings': {'key': 'properties.dnsSettings', 'type': 'PublicIPAddressDnsSettings'}, 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, 'ip_address': {'key': 'properties.ipAddress', 'type': 'str'}, + 'public_ip_prefix': {'key': 'properties.publicIPPrefix', 'type': 'PublicIPPrefix'}, 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -94,7 +99,7 @@ class PublicIPAddress(Resource): 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_tags=None, ip_address: str=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_allocation_method=None, public_ip_address_version=None, dns_settings=None, ip_tags=None, ip_address: str=None, public_ip_prefix=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: super(PublicIPAddress, self).__init__(id=id, location=location, tags=tags, **kwargs) self.sku = sku self.public_ip_allocation_method = public_ip_allocation_method @@ -103,6 +108,7 @@ def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, pub self.dns_settings = dns_settings self.ip_tags = ip_tags self.ip_address = ip_address + self.public_ip_prefix = public_ip_prefix self.idle_timeout_in_minutes = idle_timeout_in_minutes self.resource_guid = resource_guid self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix.py new file mode 100644 index 000000000000..425836cfd749 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix.py @@ -0,0 +1,98 @@ +# 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 PublicIPPrefix(Resource): + """Public IP prefix 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 public IP prefix SKU. + :type sku: ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixSku + :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.v2018_07_01.models.IPVersion + :param ip_tags: The list of tags associated with the public IP prefix. + :type ip_tags: list[~azure.mgmt.network.v2018_07_01.models.IpTag] + :param prefix_length: The Length of the Public IP Prefix. + :type prefix_length: int + :param ip_prefix: The allocated Prefix + :type ip_prefix: str + :param public_ip_addresses: The list of all referenced PublicIPAddresses + :type public_ip_addresses: + list[~azure.mgmt.network.v2018_07_01.models.ReferencedPublicIpAddress] + :param idle_timeout_in_minutes: The idle timeout of the public IP prefix. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP prefix + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the Public IP prefix + 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 + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[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': 'PublicIPPrefixSku'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, + 'prefix_length': {'key': 'properties.prefixLength', 'type': 'int'}, + 'ip_prefix': {'key': 'properties.ipPrefix', 'type': 'str'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[ReferencedPublicIpAddress]'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(PublicIPPrefix, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.public_ip_address_version = kwargs.get('public_ip_address_version', None) + self.ip_tags = kwargs.get('ip_tags', None) + self.prefix_length = kwargs.get('prefix_length', None) + self.ip_prefix = kwargs.get('ip_prefix', None) + self.public_ip_addresses = kwargs.get('public_ip_addresses', 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) + self.etag = kwargs.get('etag', None) + self.zones = kwargs.get('zones', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_paged.py new file mode 100644 index 000000000000..eca84093553c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_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 PublicIPPrefixPaged(Paged): + """ + A paging container for iterating over a list of :class:`PublicIPPrefix ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PublicIPPrefix]'} + } + + def __init__(self, *args, **kwargs): + + super(PublicIPPrefixPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_py3.py new file mode 100644 index 000000000000..29d86abb92c9 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_py3.py @@ -0,0 +1,98 @@ +# 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 PublicIPPrefix(Resource): + """Public IP prefix 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 public IP prefix SKU. + :type sku: ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixSku + :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.v2018_07_01.models.IPVersion + :param ip_tags: The list of tags associated with the public IP prefix. + :type ip_tags: list[~azure.mgmt.network.v2018_07_01.models.IpTag] + :param prefix_length: The Length of the Public IP Prefix. + :type prefix_length: int + :param ip_prefix: The allocated Prefix + :type ip_prefix: str + :param public_ip_addresses: The list of all referenced PublicIPAddresses + :type public_ip_addresses: + list[~azure.mgmt.network.v2018_07_01.models.ReferencedPublicIpAddress] + :param idle_timeout_in_minutes: The idle timeout of the public IP prefix. + :type idle_timeout_in_minutes: int + :param resource_guid: The resource GUID property of the public IP prefix + resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the Public IP prefix + 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 + :param zones: A list of availability zones denoting the IP allocated for + the resource needs to come from. + :type zones: list[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': 'PublicIPPrefixSku'}, + 'public_ip_address_version': {'key': 'properties.publicIPAddressVersion', 'type': 'str'}, + 'ip_tags': {'key': 'properties.ipTags', 'type': '[IpTag]'}, + 'prefix_length': {'key': 'properties.prefixLength', 'type': 'int'}, + 'ip_prefix': {'key': 'properties.ipPrefix', 'type': 'str'}, + 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[ReferencedPublicIpAddress]'}, + 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_address_version=None, ip_tags=None, prefix_length: int=None, ip_prefix: str=None, public_ip_addresses=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: + super(PublicIPPrefix, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.sku = sku + self.public_ip_address_version = public_ip_address_version + self.ip_tags = ip_tags + self.prefix_length = prefix_length + self.ip_prefix = ip_prefix + self.public_ip_addresses = public_ip_addresses + self.idle_timeout_in_minutes = idle_timeout_in_minutes + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag + self.zones = zones diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_sku.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_sku.py new file mode 100644 index 000000000000..d462fd131686 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_sku.py @@ -0,0 +1,30 @@ +# 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 PublicIPPrefixSku(Model): + """SKU of a public IP prefix. + + :param name: Name of a public IP prefix SKU. Possible values include: + 'Standard' + :type name: str or + ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PublicIPPrefixSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_sku_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_sku_py3.py new file mode 100644 index 000000000000..84a889d84ae4 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_sku_py3.py @@ -0,0 +1,30 @@ +# 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 PublicIPPrefixSku(Model): + """SKU of a public IP prefix. + + :param name: Name of a public IP prefix SKU. Possible values include: + 'Standard' + :type name: str or + ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixSkuName + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name=None, **kwargs) -> None: + super(PublicIPPrefixSku, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/referenced_public_ip_address.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/referenced_public_ip_address.py new file mode 100644 index 000000000000..76807023de75 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/referenced_public_ip_address.py @@ -0,0 +1,28 @@ +# 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 ReferencedPublicIpAddress(Model): + """ReferencedPublicIpAddress. + + :param id: The PublicIPAddress Reference + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ReferencedPublicIpAddress, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/referenced_public_ip_address_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/referenced_public_ip_address_py3.py new file mode 100644 index 000000000000..3d078b57123a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/referenced_public_ip_address_py3.py @@ -0,0 +1,28 @@ +# 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 ReferencedPublicIpAddress(Model): + """ReferencedPublicIpAddress. + + :param id: The PublicIPAddress Reference + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(ReferencedPublicIpAddress, self).__init__(**kwargs) + self.id = id diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/network_management_client.py index 854ccc2bbf9f..4b3d1d23c9da 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/network_management_client.py @@ -48,6 +48,7 @@ from .operations.connection_monitors_operations import ConnectionMonitorsOperations from .operations.operations import Operations from .operations.public_ip_addresses_operations import PublicIPAddressesOperations +from .operations.public_ip_prefixes_operations import PublicIPPrefixesOperations from .operations.route_filters_operations import RouteFiltersOperations from .operations.route_filter_rules_operations import RouteFilterRulesOperations from .operations.route_tables_operations import RouteTablesOperations @@ -170,6 +171,8 @@ class NetworkManagementClient(SDKClient): :vartype operations: azure.mgmt.network.v2018_07_01.operations.Operations :ivar public_ip_addresses: PublicIPAddresses operations :vartype public_ip_addresses: azure.mgmt.network.v2018_07_01.operations.PublicIPAddressesOperations + :ivar public_ip_prefixes: PublicIPPrefixes operations + :vartype public_ip_prefixes: azure.mgmt.network.v2018_07_01.operations.PublicIPPrefixesOperations :ivar route_filters: RouteFilters operations :vartype route_filters: azure.mgmt.network.v2018_07_01.operations.RouteFiltersOperations :ivar route_filter_rules: RouteFilterRules operations @@ -289,6 +292,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.public_ip_addresses = PublicIPAddressesOperations( self._client, self.config, self._serialize, self._deserialize) + self.public_ip_prefixes = PublicIPPrefixesOperations( + 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( diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/__init__.py index 7920434f1e6d..13391369898c 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/__init__.py @@ -39,6 +39,7 @@ from .connection_monitors_operations import ConnectionMonitorsOperations from .operations import Operations from .public_ip_addresses_operations import PublicIPAddressesOperations +from .public_ip_prefixes_operations import PublicIPPrefixesOperations from .route_filters_operations import RouteFiltersOperations from .route_filter_rules_operations import RouteFilterRulesOperations from .route_tables_operations import RouteTablesOperations @@ -90,6 +91,7 @@ 'ConnectionMonitorsOperations', 'Operations', 'PublicIPAddressesOperations', + 'PublicIPPrefixesOperations', 'RouteFiltersOperations', 'RouteFilterRulesOperations', 'RouteTablesOperations', diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/public_ip_prefixes_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/public_ip_prefixes_operations.py new file mode 100644 index 000000000000..632b245510de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/public_ip_prefixes_operations.py @@ -0,0 +1,522 @@ +# 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 PublicIPPrefixesOperations(object): + """PublicIPPrefixesOperations 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: "2018-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, public_ip_prefix_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'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._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, public_ip_prefix_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified public IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the PublicIpPrefix. + :type public_ip_prefix_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, + public_ip_prefix_name=public_ip_prefix_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/publicIPPrefixes/{publicIpPrefixName}'} + + def get( + self, resource_group_name, public_ip_prefix_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified public IP prefix in a specified resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the PublicIPPrefx. + :type public_ip_prefix_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: PublicIPPrefix or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix 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'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._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('PublicIPPrefix', 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/publicIPPrefixes/{publicIpPrefixName}'} + + + def _create_or_update_initial( + self, resource_group_name, public_ip_prefix_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'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._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, 'PublicIPPrefix') + + # 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]: + 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('PublicIPPrefix', response) + if response.status_code == 201: + deserialized = self._deserialize('PublicIPPrefix', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, public_ip_prefix_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a static or dynamic public IP prefix. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. + :type public_ip_prefix_name: str + :param parameters: Parameters supplied to the create or update public + IP prefix operation. + :type parameters: + ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix + :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 PublicIPPrefix or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PublicIPPrefix', 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/publicIPPrefixes/{publicIpPrefixName}'} + + + def _update_tags_initial( + self, resource_group_name, public_ip_prefix_name, tags=None, custom_headers=None, raw=False, **operation_config): + 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'), + 'publicIpPrefixName': self._serialize.url("public_ip_prefix_name", public_ip_prefix_name, 'str'), + 'subscriptionId': self._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('PublicIPPrefix', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_tags( + self, resource_group_name, public_ip_prefix_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates public IP prefix tags. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param public_ip_prefix_name: The name of the public IP prefix. + :type public_ip_prefix_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: 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 PublicIPPrefix or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix]] + :raises: :class:`CloudError` + """ + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + public_ip_prefix_name=public_ip_prefix_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('PublicIPPrefix', 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) + update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIpPrefixName}'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the public IP prefixes 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 PublicIPPrefix + :rtype: + ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix] + :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.PublicIPPrefixPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PublicIPPrefixPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPPrefixes'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all public IP prefixes 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 PublicIPPrefix + :rtype: + ~azure.mgmt.network.v2018_07_01.models.PublicIPPrefixPaged[~azure.mgmt.network.v2018_07_01.models.PublicIPPrefix] + :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.PublicIPPrefixPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PublicIPPrefixPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes'} From aa19b74666a8409dd32405e79854a7d69b0cd3ba Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 6 Aug 2018 22:35:10 +0000 Subject: [PATCH 3/3] Generated from ae8722239577084e9af0a79160e0606f4718ff91 Merge branch 'Network-August-Release' into Network-August-Release --- .../mgmt/network/network_management_client.py | 26 + .../network/v2018_07_01/models/__init__.py | 10 + .../v2018_07_01/models/inbound_nat_pool.py | 6 + .../models/inbound_nat_pool_py3.py | 8 +- .../v2018_07_01/models/inbound_nat_rule.py | 6 + .../models/inbound_nat_rule_py3.py | 8 +- .../v2018_07_01/models/load_balancing_rule.py | 6 + .../models/load_balancing_rule_py3.py | 8 +- .../v2018_07_01/models/public_ip_prefix.py | 4 - .../models/public_ip_prefix_py3.py | 6 +- .../models/service_endpoint_policy.py | 68 +++ .../service_endpoint_policy_definition.py | 55 ++ ...ervice_endpoint_policy_definition_paged.py | 27 + .../service_endpoint_policy_definition_py3.py | 55 ++ .../models/service_endpoint_policy_paged.py | 27 + .../models/service_endpoint_policy_py3.py | 68 +++ .../mgmt/network/v2018_07_01/models/subnet.py | 5 + .../network/v2018_07_01/models/subnet_py3.py | 7 +- .../v2018_07_01/network_management_client.py | 10 + .../v2018_07_01/operations/__init__.py | 4 + .../service_endpoint_policies_operations.py | 527 ++++++++++++++++++ ..._endpoint_policy_definitions_operations.py | 379 +++++++++++++ .../operations/usages_operations.py | 2 +- 23 files changed, 1308 insertions(+), 14 deletions(-) create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition_paged.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition_py3.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_paged.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_py3.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/service_endpoint_policies_operations.py create mode 100644 azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/service_endpoint_policy_definitions_operations.py 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 5460c913190b..0b3cfb2f9b42 100644 --- a/azure-mgmt-network/azure/mgmt/network/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/network_management_client.py @@ -1777,6 +1777,32 @@ def security_rules(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 service_endpoint_policies(self): + """Instance depends on the API version: + + * 2018-07-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 + 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 service_endpoint_policy_definitions(self): + """Instance depends on the API version: + + * 2018-07-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 + 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 subnets(self): """Instance depends on the API version: diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/__init__.py index 8d3de9baf722..1bfe6fa7e378 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/__init__.py @@ -30,6 +30,8 @@ from .route_py3 import Route from .route_table_py3 import RouteTable from .service_endpoint_properties_format_py3 import ServiceEndpointPropertiesFormat + from .service_endpoint_policy_definition_py3 import ServiceEndpointPolicyDefinition + from .service_endpoint_policy_py3 import ServiceEndpointPolicy from .public_ip_address_sku_py3 import PublicIPAddressSku from .public_ip_address_dns_settings_py3 import PublicIPAddressDnsSettings from .ip_tag_py3 import IpTag @@ -248,6 +250,8 @@ from .route import Route from .route_table import RouteTable from .service_endpoint_properties_format import ServiceEndpointPropertiesFormat + from .service_endpoint_policy_definition import ServiceEndpointPolicyDefinition + from .service_endpoint_policy import ServiceEndpointPolicy from .public_ip_address_sku import PublicIPAddressSku from .public_ip_address_dns_settings import PublicIPAddressDnsSettings from .ip_tag import IpTag @@ -493,6 +497,8 @@ from .hub_virtual_network_connection_paged import HubVirtualNetworkConnectionPaged from .vpn_gateway_paged import VpnGatewayPaged from .vpn_connection_paged import VpnConnectionPaged +from .service_endpoint_policy_paged import ServiceEndpointPolicyPaged +from .service_endpoint_policy_definition_paged import ServiceEndpointPolicyDefinitionPaged from .network_management_client_enums import ( ProvisioningState, AzureFirewallRCActionType, @@ -596,6 +602,8 @@ 'Route', 'RouteTable', 'ServiceEndpointPropertiesFormat', + 'ServiceEndpointPolicyDefinition', + 'ServiceEndpointPolicy', 'PublicIPAddressSku', 'PublicIPAddressDnsSettings', 'IpTag', @@ -841,6 +849,8 @@ 'HubVirtualNetworkConnectionPaged', 'VpnGatewayPaged', 'VpnConnectionPaged', + 'ServiceEndpointPolicyPaged', + 'ServiceEndpointPolicyDefinitionPaged', 'ProvisioningState', 'AzureFirewallRCActionType', 'AzureFirewallApplicationRuleProtocolType', diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_pool.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_pool.py index efe99b19ab61..29126fd82b40 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_pool.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_pool.py @@ -48,6 +48,10 @@ class InboundNatPool(SubResource): Groups in SQL server. This setting can't be changed after you create the endpoint. :type enable_floating_ip: bool + :param enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle + timeout or unexpected connection termination. This element is only used + when the protocol is set to TCP. + :type enable_tcp_reset: bool :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. :type provisioning_state: str @@ -75,6 +79,7 @@ class InboundNatPool(SubResource): 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, @@ -89,6 +94,7 @@ def __init__(self, **kwargs): 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.enable_tcp_reset = kwargs.get('enable_tcp_reset', None) self.provisioning_state = kwargs.get('provisioning_state', None) self.name = kwargs.get('name', None) self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_pool_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_pool_py3.py index 656d716cd962..b98f94acdd05 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_pool_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_pool_py3.py @@ -48,6 +48,10 @@ class InboundNatPool(SubResource): Groups in SQL server. This setting can't be changed after you create the endpoint. :type enable_floating_ip: bool + :param enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle + timeout or unexpected connection termination. This element is only used + when the protocol is set to TCP. + :type enable_tcp_reset: bool :param provisioning_state: Gets the provisioning state of the PublicIP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. :type provisioning_state: str @@ -75,12 +79,13 @@ class InboundNatPool(SubResource): 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_range_end: int, backend_port: int, id: str=None, frontend_ip_configuration=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, enable_tcp_reset: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: super(InboundNatPool, self).__init__(id=id, **kwargs) self.frontend_ip_configuration = frontend_ip_configuration self.protocol = protocol @@ -89,6 +94,7 @@ def __init__(self, *, protocol, frontend_port_range_start: int, frontend_port_ra self.backend_port = backend_port self.idle_timeout_in_minutes = idle_timeout_in_minutes self.enable_floating_ip = enable_floating_ip + self.enable_tcp_reset = enable_tcp_reset self.provisioning_state = provisioning_state self.name = name self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule.py index d7ee670423ee..7155bee14c14 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule.py @@ -48,6 +48,10 @@ class InboundNatRule(SubResource): Groups in SQL server. This setting can't be changed after you create the endpoint. :type enable_floating_ip: bool + :param enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle + timeout or unexpected connection termination. This element is only used + when the protocol is set to TCP. + :type enable_tcp_reset: bool :param provisioning_state: Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. :type provisioning_state: str @@ -72,6 +76,7 @@ class InboundNatRule(SubResource): 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, @@ -86,6 +91,7 @@ def __init__(self, **kwargs): 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.enable_tcp_reset = kwargs.get('enable_tcp_reset', None) self.provisioning_state = kwargs.get('provisioning_state', None) self.name = kwargs.get('name', None) self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule_py3.py index 4586a64aa218..08f6eadbc804 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/inbound_nat_rule_py3.py @@ -48,6 +48,10 @@ class InboundNatRule(SubResource): Groups in SQL server. This setting can't be changed after you create the endpoint. :type enable_floating_ip: bool + :param enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle + timeout or unexpected connection termination. This element is only used + when the protocol is set to TCP. + :type enable_tcp_reset: bool :param provisioning_state: Gets the provisioning state of the public IP resource. Possible values are: 'Updating', 'Deleting', and 'Failed'. :type provisioning_state: str @@ -72,12 +76,13 @@ class InboundNatRule(SubResource): 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=None, frontend_port: int=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, enable_tcp_reset: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: super(InboundNatRule, self).__init__(id=id, **kwargs) self.frontend_ip_configuration = frontend_ip_configuration self.backend_ip_configuration = None @@ -86,6 +91,7 @@ def __init__(self, *, id: str=None, frontend_ip_configuration=None, protocol=Non self.backend_port = backend_port self.idle_timeout_in_minutes = idle_timeout_in_minutes self.enable_floating_ip = enable_floating_ip + self.enable_tcp_reset = enable_tcp_reset self.provisioning_state = provisioning_state self.name = name self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/load_balancing_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/load_balancing_rule.py index 26a162af7f36..59389f2b298d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/load_balancing_rule.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/load_balancing_rule.py @@ -55,6 +55,10 @@ class LoadBalancingRule(SubResource): Groups in SQL server. This setting can't be changed after you create the endpoint. :type enable_floating_ip: bool + :param enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle + timeout or unexpected connection termination. This element is only used + when the protocol is set to TCP. + :type enable_tcp_reset: 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. @@ -86,6 +90,7 @@ class LoadBalancingRule(SubResource): 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, @@ -103,6 +108,7 @@ def __init__(self, **kwargs): 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.enable_tcp_reset = kwargs.get('enable_tcp_reset', None) self.disable_outbound_snat = kwargs.get('disable_outbound_snat', None) self.provisioning_state = kwargs.get('provisioning_state', None) self.name = kwargs.get('name', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/load_balancing_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/load_balancing_rule_py3.py index e7118a864798..9538cea25492 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/load_balancing_rule_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/load_balancing_rule_py3.py @@ -55,6 +55,10 @@ class LoadBalancingRule(SubResource): Groups in SQL server. This setting can't be changed after you create the endpoint. :type enable_floating_ip: bool + :param enable_tcp_reset: Receive bidirectional TCP Reset on TCP flow idle + timeout or unexpected connection termination. This element is only used + when the protocol is set to TCP. + :type enable_tcp_reset: 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. @@ -86,13 +90,14 @@ class LoadBalancingRule(SubResource): 'backend_port': {'key': 'properties.backendPort', 'type': 'int'}, 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'enable_floating_ip': {'key': 'properties.enableFloatingIP', 'type': 'bool'}, + 'enable_tcp_reset': {'key': 'properties.enableTcpReset', 'type': 'bool'}, 'disable_outbound_snat': {'key': 'properties.disableOutboundSnat', 'type': 'bool'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, disable_outbound_snat: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_configuration=None, backend_address_pool=None, probe=None, load_distribution=None, backend_port: int=None, idle_timeout_in_minutes: int=None, enable_floating_ip: bool=None, enable_tcp_reset: bool=None, disable_outbound_snat: bool=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: super(LoadBalancingRule, self).__init__(id=id, **kwargs) self.frontend_ip_configuration = frontend_ip_configuration self.backend_address_pool = backend_address_pool @@ -103,6 +108,7 @@ def __init__(self, *, protocol, frontend_port: int, id: str=None, frontend_ip_co self.backend_port = backend_port self.idle_timeout_in_minutes = idle_timeout_in_minutes self.enable_floating_ip = enable_floating_ip + self.enable_tcp_reset = enable_tcp_reset self.disable_outbound_snat = disable_outbound_snat self.provisioning_state = provisioning_state self.name = name diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix.py index 425836cfd749..b4c0e4585c1a 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix.py @@ -43,8 +43,6 @@ class PublicIPPrefix(Resource): :param public_ip_addresses: The list of all referenced PublicIPAddresses :type public_ip_addresses: list[~azure.mgmt.network.v2018_07_01.models.ReferencedPublicIpAddress] - :param idle_timeout_in_minutes: The idle timeout of the public IP prefix. - :type idle_timeout_in_minutes: int :param resource_guid: The resource GUID property of the public IP prefix resource. :type resource_guid: str @@ -76,7 +74,6 @@ class PublicIPPrefix(Resource): 'prefix_length': {'key': 'properties.prefixLength', 'type': 'int'}, 'ip_prefix': {'key': 'properties.ipPrefix', 'type': 'str'}, 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[ReferencedPublicIpAddress]'}, - 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, @@ -91,7 +88,6 @@ def __init__(self, **kwargs): self.prefix_length = kwargs.get('prefix_length', None) self.ip_prefix = kwargs.get('ip_prefix', None) self.public_ip_addresses = kwargs.get('public_ip_addresses', 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) self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_py3.py index 29d86abb92c9..37acb9a065e8 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/public_ip_prefix_py3.py @@ -43,8 +43,6 @@ class PublicIPPrefix(Resource): :param public_ip_addresses: The list of all referenced PublicIPAddresses :type public_ip_addresses: list[~azure.mgmt.network.v2018_07_01.models.ReferencedPublicIpAddress] - :param idle_timeout_in_minutes: The idle timeout of the public IP prefix. - :type idle_timeout_in_minutes: int :param resource_guid: The resource GUID property of the public IP prefix resource. :type resource_guid: str @@ -76,14 +74,13 @@ class PublicIPPrefix(Resource): 'prefix_length': {'key': 'properties.prefixLength', 'type': 'int'}, 'ip_prefix': {'key': 'properties.ipPrefix', 'type': 'str'}, 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[ReferencedPublicIpAddress]'}, - 'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'}, 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_address_version=None, ip_tags=None, prefix_length: int=None, ip_prefix: str=None, public_ip_addresses=None, idle_timeout_in_minutes: int=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: + def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, public_ip_address_version=None, ip_tags=None, prefix_length: int=None, ip_prefix: str=None, public_ip_addresses=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, zones=None, **kwargs) -> None: super(PublicIPPrefix, self).__init__(id=id, location=location, tags=tags, **kwargs) self.sku = sku self.public_ip_address_version = public_ip_address_version @@ -91,7 +88,6 @@ def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, pub self.prefix_length = prefix_length self.ip_prefix = ip_prefix self.public_ip_addresses = public_ip_addresses - self.idle_timeout_in_minutes = idle_timeout_in_minutes self.resource_guid = resource_guid self.provisioning_state = provisioning_state self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy.py new file mode 100644 index 000000000000..eccec5aee1de --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy.py @@ -0,0 +1,68 @@ +# 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 ServiceEndpointPolicy(Resource): + """Service End point policy 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 service_endpoint_policy_definitions: A collection of service + endpoint policy definitions of the service endpoint policy. + :type service_endpoint_policy_definitions: + list[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition] + :param resource_guid: The resource GUID property of the service endpoint + policy resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the service endpoint + policy. 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}, + } + + _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_endpoint_policy_definitions': {'key': 'properties.serviceEndpointPolicyDefinitions', 'type': '[ServiceEndpointPolicyDefinition]'}, + 'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceEndpointPolicy, self).__init__(**kwargs) + self.service_endpoint_policy_definitions = kwargs.get('service_endpoint_policy_definitions', 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/v2018_07_01/models/service_endpoint_policy_definition.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition.py new file mode 100644 index 000000000000..2e8c421e8a11 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition.py @@ -0,0 +1,55 @@ +# 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 .sub_resource import SubResource + + +class ServiceEndpointPolicyDefinition(SubResource): + """Service Endpoint policy definitions. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param service: service endpoint name. + :type service: str + :param service_resources: A list of service resources. + :type service_resources: list[str] + :param provisioning_state: The provisioning state of the service end point + policy definition. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: 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 + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'service': {'key': 'properties.service', 'type': 'str'}, + 'service_resources': {'key': 'properties.serviceResources', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceEndpointPolicyDefinition, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.service = kwargs.get('service', None) + self.service_resources = kwargs.get('service_resources', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition_paged.py new file mode 100644 index 000000000000..74376b4a1cc6 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition_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 ServiceEndpointPolicyDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServiceEndpointPolicyDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServiceEndpointPolicyDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(ServiceEndpointPolicyDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition_py3.py new file mode 100644 index 000000000000..973e02e6dcdd --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_definition_py3.py @@ -0,0 +1,55 @@ +# 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 .sub_resource_py3 import SubResource + + +class ServiceEndpointPolicyDefinition(SubResource): + """Service Endpoint policy definitions. + + :param id: Resource ID. + :type id: str + :param description: A description for this rule. Restricted to 140 chars. + :type description: str + :param service: service endpoint name. + :type service: str + :param service_resources: A list of service resources. + :type service_resources: list[str] + :param provisioning_state: The provisioning state of the service end point + policy definition. Possible values are: 'Updating', 'Deleting', and + 'Failed'. + :type provisioning_state: 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 + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'service': {'key': 'properties.service', 'type': 'str'}, + 'service_resources': {'key': 'properties.serviceResources', 'type': '[str]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, description: str=None, service: str=None, service_resources=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + super(ServiceEndpointPolicyDefinition, self).__init__(id=id, **kwargs) + self.description = description + self.service = service + self.service_resources = service_resources + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_paged.py new file mode 100644 index 000000000000..adbf3349cb59 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_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 ServiceEndpointPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServiceEndpointPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServiceEndpointPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ServiceEndpointPolicyPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_py3.py new file mode 100644 index 000000000000..1166dc0856a7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/service_endpoint_policy_py3.py @@ -0,0 +1,68 @@ +# 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 ServiceEndpointPolicy(Resource): + """Service End point policy 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 service_endpoint_policy_definitions: A collection of service + endpoint policy definitions of the service endpoint policy. + :type service_endpoint_policy_definitions: + list[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition] + :param resource_guid: The resource GUID property of the service endpoint + policy resource. + :type resource_guid: str + :param provisioning_state: The provisioning state of the service endpoint + policy. 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}, + } + + _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_endpoint_policy_definitions': {'key': 'properties.serviceEndpointPolicyDefinitions', 'type': '[ServiceEndpointPolicyDefinition]'}, + '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, service_endpoint_policy_definitions=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None: + super(ServiceEndpointPolicy, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.service_endpoint_policy_definitions = service_endpoint_policy_definitions + self.resource_guid = resource_guid + self.provisioning_state = provisioning_state + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/subnet.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/subnet.py index d2680f554972..4a175b67889b 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/subnet.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/subnet.py @@ -31,6 +31,9 @@ class Subnet(SubResource): :param service_endpoints: An array of service endpoints. :type service_endpoints: list[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPropertiesFormat] + :param service_endpoint_policies: An array of service endpoint policies. + :type service_endpoint_policies: + list[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy] :ivar ip_configurations: Gets an array of references to the network interface IP configurations using subnet. :vartype ip_configurations: @@ -59,6 +62,7 @@ class Subnet(SubResource): 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'service_endpoint_policies': {'key': 'properties.serviceEndpointPolicies', 'type': '[ServiceEndpointPolicy]'}, 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -72,6 +76,7 @@ def __init__(self, **kwargs): 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.service_endpoint_policies = kwargs.get('service_endpoint_policies', None) self.ip_configurations = None self.resource_navigation_links = kwargs.get('resource_navigation_links', None) self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/subnet_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/subnet_py3.py index 85a9b33b661c..8861808ee7e5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/subnet_py3.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/subnet_py3.py @@ -31,6 +31,9 @@ class Subnet(SubResource): :param service_endpoints: An array of service endpoints. :type service_endpoints: list[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPropertiesFormat] + :param service_endpoint_policies: An array of service endpoint policies. + :type service_endpoint_policies: + list[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy] :ivar ip_configurations: Gets an array of references to the network interface IP configurations using subnet. :vartype ip_configurations: @@ -59,6 +62,7 @@ class Subnet(SubResource): 'network_security_group': {'key': 'properties.networkSecurityGroup', 'type': 'NetworkSecurityGroup'}, 'route_table': {'key': 'properties.routeTable', 'type': 'RouteTable'}, 'service_endpoints': {'key': 'properties.serviceEndpoints', 'type': '[ServiceEndpointPropertiesFormat]'}, + 'service_endpoint_policies': {'key': 'properties.serviceEndpointPolicies', 'type': '[ServiceEndpointPolicy]'}, 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[IPConfiguration]'}, 'resource_navigation_links': {'key': 'properties.resourceNavigationLinks', 'type': '[ResourceNavigationLink]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -66,12 +70,13 @@ class Subnet(SubResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, service_endpoints=None, resource_navigation_links=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: + def __init__(self, *, id: str=None, address_prefix: str=None, network_security_group=None, route_table=None, service_endpoints=None, service_endpoint_policies=None, resource_navigation_links=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.network_security_group = network_security_group self.route_table = route_table self.service_endpoints = service_endpoints + self.service_endpoint_policies = service_endpoint_policies self.ip_configurations = None self.resource_navigation_links = resource_navigation_links self.provisioning_state = provisioning_state diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/network_management_client.py index 4b3d1d23c9da..389b4de2b145 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/network_management_client.py @@ -68,6 +68,8 @@ from .operations.hub_virtual_network_connections_operations import HubVirtualNetworkConnectionsOperations from .operations.vpn_gateways_operations import VpnGatewaysOperations from .operations.vpn_connections_operations import VpnConnectionsOperations +from .operations.service_endpoint_policies_operations import ServiceEndpointPoliciesOperations +from .operations.service_endpoint_policy_definitions_operations import ServiceEndpointPolicyDefinitionsOperations from . import models @@ -211,6 +213,10 @@ class NetworkManagementClient(SDKClient): :vartype vpn_gateways: azure.mgmt.network.v2018_07_01.operations.VpnGatewaysOperations :ivar vpn_connections: VpnConnections operations :vartype vpn_connections: azure.mgmt.network.v2018_07_01.operations.VpnConnectionsOperations + :ivar service_endpoint_policies: ServiceEndpointPolicies operations + :vartype service_endpoint_policies: azure.mgmt.network.v2018_07_01.operations.ServiceEndpointPoliciesOperations + :ivar service_endpoint_policy_definitions: ServiceEndpointPolicyDefinitions operations + :vartype service_endpoint_policy_definitions: azure.mgmt.network.v2018_07_01.operations.ServiceEndpointPolicyDefinitionsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -332,6 +338,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.vpn_connections = VpnConnectionsOperations( self._client, self.config, self._serialize, self._deserialize) + self.service_endpoint_policies = ServiceEndpointPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.service_endpoint_policy_definitions = ServiceEndpointPolicyDefinitionsOperations( + self._client, self.config, self._serialize, self._deserialize) def check_dns_name_availability( self, location, domain_name_label, custom_headers=None, raw=False, **operation_config): diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/__init__.py index 13391369898c..8f68aa77b5f6 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/__init__.py @@ -59,6 +59,8 @@ from .hub_virtual_network_connections_operations import HubVirtualNetworkConnectionsOperations from .vpn_gateways_operations import VpnGatewaysOperations from .vpn_connections_operations import VpnConnectionsOperations +from .service_endpoint_policies_operations import ServiceEndpointPoliciesOperations +from .service_endpoint_policy_definitions_operations import ServiceEndpointPolicyDefinitionsOperations __all__ = [ 'AzureFirewallsOperations', @@ -111,4 +113,6 @@ 'HubVirtualNetworkConnectionsOperations', 'VpnGatewaysOperations', 'VpnConnectionsOperations', + 'ServiceEndpointPoliciesOperations', + 'ServiceEndpointPolicyDefinitionsOperations', ] diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/service_endpoint_policies_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/service_endpoint_policies_operations.py new file mode 100644 index 000000000000..d6645e2fc07a --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/service_endpoint_policies_operations.py @@ -0,0 +1,527 @@ +# 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 ServiceEndpointPoliciesOperations(object): + """ServiceEndpointPoliciesOperations 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: "2018-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, service_endpoint_policy_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'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._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, service_endpoint_policy_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified service endpoint policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint + policy. + :type service_endpoint_policy_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, + service_endpoint_policy_name=service_endpoint_policy_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/serviceEndpointPolicies/{serviceEndpointPolicyName}'} + + def get( + self, resource_group_name, service_endpoint_policy_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets the specified service Endpoint Policies in a specified resource + group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint + policy. + :type service_endpoint_policy_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: ServiceEndpointPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy + 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'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._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('ServiceEndpointPolicy', 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/serviceEndpointPolicies/{serviceEndpointPolicyName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_endpoint_policy_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'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._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, 'ServiceEndpointPolicy') + + # 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]: + 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('ServiceEndpointPolicy', response) + if response.status_code == 201: + deserialized = self._deserialize('ServiceEndpointPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_endpoint_policy_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a service Endpoint Policies. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint + policy. + :type service_endpoint_policy_name: str + :param parameters: Parameters supplied to the create or update service + endpoint policy operation. + :type parameters: + ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy + :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 ServiceEndpointPolicy + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServiceEndpointPolicy', 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/serviceEndpointPolicies/{serviceEndpointPolicyName}'} + + + def _update_initial( + self, resource_group_name, service_endpoint_policy_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.TagsObject(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._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('ServiceEndpointPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_endpoint_policy_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates service Endpoint Policies. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint + policy. + :type service_endpoint_policy_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: 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 ServiceEndpointPolicy + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServiceEndpointPolicy', 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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the service endpoint policies 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 ServiceEndpointPolicy + :rtype: + ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyPaged[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy] + :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 = { + 'subscriptionId': self._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.ServiceEndpointPolicyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServiceEndpointPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/ServiceEndpointPolicies'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets all service endpoint Policies 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 ServiceEndpointPolicy + :rtype: + ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyPaged[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.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.ServiceEndpointPolicyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServiceEndpointPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/service_endpoint_policy_definitions_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/service_endpoint_policy_definitions_operations.py new file mode 100644 index 000000000000..81331f1d724d --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/service_endpoint_policy_definitions_operations.py @@ -0,0 +1,379 @@ +# 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 ServiceEndpointPolicyDefinitionsOperations(object): + """ServiceEndpointPolicyDefinitionsOperations 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: "2018-07-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, service_endpoint_policy_name, service_endpoint_policy_definition_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'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._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, service_endpoint_policy_name, service_endpoint_policy_definition_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified ServiceEndpoint policy definitions. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the Service Endpoint + Policy. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the + service endpoint policy definition. + :type service_endpoint_policy_definition_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, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_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/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinition/{serviceEndpointPolicyDefinitionName}'} + + def get( + self, resource_group_name, service_endpoint_policy_name, service_endpoint_policy_definition_name, custom_headers=None, raw=False, **operation_config): + """Get the specified service endpoint policy definitions from service + endpoint policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint + policy name. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the + service endpoint policy definition name. + :type service_endpoint_policy_definition_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: ServiceEndpointPolicyDefinition or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition + 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'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._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' + 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('ServiceEndpointPolicyDefinition', 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/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinition/{serviceEndpointPolicyDefinitionName}'} + + + def _create_or_update_initial( + self, resource_group_name, service_endpoint_policy_name, service_endpoint_policy_definition_name, service_endpoint_policy_definitions, 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'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'serviceEndpointPolicyDefinitionName': self._serialize.url("service_endpoint_policy_definition_name", service_endpoint_policy_definition_name, 'str'), + 'subscriptionId': self._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(service_endpoint_policy_definitions, 'ServiceEndpointPolicyDefinition') + + # 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]: + 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('ServiceEndpointPolicyDefinition', response) + if response.status_code == 201: + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_endpoint_policy_name, service_endpoint_policy_definition_name, service_endpoint_policy_definitions, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a service endpoint policy definition in the + specified service endpoint policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint + policy. + :type service_endpoint_policy_name: str + :param service_endpoint_policy_definition_name: The name of the + service endpoint policy definition name. + :type service_endpoint_policy_definition_name: str + :param service_endpoint_policy_definitions: Parameters supplied to the + create or update service endpoint policy operation. + :type service_endpoint_policy_definitions: + ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition + :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 + ServiceEndpointPolicyDefinition or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_endpoint_policy_name=service_endpoint_policy_name, + service_endpoint_policy_definition_name=service_endpoint_policy_definition_name, + service_endpoint_policy_definitions=service_endpoint_policy_definitions, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServiceEndpointPolicyDefinition', 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/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinition/{serviceEndpointPolicyDefinitionName}'} + + def list_by_resource_group( + self, resource_group_name, service_endpoint_policy_name, custom_headers=None, raw=False, **operation_config): + """Gets all service endpoint policy definitions in a service end point + policy. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_endpoint_policy_name: The name of the service endpoint + policy name. + :type service_endpoint_policy_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 ServiceEndpointPolicyDefinition + :rtype: + ~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinitionPaged[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicyDefinition] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceEndpointPolicyName': self._serialize.url("service_endpoint_policy_name", service_endpoint_policy_name, 'str'), + 'subscriptionId': self._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.ServiceEndpointPolicyDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ServiceEndpointPolicyDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/serviceEndpointPolicies/{serviceEndpointPolicyName}/serviceEndpointPolicyDefinitions'} diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/usages_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/usages_operations.py index 564472d7724d..516527bf7b76 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/usages_operations.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_07_01/operations/usages_operations.py @@ -59,7 +59,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list.metadata['url'] path_format_arguments = { - 'location': self._serialize.url("location", location, 'str', pattern=r'^[-\w\._]+$'), + '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)