From 338df2a74b14f377270823cb3767c455cb391f81 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 26 Aug 2019 18:10:33 -0700 Subject: [PATCH] Generated from 65b2f8a37695f3d9cf53c50a05a61c4179857199 (#6922) updated readme with correct version. --- .../azure/mgmt/peering/models/__init__.py | 43 +- .../azure/mgmt/peering/models/bgp_session.py | 6 +- .../mgmt/peering/models/bgp_session_py3.py | 6 +- ...eck_service_provider_availability_input.py | 32 ++ ...service_provider_availability_input_py3.py | 32 ++ .../mgmt/peering/models/direct_connection.py | 17 + .../peering/models/direct_connection_py3.py | 19 +- .../peering/models/direct_peering_facility.py | 6 + .../models/direct_peering_facility_py3.py | 8 +- .../peering/models/exchange_connection.py | 5 + .../peering/models/exchange_connection_py3.py | 7 +- .../models/peering_management_client_enums.py | 35 ++ .../models/peering_properties_direct.py | 6 + .../models/peering_properties_direct_py3.py | 8 +- .../mgmt/peering/models/peering_service.py | 69 +++ .../models/peering_service_location.py | 54 +++ .../models/peering_service_location_paged.py | 27 ++ .../models/peering_service_location_py3.py | 54 +++ .../peering/models/peering_service_paged.py | 27 ++ .../peering/models/peering_service_prefix.py | 65 +++ .../models/peering_service_prefix_paged.py | 27 ++ .../models/peering_service_prefix_py3.py | 65 +++ .../models/peering_service_provider.py | 46 ++ .../models/peering_service_provider_paged.py | 27 ++ .../models/peering_service_provider_py3.py | 46 ++ .../peering/models/peering_service_py3.py | 69 +++ .../azure/mgmt/peering/models/peering_sku.py | 3 +- .../mgmt/peering/models/peering_sku_py3.py | 3 +- .../azure/mgmt/peering/operations/__init__.py | 10 + .../operations/legacy_peerings_operations.py | 4 +- .../mgmt/peering/operations/operations.py | 4 +- .../operations/peer_asns_operations.py | 4 +- .../peering_locations_operations.py | 11 +- .../peering_service_locations_operations.py | 101 +++++ .../peering_service_prefixes_operations.py | 229 ++++++++++ .../peering_service_providers_operations.py | 101 +++++ .../operations/peering_services_operations.py | 424 ++++++++++++++++++ .../peering/operations/peerings_operations.py | 4 +- .../peering/operations/prefixes_operations.py | 106 +++++ .../mgmt/peering/peering_management_client.py | 98 +++- 40 files changed, 1879 insertions(+), 29 deletions(-) create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/check_service_provider_availability_input.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/check_service_provider_availability_input_py3.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location_paged.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location_py3.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_paged.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix_paged.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix_py3.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider_paged.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider_py3.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_py3.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_locations_operations.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_prefixes_operations.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_providers_operations.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_services_operations.py create mode 100644 sdk/azure-mgmt-peering/azure/mgmt/peering/operations/prefixes_operations.py diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/__init__.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/__init__.py index 43a83cfc21a1..6318316324fe 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/__init__.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/__init__.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- try: + from .check_service_provider_availability_input_py3 import CheckServiceProviderAvailabilityInput from .peering_sku_py3 import PeeringSku from .bgp_session_py3 import BgpSession from .direct_connection_py3 import DirectConnection @@ -18,8 +19,6 @@ from .exchange_connection_py3 import ExchangeConnection from .peering_properties_exchange_py3 import PeeringPropertiesExchange from .peering_py3 import Peering - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .resource_py3 import Resource from .operation_display_info_py3 import OperationDisplayInfo from .operation_py3 import Operation from .contact_info_py3 import ContactInfo @@ -31,7 +30,14 @@ from .peering_location_properties_exchange_py3 import PeeringLocationPropertiesExchange from .peering_location_py3 import PeeringLocation from .resource_tags_py3 import ResourceTags + from .peering_service_location_py3 import PeeringServiceLocation + from .peering_service_prefix_py3 import PeeringServicePrefix + from .peering_service_provider_py3 import PeeringServiceProvider + from .peering_service_py3 import PeeringService + from .error_response_py3 import ErrorResponse, ErrorResponseException + from .resource_py3 import Resource except (SyntaxError, ImportError): + from .check_service_provider_availability_input import CheckServiceProviderAvailabilityInput from .peering_sku import PeeringSku from .bgp_session import BgpSession from .direct_connection import DirectConnection @@ -40,8 +46,6 @@ from .exchange_connection import ExchangeConnection from .peering_properties_exchange import PeeringPropertiesExchange from .peering import Peering - from .error_response import ErrorResponse, ErrorResponseException - from .resource import Resource from .operation_display_info import OperationDisplayInfo from .operation import Operation from .contact_info import ContactInfo @@ -53,24 +57,39 @@ from .peering_location_properties_exchange import PeeringLocationPropertiesExchange from .peering_location import PeeringLocation from .resource_tags import ResourceTags + from .peering_service_location import PeeringServiceLocation + from .peering_service_prefix import PeeringServicePrefix + from .peering_service_provider import PeeringServiceProvider + from .peering_service import PeeringService + from .error_response import ErrorResponse, ErrorResponseException + from .resource import Resource from .peering_paged import PeeringPaged from .operation_paged import OperationPaged from .peer_asn_paged import PeerAsnPaged from .peering_location_paged import PeeringLocationPaged +from .peering_service_location_paged import PeeringServiceLocationPaged +from .peering_service_prefix_paged import PeeringServicePrefixPaged +from .peering_service_provider_paged import PeeringServiceProviderPaged +from .peering_service_paged import PeeringServicePaged from .peering_management_client_enums import ( Name, Tier, Family, Size, Kind, + SessionAddressProvider, ConnectionState, SessionStateV4, SessionStateV6, + DirectPeeringType, ProvisioningState, ValidationState, + PrefixValidationState, + LearnedType, ) __all__ = [ + 'CheckServiceProviderAvailabilityInput', 'PeeringSku', 'BgpSession', 'DirectConnection', @@ -79,8 +98,6 @@ 'ExchangeConnection', 'PeeringPropertiesExchange', 'Peering', - 'ErrorResponse', 'ErrorResponseException', - 'Resource', 'OperationDisplayInfo', 'Operation', 'ContactInfo', @@ -92,18 +109,32 @@ 'PeeringLocationPropertiesExchange', 'PeeringLocation', 'ResourceTags', + 'PeeringServiceLocation', + 'PeeringServicePrefix', + 'PeeringServiceProvider', + 'PeeringService', + 'ErrorResponse', 'ErrorResponseException', + 'Resource', 'PeeringPaged', 'OperationPaged', 'PeerAsnPaged', 'PeeringLocationPaged', + 'PeeringServiceLocationPaged', + 'PeeringServicePrefixPaged', + 'PeeringServiceProviderPaged', + 'PeeringServicePaged', 'Name', 'Tier', 'Family', 'Size', 'Kind', + 'SessionAddressProvider', 'ConnectionState', 'SessionStateV4', 'SessionStateV6', + 'DirectPeeringType', 'ProvisioningState', 'ValidationState', + 'PrefixValidationState', + 'LearnedType', ] diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/bgp_session.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/bgp_session.py index 5c3c4671d427..14eb61f18625 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/bgp_session.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/bgp_session.py @@ -36,12 +36,14 @@ class BgpSession(Model): :type peer_session_ipv6_address: str :ivar session_state_v4: The state of the IPv4 session. Possible values include: 'None', 'Idle', 'Connect', 'Active', 'OpenSent', 'OpenConfirm', - 'Established', 'PendingAdd', 'PendingUpdate', 'PendingRemove' + 'OpenReceived', 'Established', 'PendingAdd', 'PendingUpdate', + 'PendingRemove' :vartype session_state_v4: str or ~azure.mgmt.peering.models.SessionStateV4 :ivar session_state_v6: The state of the IPv6 session. Possible values include: 'None', 'Idle', 'Connect', 'Active', 'OpenSent', 'OpenConfirm', - 'Established', 'PendingAdd', 'PendingUpdate', 'PendingRemove' + 'OpenReceived', 'Established', 'PendingAdd', 'PendingUpdate', + 'PendingRemove' :vartype session_state_v6: str or ~azure.mgmt.peering.models.SessionStateV6 :param max_prefixes_advertised_v4: The maximum number of prefixes diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/bgp_session_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/bgp_session_py3.py index 874aba5f98ec..e4d9c3fb4775 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/bgp_session_py3.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/bgp_session_py3.py @@ -36,12 +36,14 @@ class BgpSession(Model): :type peer_session_ipv6_address: str :ivar session_state_v4: The state of the IPv4 session. Possible values include: 'None', 'Idle', 'Connect', 'Active', 'OpenSent', 'OpenConfirm', - 'Established', 'PendingAdd', 'PendingUpdate', 'PendingRemove' + 'OpenReceived', 'Established', 'PendingAdd', 'PendingUpdate', + 'PendingRemove' :vartype session_state_v4: str or ~azure.mgmt.peering.models.SessionStateV4 :ivar session_state_v6: The state of the IPv6 session. Possible values include: 'None', 'Idle', 'Connect', 'Active', 'OpenSent', 'OpenConfirm', - 'Established', 'PendingAdd', 'PendingUpdate', 'PendingRemove' + 'OpenReceived', 'Established', 'PendingAdd', 'PendingUpdate', + 'PendingRemove' :vartype session_state_v6: str or ~azure.mgmt.peering.models.SessionStateV6 :param max_prefixes_advertised_v4: The maximum number of prefixes diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/check_service_provider_availability_input.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/check_service_provider_availability_input.py new file mode 100644 index 000000000000..e3b28ea08163 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/check_service_provider_availability_input.py @@ -0,0 +1,32 @@ +# 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 CheckServiceProviderAvailabilityInput(Model): + """Class for CheckServiceProviderAvailabilityInput. + + :param peering_service_location: Gets or sets the PeeringServiceLocation + :type peering_service_location: str + :param peering_service_provider: Gets or sets the PeeringServiceProvider + :type peering_service_provider: str + """ + + _attribute_map = { + 'peering_service_location': {'key': 'peeringServiceLocation', 'type': 'str'}, + 'peering_service_provider': {'key': 'peeringServiceProvider', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckServiceProviderAvailabilityInput, self).__init__(**kwargs) + self.peering_service_location = kwargs.get('peering_service_location', None) + self.peering_service_provider = kwargs.get('peering_service_provider', None) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/check_service_provider_availability_input_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/check_service_provider_availability_input_py3.py new file mode 100644 index 000000000000..776495bbf1b2 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/check_service_provider_availability_input_py3.py @@ -0,0 +1,32 @@ +# 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 CheckServiceProviderAvailabilityInput(Model): + """Class for CheckServiceProviderAvailabilityInput. + + :param peering_service_location: Gets or sets the PeeringServiceLocation + :type peering_service_location: str + :param peering_service_provider: Gets or sets the PeeringServiceProvider + :type peering_service_provider: str + """ + + _attribute_map = { + 'peering_service_location': {'key': 'peeringServiceLocation', 'type': 'str'}, + 'peering_service_provider': {'key': 'peeringServiceProvider', 'type': 'str'}, + } + + def __init__(self, *, peering_service_location: str=None, peering_service_provider: str=None, **kwargs) -> None: + super(CheckServiceProviderAvailabilityInput, self).__init__(**kwargs) + self.peering_service_location = peering_service_location + self.peering_service_provider = peering_service_provider diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_connection.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_connection.py index 2754c099e424..590b7c5e4cd7 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_connection.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_connection.py @@ -23,6 +23,14 @@ class DirectConnection(Model): :param provisioned_bandwidth_in_mbps: The bandwidth that is actually provisioned. :type provisioned_bandwidth_in_mbps: int + :param session_address_provider: The field indicating if Microsoft + provides session ip addresses. Possible values include: 'Microsoft', + 'Peer' + :type session_address_provider: str or + ~azure.mgmt.peering.models.SessionAddressProvider + :param use_for_peering_service: The flag that indicates whether or not the + connection is used for peering service. + :type use_for_peering_service: bool :param peering_db_facility_id: The PeeringDB.com ID of the facility at which the connection has to be set up. :type peering_db_facility_id: int @@ -33,6 +41,9 @@ class DirectConnection(Model): ~azure.mgmt.peering.models.ConnectionState :param bgp_session: The BGP session associated with the connection. :type bgp_session: ~azure.mgmt.peering.models.BgpSession + :param connection_identifier: The unique identifier (GUID) for the + connection. + :type connection_identifier: str """ _validation = { @@ -42,15 +53,21 @@ class DirectConnection(Model): _attribute_map = { 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, 'provisioned_bandwidth_in_mbps': {'key': 'provisionedBandwidthInMbps', 'type': 'int'}, + 'session_address_provider': {'key': 'sessionAddressProvider', 'type': 'str'}, + 'use_for_peering_service': {'key': 'useForPeeringService', 'type': 'bool'}, 'peering_db_facility_id': {'key': 'peeringDBFacilityId', 'type': 'int'}, 'connection_state': {'key': 'connectionState', 'type': 'str'}, 'bgp_session': {'key': 'bgpSession', 'type': 'BgpSession'}, + 'connection_identifier': {'key': 'connectionIdentifier', 'type': 'str'}, } def __init__(self, **kwargs): super(DirectConnection, self).__init__(**kwargs) self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) self.provisioned_bandwidth_in_mbps = kwargs.get('provisioned_bandwidth_in_mbps', None) + self.session_address_provider = kwargs.get('session_address_provider', None) + self.use_for_peering_service = kwargs.get('use_for_peering_service', None) self.peering_db_facility_id = kwargs.get('peering_db_facility_id', None) self.connection_state = None self.bgp_session = kwargs.get('bgp_session', None) + self.connection_identifier = kwargs.get('connection_identifier', None) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_connection_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_connection_py3.py index 3d2eaea44c16..90c2c666ed82 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_connection_py3.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_connection_py3.py @@ -23,6 +23,14 @@ class DirectConnection(Model): :param provisioned_bandwidth_in_mbps: The bandwidth that is actually provisioned. :type provisioned_bandwidth_in_mbps: int + :param session_address_provider: The field indicating if Microsoft + provides session ip addresses. Possible values include: 'Microsoft', + 'Peer' + :type session_address_provider: str or + ~azure.mgmt.peering.models.SessionAddressProvider + :param use_for_peering_service: The flag that indicates whether or not the + connection is used for peering service. + :type use_for_peering_service: bool :param peering_db_facility_id: The PeeringDB.com ID of the facility at which the connection has to be set up. :type peering_db_facility_id: int @@ -33,6 +41,9 @@ class DirectConnection(Model): ~azure.mgmt.peering.models.ConnectionState :param bgp_session: The BGP session associated with the connection. :type bgp_session: ~azure.mgmt.peering.models.BgpSession + :param connection_identifier: The unique identifier (GUID) for the + connection. + :type connection_identifier: str """ _validation = { @@ -42,15 +53,21 @@ class DirectConnection(Model): _attribute_map = { 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, 'provisioned_bandwidth_in_mbps': {'key': 'provisionedBandwidthInMbps', 'type': 'int'}, + 'session_address_provider': {'key': 'sessionAddressProvider', 'type': 'str'}, + 'use_for_peering_service': {'key': 'useForPeeringService', 'type': 'bool'}, 'peering_db_facility_id': {'key': 'peeringDBFacilityId', 'type': 'int'}, 'connection_state': {'key': 'connectionState', 'type': 'str'}, 'bgp_session': {'key': 'bgpSession', 'type': 'BgpSession'}, + 'connection_identifier': {'key': 'connectionIdentifier', 'type': 'str'}, } - def __init__(self, *, bandwidth_in_mbps: int=None, provisioned_bandwidth_in_mbps: int=None, peering_db_facility_id: int=None, bgp_session=None, **kwargs) -> None: + def __init__(self, *, bandwidth_in_mbps: int=None, provisioned_bandwidth_in_mbps: int=None, session_address_provider=None, use_for_peering_service: bool=None, peering_db_facility_id: int=None, bgp_session=None, connection_identifier: str=None, **kwargs) -> None: super(DirectConnection, self).__init__(**kwargs) self.bandwidth_in_mbps = bandwidth_in_mbps self.provisioned_bandwidth_in_mbps = provisioned_bandwidth_in_mbps + self.session_address_provider = session_address_provider + self.use_for_peering_service = use_for_peering_service self.peering_db_facility_id = peering_db_facility_id self.connection_state = None self.bgp_session = bgp_session + self.connection_identifier = connection_identifier diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_peering_facility.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_peering_facility.py index 6d3ebb2848c9..4c20d70c76a4 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_peering_facility.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_peering_facility.py @@ -17,6 +17,10 @@ class DirectPeeringFacility(Model): :param address: The address of the direct peering facility. :type address: str + :param direct_peering_type: The type of the direct peering. Possible + values include: 'Edge', 'Transit', 'Cdn', 'Internal' + :type direct_peering_type: str or + ~azure.mgmt.peering.models.DirectPeeringType :param peering_db_facility_id: The PeeringDB.com ID of the facility. :type peering_db_facility_id: int :param peering_db_facility_link: The PeeringDB.com URL of the facility. @@ -25,6 +29,7 @@ class DirectPeeringFacility(Model): _attribute_map = { 'address': {'key': 'address', 'type': 'str'}, + 'direct_peering_type': {'key': 'directPeeringType', 'type': 'str'}, 'peering_db_facility_id': {'key': 'peeringDBFacilityId', 'type': 'int'}, 'peering_db_facility_link': {'key': 'peeringDBFacilityLink', 'type': 'str'}, } @@ -32,5 +37,6 @@ class DirectPeeringFacility(Model): def __init__(self, **kwargs): super(DirectPeeringFacility, self).__init__(**kwargs) self.address = kwargs.get('address', None) + self.direct_peering_type = kwargs.get('direct_peering_type', None) self.peering_db_facility_id = kwargs.get('peering_db_facility_id', None) self.peering_db_facility_link = kwargs.get('peering_db_facility_link', None) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_peering_facility_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_peering_facility_py3.py index f98cd984657a..3927ca32afbd 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_peering_facility_py3.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/direct_peering_facility_py3.py @@ -17,6 +17,10 @@ class DirectPeeringFacility(Model): :param address: The address of the direct peering facility. :type address: str + :param direct_peering_type: The type of the direct peering. Possible + values include: 'Edge', 'Transit', 'Cdn', 'Internal' + :type direct_peering_type: str or + ~azure.mgmt.peering.models.DirectPeeringType :param peering_db_facility_id: The PeeringDB.com ID of the facility. :type peering_db_facility_id: int :param peering_db_facility_link: The PeeringDB.com URL of the facility. @@ -25,12 +29,14 @@ class DirectPeeringFacility(Model): _attribute_map = { 'address': {'key': 'address', 'type': 'str'}, + 'direct_peering_type': {'key': 'directPeeringType', 'type': 'str'}, 'peering_db_facility_id': {'key': 'peeringDBFacilityId', 'type': 'int'}, 'peering_db_facility_link': {'key': 'peeringDBFacilityLink', 'type': 'str'}, } - def __init__(self, *, address: str=None, peering_db_facility_id: int=None, peering_db_facility_link: str=None, **kwargs) -> None: + def __init__(self, *, address: str=None, direct_peering_type=None, peering_db_facility_id: int=None, peering_db_facility_link: str=None, **kwargs) -> None: super(DirectPeeringFacility, self).__init__(**kwargs) self.address = address + self.direct_peering_type = direct_peering_type self.peering_db_facility_id = peering_db_facility_id self.peering_db_facility_link = peering_db_facility_link diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/exchange_connection.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/exchange_connection.py index 1e9819bf4482..833ee4aa9755 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/exchange_connection.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/exchange_connection.py @@ -28,6 +28,9 @@ class ExchangeConnection(Model): ~azure.mgmt.peering.models.ConnectionState :param bgp_session: The BGP session associated with the connection. :type bgp_session: ~azure.mgmt.peering.models.BgpSession + :param connection_identifier: The unique identifier (GUID) for the + connection. + :type connection_identifier: str """ _validation = { @@ -38,6 +41,7 @@ class ExchangeConnection(Model): 'peering_db_facility_id': {'key': 'peeringDBFacilityId', 'type': 'int'}, 'connection_state': {'key': 'connectionState', 'type': 'str'}, 'bgp_session': {'key': 'bgpSession', 'type': 'BgpSession'}, + 'connection_identifier': {'key': 'connectionIdentifier', 'type': 'str'}, } def __init__(self, **kwargs): @@ -45,3 +49,4 @@ def __init__(self, **kwargs): self.peering_db_facility_id = kwargs.get('peering_db_facility_id', None) self.connection_state = None self.bgp_session = kwargs.get('bgp_session', None) + self.connection_identifier = kwargs.get('connection_identifier', None) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/exchange_connection_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/exchange_connection_py3.py index bb0fcfda4e70..b5031a2b5a69 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/exchange_connection_py3.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/exchange_connection_py3.py @@ -28,6 +28,9 @@ class ExchangeConnection(Model): ~azure.mgmt.peering.models.ConnectionState :param bgp_session: The BGP session associated with the connection. :type bgp_session: ~azure.mgmt.peering.models.BgpSession + :param connection_identifier: The unique identifier (GUID) for the + connection. + :type connection_identifier: str """ _validation = { @@ -38,10 +41,12 @@ class ExchangeConnection(Model): 'peering_db_facility_id': {'key': 'peeringDBFacilityId', 'type': 'int'}, 'connection_state': {'key': 'connectionState', 'type': 'str'}, 'bgp_session': {'key': 'bgpSession', 'type': 'BgpSession'}, + 'connection_identifier': {'key': 'connectionIdentifier', 'type': 'str'}, } - def __init__(self, *, peering_db_facility_id: int=None, bgp_session=None, **kwargs) -> None: + def __init__(self, *, peering_db_facility_id: int=None, bgp_session=None, connection_identifier: str=None, **kwargs) -> None: super(ExchangeConnection, self).__init__(**kwargs) self.peering_db_facility_id = peering_db_facility_id self.connection_state = None self.bgp_session = bgp_session + self.connection_identifier = connection_identifier diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_management_client_enums.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_management_client_enums.py index b8c9157498a3..37c0a42f2acb 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_management_client_enums.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_management_client_enums.py @@ -18,6 +18,8 @@ class Name(str, Enum): basic_direct_free = "Basic_Direct_Free" premium_direct_free = "Premium_Direct_Free" premium_exchange_metered = "Premium_Exchange_Metered" + premium_direct_metered = "Premium_Direct_Metered" + premium_direct_unlimited = "Premium_Direct_Unlimited" class Tier(str, Enum): @@ -45,6 +47,12 @@ class Kind(str, Enum): exchange = "Exchange" +class SessionAddressProvider(str, Enum): + + microsoft = "Microsoft" + peer = "Peer" + + class ConnectionState(str, Enum): none = "None" @@ -65,6 +73,7 @@ class SessionStateV4(str, Enum): active = "Active" open_sent = "OpenSent" open_confirm = "OpenConfirm" + open_received = "OpenReceived" established = "Established" pending_add = "PendingAdd" pending_update = "PendingUpdate" @@ -79,12 +88,21 @@ class SessionStateV6(str, Enum): active = "Active" open_sent = "OpenSent" open_confirm = "OpenConfirm" + open_received = "OpenReceived" established = "Established" pending_add = "PendingAdd" pending_update = "PendingUpdate" pending_remove = "PendingRemove" +class DirectPeeringType(str, Enum): + + edge = "Edge" + transit = "Transit" + cdn = "Cdn" + internal = "Internal" + + class ProvisioningState(str, Enum): succeeded = "Succeeded" @@ -99,3 +117,20 @@ class ValidationState(str, Enum): pending = "Pending" approved = "Approved" failed = "Failed" + + +class PrefixValidationState(str, Enum): + + none = "None" + invalid = "Invalid" + verified = "Verified" + failed = "Failed" + pending = "Pending" + unknown = "Unknown" + + +class LearnedType(str, Enum): + + none = "None" + via_partner = "ViaPartner" + via_session = "ViaSession" diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_properties_direct.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_properties_direct.py index 977278902330..34d2fb36b126 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_properties_direct.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_properties_direct.py @@ -23,12 +23,17 @@ class PeeringPropertiesDirect(Model): :type use_for_peering_service: bool :param peer_asn: The reference of the peer ASN. :type peer_asn: ~azure.mgmt.peering.models.SubResource + :param direct_peering_type: The type of direct peering. Possible values + include: 'Edge', 'Transit', 'Cdn', 'Internal' + :type direct_peering_type: str or + ~azure.mgmt.peering.models.DirectPeeringType """ _attribute_map = { 'connections': {'key': 'connections', 'type': '[DirectConnection]'}, 'use_for_peering_service': {'key': 'useForPeeringService', 'type': 'bool'}, 'peer_asn': {'key': 'peerAsn', 'type': 'SubResource'}, + 'direct_peering_type': {'key': 'directPeeringType', 'type': 'str'}, } def __init__(self, **kwargs): @@ -36,3 +41,4 @@ def __init__(self, **kwargs): self.connections = kwargs.get('connections', None) self.use_for_peering_service = kwargs.get('use_for_peering_service', None) self.peer_asn = kwargs.get('peer_asn', None) + self.direct_peering_type = kwargs.get('direct_peering_type', None) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_properties_direct_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_properties_direct_py3.py index ad286b055ee6..a2942ae8cfb9 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_properties_direct_py3.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_properties_direct_py3.py @@ -23,16 +23,22 @@ class PeeringPropertiesDirect(Model): :type use_for_peering_service: bool :param peer_asn: The reference of the peer ASN. :type peer_asn: ~azure.mgmt.peering.models.SubResource + :param direct_peering_type: The type of direct peering. Possible values + include: 'Edge', 'Transit', 'Cdn', 'Internal' + :type direct_peering_type: str or + ~azure.mgmt.peering.models.DirectPeeringType """ _attribute_map = { 'connections': {'key': 'connections', 'type': '[DirectConnection]'}, 'use_for_peering_service': {'key': 'useForPeeringService', 'type': 'bool'}, 'peer_asn': {'key': 'peerAsn', 'type': 'SubResource'}, + 'direct_peering_type': {'key': 'directPeeringType', 'type': 'str'}, } - def __init__(self, *, connections=None, use_for_peering_service: bool=None, peer_asn=None, **kwargs) -> None: + def __init__(self, *, connections=None, use_for_peering_service: bool=None, peer_asn=None, direct_peering_type=None, **kwargs) -> None: super(PeeringPropertiesDirect, self).__init__(**kwargs) self.connections = connections self.use_for_peering_service = use_for_peering_service self.peer_asn = peer_asn + self.direct_peering_type = direct_peering_type diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service.py new file mode 100644 index 000000000000..013d7541cfe0 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service.py @@ -0,0 +1,69 @@ +# 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 PeeringService(Resource): + """Peering Service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the resource. + :vartype name: str + :ivar id: The ID of the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :param peering_service_location: The PeeringServiceLocation of the + Customer. + :type peering_service_location: str + :param peering_service_provider: The MAPS Provider Name. + :type peering_service_provider: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.peering.models.ProvisioningState + :param location: Required. The location of the resource. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'peering_service_location': {'key': 'properties.peeringServiceLocation', 'type': 'str'}, + 'peering_service_provider': {'key': 'properties.peeringServiceProvider', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(PeeringService, self).__init__(**kwargs) + self.peering_service_location = kwargs.get('peering_service_location', None) + self.peering_service_provider = kwargs.get('peering_service_provider', None) + self.provisioning_state = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location.py new file mode 100644 index 000000000000..9d0d30091782 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location.py @@ -0,0 +1,54 @@ +# 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 PeeringServiceLocation(Resource): + """PeeringService location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the resource. + :vartype name: str + :ivar id: The ID of the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :param country: Country of the customer + :type country: str + :param state: State of the customer + :type state: str + :param azure_region: Azure region for the location + :type azure_region: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_region': {'key': 'properties.azureRegion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeeringServiceLocation, self).__init__(**kwargs) + self.country = kwargs.get('country', None) + self.state = kwargs.get('state', None) + self.azure_region = kwargs.get('azure_region', None) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location_paged.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location_paged.py new file mode 100644 index 000000000000..ff017342f554 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location_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 PeeringServiceLocationPaged(Paged): + """ + A paging container for iterating over a list of :class:`PeeringServiceLocation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PeeringServiceLocation]'} + } + + def __init__(self, *args, **kwargs): + + super(PeeringServiceLocationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location_py3.py new file mode 100644 index 000000000000..3872672034b5 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_location_py3.py @@ -0,0 +1,54 @@ +# 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 PeeringServiceLocation(Resource): + """PeeringService location. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the resource. + :vartype name: str + :ivar id: The ID of the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :param country: Country of the customer + :type country: str + :param state: State of the customer + :type state: str + :param azure_region: Azure region for the location + :type azure_region: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'azure_region': {'key': 'properties.azureRegion', 'type': 'str'}, + } + + def __init__(self, *, country: str=None, state: str=None, azure_region: str=None, **kwargs) -> None: + super(PeeringServiceLocation, self).__init__(**kwargs) + self.country = country + self.state = state + self.azure_region = azure_region diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_paged.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_paged.py new file mode 100644 index 000000000000..2c75e19cfac2 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_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 PeeringServicePaged(Paged): + """ + A paging container for iterating over a list of :class:`PeeringService ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PeeringService]'} + } + + def __init__(self, *args, **kwargs): + + super(PeeringServicePaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix.py new file mode 100644 index 000000000000..58d59e3ed485 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix.py @@ -0,0 +1,65 @@ +# 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 PeeringServicePrefix(Resource): + """The peering service prefix class. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the resource. + :vartype name: str + :ivar id: The ID of the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :param prefix: Valid route prefix + :type prefix: str + :param prefix_validation_state: The prefix validation state. Possible + values include: 'None', 'Invalid', 'Verified', 'Failed', 'Pending', + 'Unknown' + :type prefix_validation_state: str or + ~azure.mgmt.peering.models.PrefixValidationState + :param learned_type: The prefix learned type. Possible values include: + 'None', 'ViaPartner', 'ViaSession' + :type learned_type: str or ~azure.mgmt.peering.models.LearnedType + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.peering.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'prefix_validation_state': {'key': 'properties.prefixValidationState', 'type': 'str'}, + 'learned_type': {'key': 'properties.learnedType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeeringServicePrefix, self).__init__(**kwargs) + self.prefix = kwargs.get('prefix', None) + self.prefix_validation_state = kwargs.get('prefix_validation_state', None) + self.learned_type = kwargs.get('learned_type', None) + self.provisioning_state = None diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix_paged.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix_paged.py new file mode 100644 index 000000000000..e42f755d5780 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_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 PeeringServicePrefixPaged(Paged): + """ + A paging container for iterating over a list of :class:`PeeringServicePrefix ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PeeringServicePrefix]'} + } + + def __init__(self, *args, **kwargs): + + super(PeeringServicePrefixPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix_py3.py new file mode 100644 index 000000000000..0f5be4dfaad5 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_prefix_py3.py @@ -0,0 +1,65 @@ +# 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 PeeringServicePrefix(Resource): + """The peering service prefix class. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the resource. + :vartype name: str + :ivar id: The ID of the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :param prefix: Valid route prefix + :type prefix: str + :param prefix_validation_state: The prefix validation state. Possible + values include: 'None', 'Invalid', 'Verified', 'Failed', 'Pending', + 'Unknown' + :type prefix_validation_state: str or + ~azure.mgmt.peering.models.PrefixValidationState + :param learned_type: The prefix learned type. Possible values include: + 'None', 'ViaPartner', 'ViaSession' + :type learned_type: str or ~azure.mgmt.peering.models.LearnedType + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.peering.models.ProvisioningState + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'prefix': {'key': 'properties.prefix', 'type': 'str'}, + 'prefix_validation_state': {'key': 'properties.prefixValidationState', 'type': 'str'}, + 'learned_type': {'key': 'properties.learnedType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, prefix: str=None, prefix_validation_state=None, learned_type=None, **kwargs) -> None: + super(PeeringServicePrefix, self).__init__(**kwargs) + self.prefix = prefix + self.prefix_validation_state = prefix_validation_state + self.learned_type = learned_type + self.provisioning_state = None diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider.py new file mode 100644 index 000000000000..d6ec715760bf --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider.py @@ -0,0 +1,46 @@ +# 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 PeeringServiceProvider(Resource): + """PeeringService provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the resource. + :vartype name: str + :ivar id: The ID of the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :param service_provider_name: The name of the service provider. + :type service_provider_name: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_provider_name': {'key': 'properties.serviceProviderName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeeringServiceProvider, self).__init__(**kwargs) + self.service_provider_name = kwargs.get('service_provider_name', None) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider_paged.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider_paged.py new file mode 100644 index 000000000000..57ed71e1083d --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider_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 PeeringServiceProviderPaged(Paged): + """ + A paging container for iterating over a list of :class:`PeeringServiceProvider ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PeeringServiceProvider]'} + } + + def __init__(self, *args, **kwargs): + + super(PeeringServiceProviderPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider_py3.py new file mode 100644 index 000000000000..cfee15a3b211 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_provider_py3.py @@ -0,0 +1,46 @@ +# 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 PeeringServiceProvider(Resource): + """PeeringService provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the resource. + :vartype name: str + :ivar id: The ID of the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :param service_provider_name: The name of the service provider. + :type service_provider_name: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_provider_name': {'key': 'properties.serviceProviderName', 'type': 'str'}, + } + + def __init__(self, *, service_provider_name: str=None, **kwargs) -> None: + super(PeeringServiceProvider, self).__init__(**kwargs) + self.service_provider_name = service_provider_name diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_py3.py new file mode 100644 index 000000000000..92e69b39f9ef --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_service_py3.py @@ -0,0 +1,69 @@ +# 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 PeeringService(Resource): + """Peering Service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the resource. + :vartype name: str + :ivar id: The ID of the resource. + :vartype id: str + :ivar type: The type of the resource. + :vartype type: str + :param peering_service_location: The PeeringServiceLocation of the + Customer. + :type peering_service_location: str + :param peering_service_provider: The MAPS Provider Name. + :type peering_service_provider: str + :ivar provisioning_state: The provisioning state of the resource. Possible + values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.peering.models.ProvisioningState + :param location: Required. The location of the resource. + :type location: str + :param tags: The resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'peering_service_location': {'key': 'properties.peeringServiceLocation', 'type': 'str'}, + 'peering_service_provider': {'key': 'properties.peeringServiceProvider', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, peering_service_location: str=None, peering_service_provider: str=None, tags=None, **kwargs) -> None: + super(PeeringService, self).__init__(**kwargs) + self.peering_service_location = peering_service_location + self.peering_service_provider = peering_service_provider + self.provisioning_state = None + self.location = location + self.tags = tags diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_sku.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_sku.py index 3c215ab6117d..7a03325fa821 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_sku.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_sku.py @@ -17,7 +17,8 @@ class PeeringSku(Model): :param name: The name of the peering SKU. Possible values include: 'Basic_Exchange_Free', 'Basic_Direct_Free', 'Premium_Direct_Free', - 'Premium_Exchange_Metered' + 'Premium_Exchange_Metered', 'Premium_Direct_Metered', + 'Premium_Direct_Unlimited' :type name: str or ~azure.mgmt.peering.models.Name :param tier: The tier of the peering SKU. Possible values include: 'Basic', 'Premium' diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_sku_py3.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_sku_py3.py index 0e30c97e02de..82b9ecc29b7c 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_sku_py3.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/models/peering_sku_py3.py @@ -17,7 +17,8 @@ class PeeringSku(Model): :param name: The name of the peering SKU. Possible values include: 'Basic_Exchange_Free', 'Basic_Direct_Free', 'Premium_Direct_Free', - 'Premium_Exchange_Metered' + 'Premium_Exchange_Metered', 'Premium_Direct_Metered', + 'Premium_Direct_Unlimited' :type name: str or ~azure.mgmt.peering.models.Name :param tier: The tier of the peering SKU. Possible values include: 'Basic', 'Premium' diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/__init__.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/__init__.py index 5b10beba012e..2386c3789b9e 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/__init__.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/__init__.py @@ -14,6 +14,11 @@ from .peer_asns_operations import PeerAsnsOperations from .peering_locations_operations import PeeringLocationsOperations from .peerings_operations import PeeringsOperations +from .peering_service_locations_operations import PeeringServiceLocationsOperations +from .peering_service_prefixes_operations import PeeringServicePrefixesOperations +from .prefixes_operations import PrefixesOperations +from .peering_service_providers_operations import PeeringServiceProvidersOperations +from .peering_services_operations import PeeringServicesOperations __all__ = [ 'LegacyPeeringsOperations', @@ -21,4 +26,9 @@ 'PeerAsnsOperations', 'PeeringLocationsOperations', 'PeeringsOperations', + 'PeeringServiceLocationsOperations', + 'PeeringServicePrefixesOperations', + 'PrefixesOperations', + 'PeeringServiceProvidersOperations', + 'PeeringServicesOperations', ] diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/legacy_peerings_operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/legacy_peerings_operations.py index 99acbe9dbedc..08ed91f82f82 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/legacy_peerings_operations.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/legacy_peerings_operations.py @@ -22,7 +22,7 @@ class LegacyPeeringsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-03-01-preview". + :ivar api_version: The client API version. Constant value: "2019-08-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-08-01-preview" self.config = config diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/operations.py index f948154e16bb..c5b6c429c3db 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/operations.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-03-01-preview". + :ivar api_version: The client API version. Constant value: "2019-08-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-08-01-preview" self.config = config diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peer_asns_operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peer_asns_operations.py index 2f4e8636a20c..33acae5e98a2 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peer_asns_operations.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peer_asns_operations.py @@ -22,7 +22,7 @@ class PeerAsnsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-03-01-preview". + :ivar api_version: The client API version. Constant value: "2019-08-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-08-01-preview" self.config = config diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_locations_operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_locations_operations.py index 3cd413320aef..d38196a4c3d6 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_locations_operations.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_locations_operations.py @@ -22,7 +22,7 @@ class PeeringLocationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-03-01-preview". + :ivar api_version: The client API version. Constant value: "2019-08-01-preview". """ models = models @@ -32,18 +32,21 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-08-01-preview" self.config = config def list( - self, kind, custom_headers=None, raw=False, **operation_config): + self, kind, direct_peering_type=None, custom_headers=None, raw=False, **operation_config): """Lists all of the available peering locations for the specified kind of peering. :param kind: The kind of the peering. Possible values include: 'Direct', 'Exchange' :type kind: str + :param direct_peering_type: The type of direct peering. Possible + values include: 'Edge', 'Transit', 'Cdn', 'Internal' + :type direct_peering_type: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -68,6 +71,8 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} query_parameters['kind'] = self._serialize.query("kind", kind, 'str') + if direct_peering_type is not None: + query_parameters['directPeeringType'] = self._serialize.query("direct_peering_type", direct_peering_type, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_locations_operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_locations_operations.py new file mode 100644 index 000000000000..8f8c4790e1d1 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_locations_operations.py @@ -0,0 +1,101 @@ +# 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 .. import models + + +class PeeringServiceLocationsOperations(object): + """PeeringServiceLocationsOperations 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: The client API version. Constant value: "2019-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available peering service locations for the specified + kind of peering. + + :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 PeeringServiceLocation + :rtype: + ~azure.mgmt.peering.models.PeeringServiceLocationPaged[~azure.mgmt.peering.models.PeeringServiceLocation] + :raises: + :class:`ErrorResponseException` + """ + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PeeringServiceLocationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PeeringServiceLocationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceLocations'} diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_prefixes_operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_prefixes_operations.py new file mode 100644 index 000000000000..746fb299cacc --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_prefixes_operations.py @@ -0,0 +1,229 @@ +# 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 .. import models + + +class PeeringServicePrefixesOperations(object): + """PeeringServicePrefixesOperations 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: The client API version. Constant value: "2019-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01-preview" + + self.config = config + + def get( + self, resource_group_name, peering_service_name, prefix_name, custom_headers=None, raw=False, **operation_config): + """Gets the peering service prefix. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param peering_service_name: The peering service name. + :type peering_service_name: str + :param prefix_name: The prefix name. + :type prefix_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: PeeringServicePrefix or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringServicePrefix or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'peeringServiceName': self._serialize.url("peering_service_name", peering_service_name, 'str'), + 'prefixName': self._serialize.url("prefix_name", 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' + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PeeringServicePrefix', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}'} + + def create_or_update( + self, resource_group_name, peering_service_name, prefix_name, peering_service_prefix, custom_headers=None, raw=False, **operation_config): + """Creates or updates the peering prefix. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param peering_service_name: The peering service name. + :type peering_service_name: str + :param prefix_name: The prefix name + :type prefix_name: str + :param peering_service_prefix: The IP prefix for an peering + :type peering_service_prefix: + ~azure.mgmt.peering.models.PeeringServicePrefix + :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: PeeringServicePrefix or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringServicePrefix or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'peeringServiceName': self._serialize.url("peering_service_name", peering_service_name, 'str'), + 'prefixName': self._serialize.url("prefix_name", 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(peering_service_prefix, 'PeeringServicePrefix') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PeeringServicePrefix', response) + if response.status_code == 201: + deserialized = self._deserialize('PeeringServicePrefix', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}'} + + def delete( + self, resource_group_name, peering_service_name, prefix_name, custom_headers=None, raw=False, **operation_config): + """removes the peering prefix. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param peering_service_name: The peering service name. + :type peering_service_name: str + :param prefix_name: The prefix name + :type prefix_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'peeringServiceName': self._serialize.url("peering_service_name", peering_service_name, 'str'), + 'prefixName': self._serialize.url("prefix_name", 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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}'} diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_providers_operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_providers_operations.py new file mode 100644 index 000000000000..ac93133b131a --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_service_providers_operations.py @@ -0,0 +1,101 @@ +# 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 .. import models + + +class PeeringServiceProvidersOperations(object): + """PeeringServiceProvidersOperations 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: The client API version. Constant value: "2019-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available peering service locations for the specified + kind of peering. + + :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 PeeringServiceProvider + :rtype: + ~azure.mgmt.peering.models.PeeringServiceProviderPaged[~azure.mgmt.peering.models.PeeringServiceProvider] + :raises: + :class:`ErrorResponseException` + """ + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PeeringServiceProviderPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PeeringServiceProviderPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceProviders'} diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_services_operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_services_operations.py new file mode 100644 index 000000000000..04f680ab6869 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peering_services_operations.py @@ -0,0 +1,424 @@ +# 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 .. import models + + +class PeeringServicesOperations(object): + """PeeringServicesOperations 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: The client API version. Constant value: "2019-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01-preview" + + self.config = config + + def get( + self, resource_group_name, peering_service_name, custom_headers=None, raw=False, **operation_config): + """Gets an existing peering service with the specified name under the + given subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param peering_service_name: The name of the peering. + :type peering_service_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: PeeringService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'peeringServiceName': self._serialize.url("peering_service_name", peering_service_name, 'str'), + 'subscriptionId': self._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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PeeringService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}'} + + def create_or_update( + self, resource_group_name, peering_service_name, peering_service, custom_headers=None, raw=False, **operation_config): + """Creates a new peering service or updates an existing peering with the + specified name under the given subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param peering_service_name: The name of the peering service. + :type peering_service_name: str + :param peering_service: The properties needed to create or update a + peering service. + :type peering_service: ~azure.mgmt.peering.models.PeeringService + :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: PeeringService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'peeringServiceName': self._serialize.url("peering_service_name", peering_service_name, 'str'), + 'subscriptionId': self._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(peering_service, 'PeeringService') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PeeringService', response) + if response.status_code == 201: + deserialized = self._deserialize('PeeringService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}'} + + def delete( + self, resource_group_name, peering_service_name, custom_headers=None, raw=False, **operation_config): + """Deletes an existing peering service with the specified name under the + given subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param peering_service_name: The name of the peering service. + :type peering_service_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'peeringServiceName': self._serialize.url("peering_service_name", peering_service_name, 'str'), + 'subscriptionId': self._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, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}'} + + def update( + self, resource_group_name, peering_service_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates tags for a peering service with the specified name under the + given subscription and resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param peering_service_name: The name of the peering service. + :type peering_service_name: str + :param tags: Gets or sets the tags, a dictionary of descriptors arm + object + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PeeringService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringService or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + tags1 = models.ResourceTags(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'peeringServiceName': self._serialize.url("peering_service_name", peering_service_name, 'str'), + 'subscriptionId': self._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(tags1, 'ResourceTags') + + # 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]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('PeeringService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the peering services under the given subscription and + 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 PeeringService + :rtype: + ~azure.mgmt.peering.models.PeeringServicePaged[~azure.mgmt.peering.models.PeeringService] + :raises: + :class:`ErrorResponseException` + """ + 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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PeeringServicePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PeeringServicePaged(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.Peering/peeringServices'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the peerings under the given 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 PeeringService + :rtype: + ~azure.mgmt.peering.models.PeeringServicePaged[~azure.mgmt.peering.models.PeeringService] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PeeringServicePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PeeringServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServices'} diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peerings_operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peerings_operations.py index 602eef0c3725..1a9ae560814f 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peerings_operations.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/peerings_operations.py @@ -22,7 +22,7 @@ class PeeringsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-03-01-preview". + :ivar api_version: The client API version. Constant value: "2019-08-01-preview". """ models = models @@ -32,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-03-01-preview" + self.api_version = "2019-08-01-preview" self.config = config diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/prefixes_operations.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/prefixes_operations.py new file mode 100644 index 000000000000..97d6f90a44c3 --- /dev/null +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/operations/prefixes_operations.py @@ -0,0 +1,106 @@ +# 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 .. import models + + +class PrefixesOperations(object): + """PrefixesOperations 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: The client API version. Constant value: "2019-08-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01-preview" + + self.config = config + + def list_by_peering_service( + self, resource_group_name, peering_service_name, custom_headers=None, raw=False, **operation_config): + """Lists the peerings prefix in the resource group. + + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param peering_service_name: The peering service name. + :type peering_service_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 PeeringServicePrefix + :rtype: + ~azure.mgmt.peering.models.PeeringServicePrefixPaged[~azure.mgmt.peering.models.PeeringServicePrefix] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_peering_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'peeringServiceName': self._serialize.url("peering_service_name", peering_service_name, 'str'), + 'subscriptionId': self._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]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.PeeringServicePrefixPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.PeeringServicePrefixPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_peering_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes'} diff --git a/sdk/azure-mgmt-peering/azure/mgmt/peering/peering_management_client.py b/sdk/azure-mgmt-peering/azure/mgmt/peering/peering_management_client.py index c6a9c8a4fcd9..fec933781789 100644 --- a/sdk/azure-mgmt-peering/azure/mgmt/peering/peering_management_client.py +++ b/sdk/azure-mgmt-peering/azure/mgmt/peering/peering_management_client.py @@ -13,11 +13,18 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION +from msrest.pipeline import ClientRawResponse +import uuid from .operations.legacy_peerings_operations import LegacyPeeringsOperations from .operations.operations import Operations from .operations.peer_asns_operations import PeerAsnsOperations from .operations.peering_locations_operations import PeeringLocationsOperations from .operations.peerings_operations import PeeringsOperations +from .operations.peering_service_locations_operations import PeeringServiceLocationsOperations +from .operations.peering_service_prefixes_operations import PeeringServicePrefixesOperations +from .operations.prefixes_operations import PrefixesOperations +from .operations.peering_service_providers_operations import PeeringServiceProvidersOperations +from .operations.peering_services_operations import PeeringServicesOperations from . import models @@ -54,7 +61,7 @@ def __init__( class PeeringManagementClient(SDKClient): - """APIs to manage Peering resources through the Azure Resource Manager. + """Peering Client :ivar config: Configuration for client. :vartype config: PeeringManagementClientConfiguration @@ -69,6 +76,16 @@ class PeeringManagementClient(SDKClient): :vartype peering_locations: azure.mgmt.peering.operations.PeeringLocationsOperations :ivar peerings: Peerings operations :vartype peerings: azure.mgmt.peering.operations.PeeringsOperations + :ivar peering_service_locations: PeeringServiceLocations operations + :vartype peering_service_locations: azure.mgmt.peering.operations.PeeringServiceLocationsOperations + :ivar peering_service_prefixes: PeeringServicePrefixes operations + :vartype peering_service_prefixes: azure.mgmt.peering.operations.PeeringServicePrefixesOperations + :ivar prefixes: Prefixes operations + :vartype prefixes: azure.mgmt.peering.operations.PrefixesOperations + :ivar peering_service_providers: PeeringServiceProviders operations + :vartype peering_service_providers: azure.mgmt.peering.operations.PeeringServiceProvidersOperations + :ivar peering_services: PeeringServices operations + :vartype peering_services: azure.mgmt.peering.operations.PeeringServicesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -85,7 +102,7 @@ def __init__( super(PeeringManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-03-01-preview' + self.api_version = '2019-08-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -99,3 +116,80 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.peerings = PeeringsOperations( self._client, self.config, self._serialize, self._deserialize) + self.peering_service_locations = PeeringServiceLocationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.peering_service_prefixes = PeeringServicePrefixesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.prefixes = PrefixesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.peering_service_providers = PeeringServiceProvidersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.peering_services = PeeringServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + + def check_service_provider_availability( + self, peering_service_location=None, peering_service_provider=None, custom_headers=None, raw=False, **operation_config): + """Checks if the peering service provider is present within 1000 miles of + customer's location. + + :param peering_service_location: Gets or sets the + PeeringServiceLocation + :type peering_service_location: str + :param peering_service_provider: Gets or sets the + PeeringServiceProvider + :type peering_service_provider: 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: enum or ClientRawResponse if raw=true + :rtype: str or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + check_service_provider_availability_input = models.CheckServiceProviderAvailabilityInput(peering_service_location=peering_service_location, peering_service_provider=peering_service_provider) + + # Construct URL + url = self.check_service_provider_availability.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') + + # 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(check_service_provider_availability_input, 'CheckServiceProviderAvailabilityInput') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('str', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_service_provider_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/CheckServiceProviderAvailability'}