diff --git a/sdk/peering/azure-mgmt-peering/HISTORY.rst b/sdk/peering/azure-mgmt-peering/HISTORY.rst new file mode 100644 index 000000000000..8a589f5f9a92 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/HISTORY.rst @@ -0,0 +1,9 @@ +.. :changelog: + +Release History +=============== + +0.1.0rc1 (2019-09-26) ++++++++++++++++++++++ + +* Initial Release diff --git a/sdk/peering/azure-mgmt-peering/MANIFEST.in b/sdk/peering/azure-mgmt-peering/MANIFEST.in new file mode 100644 index 000000000000..e4884efef41b --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/peering/azure-mgmt-peering/README.rst b/sdk/peering/azure-mgmt-peering/README.rst new file mode 100644 index 000000000000..095c50c56e0c --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/README.rst @@ -0,0 +1,33 @@ +Microsoft Azure SDK for Python +============================== + +This is the Microsoft Azure Peering Management Client Library. + +Azure Resource Manager (ARM) is the next generation of management APIs that +replace the old Azure Service Management (ASM). + +This package has been tested with Python 2.7, 3.5, 3.6 and 3.7. + +For the older Azure Service Management (ASM) libraries, see +`azure-servicemanagement-legacy `__ library. + +For a more complete set of Azure libraries, see the `azure `__ bundle package. + + +Usage +===== + +For code examples, see `Peering Management +`__ +on docs.microsoft.com. + + +Provide Feedback +================ + +If you encounter any bugs or have suggestions, please file an issue in the +`Issues `__ +section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-peering%2FREADME.png diff --git a/sdk/peering/azure-mgmt-peering/azure/__init__.py b/sdk/peering/azure-mgmt-peering/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/__init__.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/__init__.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/__init__.py new file mode 100644 index 000000000000..e948a8f334e5 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import PeeringManagementClientConfiguration +from ._peering_management_client import PeeringManagementClient +__all__ = ['PeeringManagementClient', 'PeeringManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/_configuration.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/_configuration.py new file mode 100644 index 000000000000..fd1ab0207cf4 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/_configuration.py @@ -0,0 +1,48 @@ +# 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 msrestazure import AzureConfiguration + +from .version import VERSION + + +class PeeringManagementClientConfiguration(AzureConfiguration): + """Configuration for PeeringManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(PeeringManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-peering/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/_peering_management_client.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/_peering_management_client.py new file mode 100644 index 000000000000..6509e2c4056a --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/_peering_management_client.py @@ -0,0 +1,95 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import PeeringManagementClientConfiguration +from .operations import PeeringManagementClientOperationsMixin +from .operations import LegacyPeeringsOperations +from .operations import Operations +from .operations import PeerAsnsOperations +from .operations import PeeringLocationsOperations +from .operations import PeeringsOperations +from .operations import PeeringServiceLocationsOperations +from .operations import PeeringServicePrefixesOperations +from .operations import PrefixesOperations +from .operations import PeeringServiceProvidersOperations +from .operations import PeeringServicesOperations +from . import models + + +class PeeringManagementClient(PeeringManagementClientOperationsMixin, SDKClient): + """Peering Client + + :ivar config: Configuration for client. + :vartype config: PeeringManagementClientConfiguration + + :ivar legacy_peerings: LegacyPeerings operations + :vartype legacy_peerings: azure.mgmt.peering.operations.LegacyPeeringsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.peering.operations.Operations + :ivar peer_asns: PeerAsns operations + :vartype peer_asns: azure.mgmt.peering.operations.PeerAsnsOperations + :ivar peering_locations: PeeringLocations operations + :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 + object` + :param subscription_id: The Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = PeeringManagementClientConfiguration(credentials, subscription_id, base_url) + 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-08-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.legacy_peerings = LegacyPeeringsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.peer_asns = PeerAsnsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.peering_locations = PeeringLocationsOperations( + 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) diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/__init__.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/__init__.py new file mode 100644 index 000000000000..76921f6bcfa8 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/__init__.py @@ -0,0 +1,140 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import BgpSession + from ._models_py3 import CheckServiceProviderAvailabilityInput + from ._models_py3 import ContactInfo + from ._models_py3 import DirectConnection + from ._models_py3 import DirectPeeringFacility + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ExchangeConnection + from ._models_py3 import ExchangePeeringFacility + from ._models_py3 import Operation + from ._models_py3 import OperationDisplayInfo + from ._models_py3 import PeerAsn + from ._models_py3 import Peering + from ._models_py3 import PeeringBandwidthOffer + from ._models_py3 import PeeringLocation + from ._models_py3 import PeeringLocationPropertiesDirect + from ._models_py3 import PeeringLocationPropertiesExchange + from ._models_py3 import PeeringPropertiesDirect + from ._models_py3 import PeeringPropertiesExchange + from ._models_py3 import PeeringService + from ._models_py3 import PeeringServiceLocation + from ._models_py3 import PeeringServicePrefix + from ._models_py3 import PeeringServiceProvider + from ._models_py3 import PeeringSku + from ._models_py3 import Resource + from ._models_py3 import ResourceTags + from ._models_py3 import SubResource +except (SyntaxError, ImportError): + from ._models import BgpSession + from ._models import CheckServiceProviderAvailabilityInput + from ._models import ContactInfo + from ._models import DirectConnection + from ._models import DirectPeeringFacility + from ._models import ErrorResponse, ErrorResponseException + from ._models import ExchangeConnection + from ._models import ExchangePeeringFacility + from ._models import Operation + from ._models import OperationDisplayInfo + from ._models import PeerAsn + from ._models import Peering + from ._models import PeeringBandwidthOffer + from ._models import PeeringLocation + from ._models import PeeringLocationPropertiesDirect + from ._models import PeeringLocationPropertiesExchange + from ._models import PeeringPropertiesDirect + from ._models import PeeringPropertiesExchange + from ._models import PeeringService + from ._models import PeeringServiceLocation + from ._models import PeeringServicePrefix + from ._models import PeeringServiceProvider + from ._models import PeeringSku + from ._models import Resource + from ._models import ResourceTags + from ._models import SubResource +from ._paged_models import OperationPaged +from ._paged_models import PeerAsnPaged +from ._paged_models import PeeringLocationPaged +from ._paged_models import PeeringPaged +from ._paged_models import PeeringServiceLocationPaged +from ._paged_models import PeeringServicePaged +from ._paged_models import PeeringServicePrefixPaged +from ._paged_models import PeeringServiceProviderPaged +from ._peering_management_client_enums import ( + Name, + Tier, + Family, + Size, + Kind, + SessionAddressProvider, + ConnectionState, + SessionStateV4, + SessionStateV6, + DirectPeeringType, + ProvisioningState, + ValidationState, + PrefixValidationState, + LearnedType, +) + +__all__ = [ + 'BgpSession', + 'CheckServiceProviderAvailabilityInput', + 'ContactInfo', + 'DirectConnection', + 'DirectPeeringFacility', + 'ErrorResponse', 'ErrorResponseException', + 'ExchangeConnection', + 'ExchangePeeringFacility', + 'Operation', + 'OperationDisplayInfo', + 'PeerAsn', + 'Peering', + 'PeeringBandwidthOffer', + 'PeeringLocation', + 'PeeringLocationPropertiesDirect', + 'PeeringLocationPropertiesExchange', + 'PeeringPropertiesDirect', + 'PeeringPropertiesExchange', + 'PeeringService', + 'PeeringServiceLocation', + 'PeeringServicePrefix', + 'PeeringServiceProvider', + 'PeeringSku', + 'Resource', + 'ResourceTags', + 'SubResource', + '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/peering/azure-mgmt-peering/azure/mgmt/peering/models/_models.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_models.py new file mode 100644 index 000000000000..60ac670ced22 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_models.py @@ -0,0 +1,1011 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class BgpSession(Model): + """The properties that define a BGP session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param session_prefix_v4: The IPv4 prefix that contains both ends' IPv4 + addresses. + :type session_prefix_v4: str + :param session_prefix_v6: The IPv6 prefix that contains both ends' IPv6 + addresses. + :type session_prefix_v6: str + :ivar microsoft_session_ipv4_address: The IPv4 session address on + Microsoft's end. + :vartype microsoft_session_ipv4_address: str + :ivar microsoft_session_ipv6_address: The IPv6 session address on + Microsoft's end. + :vartype microsoft_session_ipv6_address: str + :param peer_session_ipv4_address: The IPv4 session address on peer's end. + :type peer_session_ipv4_address: str + :param peer_session_ipv6_address: The IPv6 session address on peer's end. + :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', + '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', + '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 + advertised over the IPv4 session. + :type max_prefixes_advertised_v4: int + :param max_prefixes_advertised_v6: The maximum number of prefixes + advertised over the IPv6 session. + :type max_prefixes_advertised_v6: int + :param md5_authentication_key: The MD5 authentication key of the session. + :type md5_authentication_key: str + """ + + _validation = { + 'microsoft_session_ipv4_address': {'readonly': True}, + 'microsoft_session_ipv6_address': {'readonly': True}, + 'session_state_v4': {'readonly': True}, + 'session_state_v6': {'readonly': True}, + } + + _attribute_map = { + 'session_prefix_v4': {'key': 'sessionPrefixV4', 'type': 'str'}, + 'session_prefix_v6': {'key': 'sessionPrefixV6', 'type': 'str'}, + 'microsoft_session_ipv4_address': {'key': 'microsoftSessionIPv4Address', 'type': 'str'}, + 'microsoft_session_ipv6_address': {'key': 'microsoftSessionIPv6Address', 'type': 'str'}, + 'peer_session_ipv4_address': {'key': 'peerSessionIPv4Address', 'type': 'str'}, + 'peer_session_ipv6_address': {'key': 'peerSessionIPv6Address', 'type': 'str'}, + 'session_state_v4': {'key': 'sessionStateV4', 'type': 'str'}, + 'session_state_v6': {'key': 'sessionStateV6', 'type': 'str'}, + 'max_prefixes_advertised_v4': {'key': 'maxPrefixesAdvertisedV4', 'type': 'int'}, + 'max_prefixes_advertised_v6': {'key': 'maxPrefixesAdvertisedV6', 'type': 'int'}, + 'md5_authentication_key': {'key': 'md5AuthenticationKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BgpSession, self).__init__(**kwargs) + self.session_prefix_v4 = kwargs.get('session_prefix_v4', None) + self.session_prefix_v6 = kwargs.get('session_prefix_v6', None) + self.microsoft_session_ipv4_address = None + self.microsoft_session_ipv6_address = None + self.peer_session_ipv4_address = kwargs.get('peer_session_ipv4_address', None) + self.peer_session_ipv6_address = kwargs.get('peer_session_ipv6_address', None) + self.session_state_v4 = None + self.session_state_v6 = None + self.max_prefixes_advertised_v4 = kwargs.get('max_prefixes_advertised_v4', None) + self.max_prefixes_advertised_v6 = kwargs.get('max_prefixes_advertised_v6', None) + self.md5_authentication_key = kwargs.get('md5_authentication_key', None) + + +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) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ContactInfo(Model): + """The contact information of the peer. + + :param emails: The list of email addresses. + :type emails: list[str] + :param phone: The list of contact numbers. + :type phone: list[str] + """ + + _attribute_map = { + 'emails': {'key': 'emails', 'type': '[str]'}, + 'phone': {'key': 'phone', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ContactInfo, self).__init__(**kwargs) + self.emails = kwargs.get('emails', None) + self.phone = kwargs.get('phone', None) + + +class DirectConnection(Model): + """The properties that define a direct connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param bandwidth_in_mbps: The bandwidth of the connection. + :type bandwidth_in_mbps: int + :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 + :ivar connection_state: The state of the connection. Possible values + include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', + 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + :vartype connection_state: str or + ~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 = { + 'connection_state': {'readonly': True}, + } + + _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) + + +class DirectPeeringFacility(Model): + """The properties that define a direct peering facility. + + :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. + :type peering_db_facility_link: str + """ + + _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, **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) + + +class ErrorResponse(Model): + """The error response that indicates why an operation has failed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ExchangeConnection(Model): + """The properties that define an exchange connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + :ivar connection_state: The state of the connection. Possible values + include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', + 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + :vartype connection_state: str or + ~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 = { + 'connection_state': {'readonly': True}, + } + + _attribute_map = { + '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(ExchangeConnection, self).__init__(**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) + + +class ExchangePeeringFacility(Model): + """The properties that define an exchange peering facility. + + :param exchange_name: The name of the exchange peering facility. + :type exchange_name: str + :param bandwidth_in_mbps: The bandwidth of the connection between + Microsoft and the exchange peering facility. + :type bandwidth_in_mbps: int + :param microsoft_ipv4_address: The IPv4 address of Microsoft at the + exchange peering facility. + :type microsoft_ipv4_address: str + :param microsoft_ipv6_address: The IPv6 address of Microsoft at the + exchange peering facility. + :type microsoft_ipv6_address: str + :param facility_ipv4_prefix: The IPv4 prefixes associated with the + exchange peering facility. + :type facility_ipv4_prefix: str + :param facility_ipv6_prefix: The IPv6 prefixes associated with the + exchange peering facility. + :type facility_ipv6_prefix: str + :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. + :type peering_db_facility_link: str + """ + + _attribute_map = { + 'exchange_name': {'key': 'exchangeName', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + 'microsoft_ipv4_address': {'key': 'microsoftIPv4Address', 'type': 'str'}, + 'microsoft_ipv6_address': {'key': 'microsoftIPv6Address', 'type': 'str'}, + 'facility_ipv4_prefix': {'key': 'facilityIPv4Prefix', 'type': 'str'}, + 'facility_ipv6_prefix': {'key': 'facilityIPv6Prefix', 'type': 'str'}, + 'peering_db_facility_id': {'key': 'peeringDBFacilityId', 'type': 'int'}, + 'peering_db_facility_link': {'key': 'peeringDBFacilityLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ExchangePeeringFacility, self).__init__(**kwargs) + self.exchange_name = kwargs.get('exchange_name', None) + self.bandwidth_in_mbps = kwargs.get('bandwidth_in_mbps', None) + self.microsoft_ipv4_address = kwargs.get('microsoft_ipv4_address', None) + self.microsoft_ipv6_address = kwargs.get('microsoft_ipv6_address', None) + self.facility_ipv4_prefix = kwargs.get('facility_ipv4_prefix', None) + self.facility_ipv6_prefix = kwargs.get('facility_ipv6_prefix', 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) + + +class Operation(Model): + """The peering API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation. + :vartype name: str + :ivar display: The information related to the operation. + :vartype display: ~azure.mgmt.peering.models.OperationDisplayInfo + :ivar is_data_action: The flag that indicates whether the operation + applies to data plane. + :vartype is_data_action: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + 'is_data_action': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + self.is_data_action = None + + +class OperationDisplayInfo(Model): + """The information related to the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The name of the resource provider. + :vartype provider: str + :ivar resource: The type of the resource. + :vartype resource: str + :ivar operation: The name of the operation. + :vartype operation: str + :ivar description: The description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplayInfo, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class Resource(Model): + """The ARM resource 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 + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + + +class PeerAsn(Resource): + """The essential information related to the peer's ASN. + + 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 peer_asn: The Autonomous System Number (ASN) of the peer. + :type peer_asn: int + :param peer_contact_info: The contact information of the peer. + :type peer_contact_info: ~azure.mgmt.peering.models.ContactInfo + :param peer_name: The name of the peer. + :type peer_name: str + :param validation_state: The validation state of the ASN associated with + the peer. Possible values include: 'None', 'Pending', 'Approved', 'Failed' + :type validation_state: str or ~azure.mgmt.peering.models.ValidationState + """ + + _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'}, + 'peer_asn': {'key': 'properties.peerAsn', 'type': 'int'}, + 'peer_contact_info': {'key': 'properties.peerContactInfo', 'type': 'ContactInfo'}, + 'peer_name': {'key': 'properties.peerName', 'type': 'str'}, + 'validation_state': {'key': 'properties.validationState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeerAsn, self).__init__(**kwargs) + self.peer_asn = kwargs.get('peer_asn', None) + self.peer_contact_info = kwargs.get('peer_contact_info', None) + self.peer_name = kwargs.get('peer_name', None) + self.validation_state = kwargs.get('validation_state', None) + + +class Peering(Resource): + """Peering is a logical representation of a set of connections to the + Microsoft Cloud Edge at a location. + + 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 sku: Required. The SKU that defines the tier and kind of the + peering. + :type sku: ~azure.mgmt.peering.models.PeeringSku + :param kind: Required. The kind of the peering. Possible values include: + 'Direct', 'Exchange' + :type kind: str or ~azure.mgmt.peering.models.Kind + :param direct: The properties that define a direct peering. + :type direct: ~azure.mgmt.peering.models.PeeringPropertiesDirect + :param exchange: The properties that define an exchange peering. + :type exchange: ~azure.mgmt.peering.models.PeeringPropertiesExchange + :param peering_location: The location of the peering. + :type peering_location: 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}, + 'sku': {'required': True}, + 'kind': {'required': 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'}, + 'sku': {'key': 'sku', 'type': 'PeeringSku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'direct': {'key': 'properties.direct', 'type': 'PeeringPropertiesDirect'}, + 'exchange': {'key': 'properties.exchange', 'type': 'PeeringPropertiesExchange'}, + 'peering_location': {'key': 'properties.peeringLocation', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Peering, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.direct = kwargs.get('direct', None) + self.exchange = kwargs.get('exchange', None) + self.peering_location = kwargs.get('peering_location', None) + self.provisioning_state = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + +class PeeringBandwidthOffer(Model): + """The properties that define a peering bandwidth offer. + + :param offer_name: The name of the bandwidth offer. + :type offer_name: str + :param value_in_mbps: The value of the bandwidth offer in Mbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(PeeringBandwidthOffer, self).__init__(**kwargs) + self.offer_name = kwargs.get('offer_name', None) + self.value_in_mbps = kwargs.get('value_in_mbps', None) + + +class PeeringLocation(Resource): + """Peering location is where connectivity could be established to the + Microsoft Cloud Edge. + + 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 kind: The kind of peering that the peering location supports. + Possible values include: 'Direct', 'Exchange' + :type kind: str or ~azure.mgmt.peering.models.Kind + :param direct: The properties that define a direct peering location. + :type direct: ~azure.mgmt.peering.models.PeeringLocationPropertiesDirect + :param exchange: The properties that define an exchange peering location. + :type exchange: + ~azure.mgmt.peering.models.PeeringLocationPropertiesExchange + :param peering_location: The name of the peering location. + :type peering_location: str + :param country: The country in which the peering location exists. + :type country: str + :param azure_region: The Azure region associated with the peering + 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'direct': {'key': 'properties.direct', 'type': 'PeeringLocationPropertiesDirect'}, + 'exchange': {'key': 'properties.exchange', 'type': 'PeeringLocationPropertiesExchange'}, + 'peering_location': {'key': 'properties.peeringLocation', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'azure_region': {'key': 'properties.azureRegion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeeringLocation, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.direct = kwargs.get('direct', None) + self.exchange = kwargs.get('exchange', None) + self.peering_location = kwargs.get('peering_location', None) + self.country = kwargs.get('country', None) + self.azure_region = kwargs.get('azure_region', None) + + +class PeeringLocationPropertiesDirect(Model): + """The properties that define a direct peering location. + + :param peering_facilities: The list of direct peering facilities at the + peering location. + :type peering_facilities: + list[~azure.mgmt.peering.models.DirectPeeringFacility] + :param bandwidth_offers: The list of bandwidth offers available at the + peering location. + :type bandwidth_offers: + list[~azure.mgmt.peering.models.PeeringBandwidthOffer] + """ + + _attribute_map = { + 'peering_facilities': {'key': 'peeringFacilities', 'type': '[DirectPeeringFacility]'}, + 'bandwidth_offers': {'key': 'bandwidthOffers', 'type': '[PeeringBandwidthOffer]'}, + } + + def __init__(self, **kwargs): + super(PeeringLocationPropertiesDirect, self).__init__(**kwargs) + self.peering_facilities = kwargs.get('peering_facilities', None) + self.bandwidth_offers = kwargs.get('bandwidth_offers', None) + + +class PeeringLocationPropertiesExchange(Model): + """The properties that define an exchange peering location. + + :param peering_facilities: The list of exchange peering facilities at the + peering location. + :type peering_facilities: + list[~azure.mgmt.peering.models.ExchangePeeringFacility] + """ + + _attribute_map = { + 'peering_facilities': {'key': 'peeringFacilities', 'type': '[ExchangePeeringFacility]'}, + } + + def __init__(self, **kwargs): + super(PeeringLocationPropertiesExchange, self).__init__(**kwargs) + self.peering_facilities = kwargs.get('peering_facilities', None) + + +class PeeringPropertiesDirect(Model): + """The properties that define a direct peering. + + :param connections: The set of connections that constitute a direct + peering. + :type connections: list[~azure.mgmt.peering.models.DirectConnection] + :param use_for_peering_service: The flag that indicates whether or not the + peering is used for peering service. + :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): + super(PeeringPropertiesDirect, self).__init__(**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) + + +class PeeringPropertiesExchange(Model): + """The properties that define an exchange peering. + + :param connections: The set of connections that constitute an exchange + peering. + :type connections: list[~azure.mgmt.peering.models.ExchangeConnection] + :param peer_asn: The reference of the peer ASN. + :type peer_asn: ~azure.mgmt.peering.models.SubResource + """ + + _attribute_map = { + 'connections': {'key': 'connections', 'type': '[ExchangeConnection]'}, + 'peer_asn': {'key': 'peerAsn', 'type': 'SubResource'}, + } + + def __init__(self, **kwargs): + super(PeeringPropertiesExchange, self).__init__(**kwargs) + self.connections = kwargs.get('connections', None) + self.peer_asn = kwargs.get('peer_asn', None) + + +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) + + +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) + + +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 + + +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) + + +class PeeringSku(Model): + """The SKU that defines the tier and kind of the peering. + + :param name: The name of the peering SKU. Possible values include: + 'Basic_Exchange_Free', 'Basic_Direct_Free', 'Premium_Direct_Free', + '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' + :type tier: str or ~azure.mgmt.peering.models.Tier + :param family: The family of the peering SKU. Possible values include: + 'Direct', 'Exchange' + :type family: str or ~azure.mgmt.peering.models.Family + :param size: The size of the peering SKU. Possible values include: 'Free', + 'Metered', 'Unlimited' + :type size: str or ~azure.mgmt.peering.models.Size + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeeringSku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + self.family = kwargs.get('family', None) + self.size = kwargs.get('size', None) + + +class ResourceTags(Model): + """The resource tags. + + :param tags: Gets or sets the tags, a dictionary of descriptors arm object + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ResourceTags, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class SubResource(Model): + """The sub resource. + + :param id: The identifier of the referenced resource. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_models_py3.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_models_py3.py new file mode 100644 index 000000000000..6f78c6170d1e --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_models_py3.py @@ -0,0 +1,1011 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class BgpSession(Model): + """The properties that define a BGP session. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param session_prefix_v4: The IPv4 prefix that contains both ends' IPv4 + addresses. + :type session_prefix_v4: str + :param session_prefix_v6: The IPv6 prefix that contains both ends' IPv6 + addresses. + :type session_prefix_v6: str + :ivar microsoft_session_ipv4_address: The IPv4 session address on + Microsoft's end. + :vartype microsoft_session_ipv4_address: str + :ivar microsoft_session_ipv6_address: The IPv6 session address on + Microsoft's end. + :vartype microsoft_session_ipv6_address: str + :param peer_session_ipv4_address: The IPv4 session address on peer's end. + :type peer_session_ipv4_address: str + :param peer_session_ipv6_address: The IPv6 session address on peer's end. + :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', + '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', + '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 + advertised over the IPv4 session. + :type max_prefixes_advertised_v4: int + :param max_prefixes_advertised_v6: The maximum number of prefixes + advertised over the IPv6 session. + :type max_prefixes_advertised_v6: int + :param md5_authentication_key: The MD5 authentication key of the session. + :type md5_authentication_key: str + """ + + _validation = { + 'microsoft_session_ipv4_address': {'readonly': True}, + 'microsoft_session_ipv6_address': {'readonly': True}, + 'session_state_v4': {'readonly': True}, + 'session_state_v6': {'readonly': True}, + } + + _attribute_map = { + 'session_prefix_v4': {'key': 'sessionPrefixV4', 'type': 'str'}, + 'session_prefix_v6': {'key': 'sessionPrefixV6', 'type': 'str'}, + 'microsoft_session_ipv4_address': {'key': 'microsoftSessionIPv4Address', 'type': 'str'}, + 'microsoft_session_ipv6_address': {'key': 'microsoftSessionIPv6Address', 'type': 'str'}, + 'peer_session_ipv4_address': {'key': 'peerSessionIPv4Address', 'type': 'str'}, + 'peer_session_ipv6_address': {'key': 'peerSessionIPv6Address', 'type': 'str'}, + 'session_state_v4': {'key': 'sessionStateV4', 'type': 'str'}, + 'session_state_v6': {'key': 'sessionStateV6', 'type': 'str'}, + 'max_prefixes_advertised_v4': {'key': 'maxPrefixesAdvertisedV4', 'type': 'int'}, + 'max_prefixes_advertised_v6': {'key': 'maxPrefixesAdvertisedV6', 'type': 'int'}, + 'md5_authentication_key': {'key': 'md5AuthenticationKey', 'type': 'str'}, + } + + def __init__(self, *, session_prefix_v4: str=None, session_prefix_v6: str=None, peer_session_ipv4_address: str=None, peer_session_ipv6_address: str=None, max_prefixes_advertised_v4: int=None, max_prefixes_advertised_v6: int=None, md5_authentication_key: str=None, **kwargs) -> None: + super(BgpSession, self).__init__(**kwargs) + self.session_prefix_v4 = session_prefix_v4 + self.session_prefix_v6 = session_prefix_v6 + self.microsoft_session_ipv4_address = None + self.microsoft_session_ipv6_address = None + self.peer_session_ipv4_address = peer_session_ipv4_address + self.peer_session_ipv6_address = peer_session_ipv6_address + self.session_state_v4 = None + self.session_state_v6 = None + self.max_prefixes_advertised_v4 = max_prefixes_advertised_v4 + self.max_prefixes_advertised_v6 = max_prefixes_advertised_v6 + self.md5_authentication_key = md5_authentication_key + + +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 + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class ContactInfo(Model): + """The contact information of the peer. + + :param emails: The list of email addresses. + :type emails: list[str] + :param phone: The list of contact numbers. + :type phone: list[str] + """ + + _attribute_map = { + 'emails': {'key': 'emails', 'type': '[str]'}, + 'phone': {'key': 'phone', 'type': '[str]'}, + } + + def __init__(self, *, emails=None, phone=None, **kwargs) -> None: + super(ContactInfo, self).__init__(**kwargs) + self.emails = emails + self.phone = phone + + +class DirectConnection(Model): + """The properties that define a direct connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param bandwidth_in_mbps: The bandwidth of the connection. + :type bandwidth_in_mbps: int + :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 + :ivar connection_state: The state of the connection. Possible values + include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', + 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + :vartype connection_state: str or + ~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 = { + 'connection_state': {'readonly': True}, + } + + _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, 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 + + +class DirectPeeringFacility(Model): + """The properties that define a direct peering facility. + + :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. + :type peering_db_facility_link: str + """ + + _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, 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 + + +class ErrorResponse(Model): + """The error response that indicates why an operation has failed. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.code = None + self.message = None + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class ExchangeConnection(Model): + """The properties that define an exchange connection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :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 + :ivar connection_state: The state of the connection. Possible values + include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', + 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + :vartype connection_state: str or + ~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 = { + 'connection_state': {'readonly': True}, + } + + _attribute_map = { + '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, 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 + + +class ExchangePeeringFacility(Model): + """The properties that define an exchange peering facility. + + :param exchange_name: The name of the exchange peering facility. + :type exchange_name: str + :param bandwidth_in_mbps: The bandwidth of the connection between + Microsoft and the exchange peering facility. + :type bandwidth_in_mbps: int + :param microsoft_ipv4_address: The IPv4 address of Microsoft at the + exchange peering facility. + :type microsoft_ipv4_address: str + :param microsoft_ipv6_address: The IPv6 address of Microsoft at the + exchange peering facility. + :type microsoft_ipv6_address: str + :param facility_ipv4_prefix: The IPv4 prefixes associated with the + exchange peering facility. + :type facility_ipv4_prefix: str + :param facility_ipv6_prefix: The IPv6 prefixes associated with the + exchange peering facility. + :type facility_ipv6_prefix: str + :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. + :type peering_db_facility_link: str + """ + + _attribute_map = { + 'exchange_name': {'key': 'exchangeName', 'type': 'str'}, + 'bandwidth_in_mbps': {'key': 'bandwidthInMbps', 'type': 'int'}, + 'microsoft_ipv4_address': {'key': 'microsoftIPv4Address', 'type': 'str'}, + 'microsoft_ipv6_address': {'key': 'microsoftIPv6Address', 'type': 'str'}, + 'facility_ipv4_prefix': {'key': 'facilityIPv4Prefix', 'type': 'str'}, + 'facility_ipv6_prefix': {'key': 'facilityIPv6Prefix', 'type': 'str'}, + 'peering_db_facility_id': {'key': 'peeringDBFacilityId', 'type': 'int'}, + 'peering_db_facility_link': {'key': 'peeringDBFacilityLink', 'type': 'str'}, + } + + def __init__(self, *, exchange_name: str=None, bandwidth_in_mbps: int=None, microsoft_ipv4_address: str=None, microsoft_ipv6_address: str=None, facility_ipv4_prefix: str=None, facility_ipv6_prefix: str=None, peering_db_facility_id: int=None, peering_db_facility_link: str=None, **kwargs) -> None: + super(ExchangePeeringFacility, self).__init__(**kwargs) + self.exchange_name = exchange_name + self.bandwidth_in_mbps = bandwidth_in_mbps + self.microsoft_ipv4_address = microsoft_ipv4_address + self.microsoft_ipv6_address = microsoft_ipv6_address + self.facility_ipv4_prefix = facility_ipv4_prefix + self.facility_ipv6_prefix = facility_ipv6_prefix + self.peering_db_facility_id = peering_db_facility_id + self.peering_db_facility_link = peering_db_facility_link + + +class Operation(Model): + """The peering API operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The name of the operation. + :vartype name: str + :ivar display: The information related to the operation. + :vartype display: ~azure.mgmt.peering.models.OperationDisplayInfo + :ivar is_data_action: The flag that indicates whether the operation + applies to data plane. + :vartype is_data_action: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + 'is_data_action': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + self.is_data_action = None + + +class OperationDisplayInfo(Model): + """The information related to the operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar provider: The name of the resource provider. + :vartype provider: str + :ivar resource: The type of the resource. + :vartype resource: str + :ivar operation: The name of the operation. + :vartype operation: str + :ivar description: The description of the operation. + :vartype description: str + """ + + _validation = { + 'provider': {'readonly': True}, + 'resource': {'readonly': True}, + 'operation': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationDisplayInfo, self).__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None + + +class Resource(Model): + """The ARM resource 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 + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + + +class PeerAsn(Resource): + """The essential information related to the peer's ASN. + + 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 peer_asn: The Autonomous System Number (ASN) of the peer. + :type peer_asn: int + :param peer_contact_info: The contact information of the peer. + :type peer_contact_info: ~azure.mgmt.peering.models.ContactInfo + :param peer_name: The name of the peer. + :type peer_name: str + :param validation_state: The validation state of the ASN associated with + the peer. Possible values include: 'None', 'Pending', 'Approved', 'Failed' + :type validation_state: str or ~azure.mgmt.peering.models.ValidationState + """ + + _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'}, + 'peer_asn': {'key': 'properties.peerAsn', 'type': 'int'}, + 'peer_contact_info': {'key': 'properties.peerContactInfo', 'type': 'ContactInfo'}, + 'peer_name': {'key': 'properties.peerName', 'type': 'str'}, + 'validation_state': {'key': 'properties.validationState', 'type': 'str'}, + } + + def __init__(self, *, peer_asn: int=None, peer_contact_info=None, peer_name: str=None, validation_state=None, **kwargs) -> None: + super(PeerAsn, self).__init__(**kwargs) + self.peer_asn = peer_asn + self.peer_contact_info = peer_contact_info + self.peer_name = peer_name + self.validation_state = validation_state + + +class Peering(Resource): + """Peering is a logical representation of a set of connections to the + Microsoft Cloud Edge at a location. + + 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 sku: Required. The SKU that defines the tier and kind of the + peering. + :type sku: ~azure.mgmt.peering.models.PeeringSku + :param kind: Required. The kind of the peering. Possible values include: + 'Direct', 'Exchange' + :type kind: str or ~azure.mgmt.peering.models.Kind + :param direct: The properties that define a direct peering. + :type direct: ~azure.mgmt.peering.models.PeeringPropertiesDirect + :param exchange: The properties that define an exchange peering. + :type exchange: ~azure.mgmt.peering.models.PeeringPropertiesExchange + :param peering_location: The location of the peering. + :type peering_location: 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}, + 'sku': {'required': True}, + 'kind': {'required': 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'}, + 'sku': {'key': 'sku', 'type': 'PeeringSku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'direct': {'key': 'properties.direct', 'type': 'PeeringPropertiesDirect'}, + 'exchange': {'key': 'properties.exchange', 'type': 'PeeringPropertiesExchange'}, + 'peering_location': {'key': 'properties.peeringLocation', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku, kind, location: str, direct=None, exchange=None, peering_location: str=None, tags=None, **kwargs) -> None: + super(Peering, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.direct = direct + self.exchange = exchange + self.peering_location = peering_location + self.provisioning_state = None + self.location = location + self.tags = tags + + +class PeeringBandwidthOffer(Model): + """The properties that define a peering bandwidth offer. + + :param offer_name: The name of the bandwidth offer. + :type offer_name: str + :param value_in_mbps: The value of the bandwidth offer in Mbps. + :type value_in_mbps: int + """ + + _attribute_map = { + 'offer_name': {'key': 'offerName', 'type': 'str'}, + 'value_in_mbps': {'key': 'valueInMbps', 'type': 'int'}, + } + + def __init__(self, *, offer_name: str=None, value_in_mbps: int=None, **kwargs) -> None: + super(PeeringBandwidthOffer, self).__init__(**kwargs) + self.offer_name = offer_name + self.value_in_mbps = value_in_mbps + + +class PeeringLocation(Resource): + """Peering location is where connectivity could be established to the + Microsoft Cloud Edge. + + 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 kind: The kind of peering that the peering location supports. + Possible values include: 'Direct', 'Exchange' + :type kind: str or ~azure.mgmt.peering.models.Kind + :param direct: The properties that define a direct peering location. + :type direct: ~azure.mgmt.peering.models.PeeringLocationPropertiesDirect + :param exchange: The properties that define an exchange peering location. + :type exchange: + ~azure.mgmt.peering.models.PeeringLocationPropertiesExchange + :param peering_location: The name of the peering location. + :type peering_location: str + :param country: The country in which the peering location exists. + :type country: str + :param azure_region: The Azure region associated with the peering + 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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'direct': {'key': 'properties.direct', 'type': 'PeeringLocationPropertiesDirect'}, + 'exchange': {'key': 'properties.exchange', 'type': 'PeeringLocationPropertiesExchange'}, + 'peering_location': {'key': 'properties.peeringLocation', 'type': 'str'}, + 'country': {'key': 'properties.country', 'type': 'str'}, + 'azure_region': {'key': 'properties.azureRegion', 'type': 'str'}, + } + + def __init__(self, *, kind=None, direct=None, exchange=None, peering_location: str=None, country: str=None, azure_region: str=None, **kwargs) -> None: + super(PeeringLocation, self).__init__(**kwargs) + self.kind = kind + self.direct = direct + self.exchange = exchange + self.peering_location = peering_location + self.country = country + self.azure_region = azure_region + + +class PeeringLocationPropertiesDirect(Model): + """The properties that define a direct peering location. + + :param peering_facilities: The list of direct peering facilities at the + peering location. + :type peering_facilities: + list[~azure.mgmt.peering.models.DirectPeeringFacility] + :param bandwidth_offers: The list of bandwidth offers available at the + peering location. + :type bandwidth_offers: + list[~azure.mgmt.peering.models.PeeringBandwidthOffer] + """ + + _attribute_map = { + 'peering_facilities': {'key': 'peeringFacilities', 'type': '[DirectPeeringFacility]'}, + 'bandwidth_offers': {'key': 'bandwidthOffers', 'type': '[PeeringBandwidthOffer]'}, + } + + def __init__(self, *, peering_facilities=None, bandwidth_offers=None, **kwargs) -> None: + super(PeeringLocationPropertiesDirect, self).__init__(**kwargs) + self.peering_facilities = peering_facilities + self.bandwidth_offers = bandwidth_offers + + +class PeeringLocationPropertiesExchange(Model): + """The properties that define an exchange peering location. + + :param peering_facilities: The list of exchange peering facilities at the + peering location. + :type peering_facilities: + list[~azure.mgmt.peering.models.ExchangePeeringFacility] + """ + + _attribute_map = { + 'peering_facilities': {'key': 'peeringFacilities', 'type': '[ExchangePeeringFacility]'}, + } + + def __init__(self, *, peering_facilities=None, **kwargs) -> None: + super(PeeringLocationPropertiesExchange, self).__init__(**kwargs) + self.peering_facilities = peering_facilities + + +class PeeringPropertiesDirect(Model): + """The properties that define a direct peering. + + :param connections: The set of connections that constitute a direct + peering. + :type connections: list[~azure.mgmt.peering.models.DirectConnection] + :param use_for_peering_service: The flag that indicates whether or not the + peering is used for peering service. + :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, 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 + + +class PeeringPropertiesExchange(Model): + """The properties that define an exchange peering. + + :param connections: The set of connections that constitute an exchange + peering. + :type connections: list[~azure.mgmt.peering.models.ExchangeConnection] + :param peer_asn: The reference of the peer ASN. + :type peer_asn: ~azure.mgmt.peering.models.SubResource + """ + + _attribute_map = { + 'connections': {'key': 'connections', 'type': '[ExchangeConnection]'}, + 'peer_asn': {'key': 'peerAsn', 'type': 'SubResource'}, + } + + def __init__(self, *, connections=None, peer_asn=None, **kwargs) -> None: + super(PeeringPropertiesExchange, self).__init__(**kwargs) + self.connections = connections + self.peer_asn = peer_asn + + +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 + + +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 + + +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 + + +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 + + +class PeeringSku(Model): + """The SKU that defines the tier and kind of the peering. + + :param name: The name of the peering SKU. Possible values include: + 'Basic_Exchange_Free', 'Basic_Direct_Free', 'Premium_Direct_Free', + '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' + :type tier: str or ~azure.mgmt.peering.models.Tier + :param family: The family of the peering SKU. Possible values include: + 'Direct', 'Exchange' + :type family: str or ~azure.mgmt.peering.models.Family + :param size: The size of the peering SKU. Possible values include: 'Free', + 'Metered', 'Unlimited' + :type size: str or ~azure.mgmt.peering.models.Size + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + } + + def __init__(self, *, name=None, tier=None, family=None, size=None, **kwargs) -> None: + super(PeeringSku, self).__init__(**kwargs) + self.name = name + self.tier = tier + self.family = family + self.size = size + + +class ResourceTags(Model): + """The resource tags. + + :param tags: Gets or sets the tags, a dictionary of descriptors arm object + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ResourceTags, self).__init__(**kwargs) + self.tags = tags + + +class SubResource(Model): + """The sub resource. + + :param id: The identifier of the referenced resource. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(SubResource, self).__init__(**kwargs) + self.id = id diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_paged_models.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_paged_models.py new file mode 100644 index 000000000000..c06074238113 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_paged_models.py @@ -0,0 +1,118 @@ +# 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 PeeringPaged(Paged): + """ + A paging container for iterating over a list of :class:`Peering ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Peering]'} + } + + def __init__(self, *args, **kwargs): + + super(PeeringPaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) +class PeerAsnPaged(Paged): + """ + A paging container for iterating over a list of :class:`PeerAsn ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PeerAsn]'} + } + + def __init__(self, *args, **kwargs): + + super(PeerAsnPaged, self).__init__(*args, **kwargs) +class PeeringLocationPaged(Paged): + """ + A paging container for iterating over a list of :class:`PeeringLocation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PeeringLocation]'} + } + + def __init__(self, *args, **kwargs): + + super(PeeringLocationPaged, self).__init__(*args, **kwargs) +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) +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) +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) +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/peering/azure-mgmt-peering/azure/mgmt/peering/models/_peering_management_client_enums.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_peering_management_client_enums.py new file mode 100644 index 000000000000..37c0a42f2acb --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_peering_management_client_enums.py @@ -0,0 +1,136 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class Name(str, Enum): + + basic_exchange_free = "Basic_Exchange_Free" + 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): + + basic = "Basic" + premium = "Premium" + + +class Family(str, Enum): + + direct = "Direct" + exchange = "Exchange" + + +class Size(str, Enum): + + free = "Free" + metered = "Metered" + unlimited = "Unlimited" + + +class Kind(str, Enum): + + direct = "Direct" + exchange = "Exchange" + + +class SessionAddressProvider(str, Enum): + + microsoft = "Microsoft" + peer = "Peer" + + +class ConnectionState(str, Enum): + + none = "None" + pending_approval = "PendingApproval" + approved = "Approved" + provisioning_started = "ProvisioningStarted" + provisioning_failed = "ProvisioningFailed" + provisioning_completed = "ProvisioningCompleted" + validating = "Validating" + active = "Active" + + +class SessionStateV4(str, Enum): + + none = "None" + idle = "Idle" + connect = "Connect" + active = "Active" + open_sent = "OpenSent" + open_confirm = "OpenConfirm" + open_received = "OpenReceived" + established = "Established" + pending_add = "PendingAdd" + pending_update = "PendingUpdate" + pending_remove = "PendingRemove" + + +class SessionStateV6(str, Enum): + + none = "None" + idle = "Idle" + connect = "Connect" + 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" + updating = "Updating" + deleting = "Deleting" + failed = "Failed" + + +class ValidationState(str, Enum): + + none = "None" + 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/peering/azure-mgmt-peering/azure/mgmt/peering/operations/__init__.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/__init__.py new file mode 100644 index 000000000000..c5b265b97999 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/__init__.py @@ -0,0 +1,36 @@ +# 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 ._legacy_peerings_operations import LegacyPeeringsOperations +from ._operations import Operations +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 +from ._peering_management_client_operations import PeeringManagementClientOperationsMixin + +__all__ = [ + 'LegacyPeeringsOperations', + 'Operations', + 'PeerAsnsOperations', + 'PeeringLocationsOperations', + 'PeeringsOperations', + 'PeeringServiceLocationsOperations', + 'PeeringServicePrefixesOperations', + 'PrefixesOperations', + 'PeeringServiceProvidersOperations', + 'PeeringServicesOperations', + 'PeeringManagementClientOperationsMixin', +] diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_legacy_peerings_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_legacy_peerings_operations.py new file mode 100644 index 000000000000..2a60be96b3fc --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_legacy_peerings_operations.py @@ -0,0 +1,112 @@ +# 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 LegacyPeeringsOperations(object): + """LegacyPeeringsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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, peering_location, kind, custom_headers=None, raw=False, **operation_config): + """Lists all of the legacy peerings under the given subscription matching + the specified kind and location. + + :param peering_location: The location of the peering. + :type peering_location: str + :param kind: The kind of the peering. Possible values include: + 'Direct', 'Exchange' + :type kind: 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 Peering + :rtype: + ~azure.mgmt.peering.models.PeeringPaged[~azure.mgmt.peering.models.Peering] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + 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['peeringLocation'] = self._serialize.query("peering_location", peering_location, 'str') + query_parameters['kind'] = self._serialize.query("kind", kind, 'str') + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeeringPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/legacyPeerings'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_operations.py new file mode 100644 index 000000000000..d94d1ea31dbc --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_operations.py @@ -0,0 +1,100 @@ +# 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 Operations(object): + """Operations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 API operations for peering resources. + + :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 Operation + :rtype: + ~azure.mgmt.peering.models.OperationPaged[~azure.mgmt.peering.models.Operation] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Peering/operations'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peer_asns_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peer_asns_operations.py new file mode 100644 index 000000000000..90f31ead3bf7 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peer_asns_operations.py @@ -0,0 +1,277 @@ +# 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 PeerAsnsOperations(object): + """PeerAsnsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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, peer_asn_name, custom_headers=None, raw=False, **operation_config): + """Gets the peer ASN with the specified name under the given subscription. + + :param peer_asn_name: The peer ASN name. + :type peer_asn_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: PeerAsn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeerAsn or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'peerAsnName': self._serialize.url("peer_asn_name", peer_asn_name, 'str'), + 'subscriptionId': self._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('PeerAsn', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns/{peerAsnName}'} + + def create_or_update( + self, peer_asn_name, peer_asn, custom_headers=None, raw=False, **operation_config): + """Creates a new peer ASN or updates an existing peer ASN with the + specified name under the given subscription. + + :param peer_asn_name: The peer ASN name. + :type peer_asn_name: str + :param peer_asn: The peer ASN. + :type peer_asn: ~azure.mgmt.peering.models.PeerAsn + :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: PeerAsn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeerAsn or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'peerAsnName': self._serialize.url("peer_asn_name", peer_asn_name, 'str'), + 'subscriptionId': self._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(peer_asn, 'PeerAsn') + + # 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('PeerAsn', response) + if response.status_code == 201: + deserialized = self._deserialize('PeerAsn', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns/{peerAsnName}'} + + def delete( + self, peer_asn_name, custom_headers=None, raw=False, **operation_config): + """Deletes an existing peer ASN with the specified name under the given + subscription. + + :param peer_asn_name: The peer ASN name. + :type peer_asn_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 = { + 'peerAsnName': self._serialize.url("peer_asn_name", peer_asn_name, 'str'), + 'subscriptionId': self._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}/providers/Microsoft.Peering/peerAsns/{peerAsnName}'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the peer ASNs 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 PeerAsn + :rtype: + ~azure.mgmt.peering.models.PeerAsnPaged[~azure.mgmt.peering.models.PeerAsn] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeerAsnPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_locations_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_locations_operations.py new file mode 100644 index 000000000000..6935adb7da8f --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_locations_operations.py @@ -0,0 +1,114 @@ +# 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 PeeringLocationsOperations(object): + """PeeringLocationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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, 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PeeringLocation + :rtype: + ~azure.mgmt.peering.models.PeeringLocationPaged[~azure.mgmt.peering.models.PeeringLocation] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + 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['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: + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeeringLocationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringLocations'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_management_client_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_management_client_operations.py new file mode 100644 index 000000000000..85630b814cb2 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_management_client_operations.py @@ -0,0 +1,83 @@ +# 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.pipeline import ClientRawResponse +from .. import models +import uuid + + +class PeeringManagementClientOperationsMixin(object): + + 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'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_locations_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_locations_operations.py new file mode 100644 index 000000000000..d5fcb77a4189 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_locations_operations.py @@ -0,0 +1,105 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeeringServiceLocationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceLocations'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_prefixes_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_prefixes_operations.py new file mode 100644 index 000000000000..979613cd9dc5 --- /dev/null +++ b/sdk/peering/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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_providers_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_providers_operations.py new file mode 100644 index 000000000000..18197e1202f8 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_providers_operations.py @@ -0,0 +1,105 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeeringServiceProviderPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceProviders'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_services_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_services_operations.py new file mode 100644 index 000000000000..7c5c7837466d --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_services_operations.py @@ -0,0 +1,427 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeeringServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + + 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 prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeeringServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServices'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peerings_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peerings_operations.py new file mode 100644 index 000000000000..f8b79147bc57 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peerings_operations.py @@ -0,0 +1,426 @@ +# 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 PeeringsOperations(object): + """PeeringsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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_name, custom_headers=None, raw=False, **operation_config): + """Gets 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_name: The name of the peering. + :type peering_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: Peering or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.Peering 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'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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('Peering', 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/peerings/{peeringName}'} + + def create_or_update( + self, resource_group_name, peering_name, peering, custom_headers=None, raw=False, **operation_config): + """Creates a new peering 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_name: The name of the peering. + :type peering_name: str + :param peering: The properties needed to create or update a peering. + :type peering: ~azure.mgmt.peering.models.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: Peering or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.Peering 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'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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, 'Peering') + + # 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('Peering', response) + if response.status_code == 201: + deserialized = self._deserialize('Peering', 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/peerings/{peeringName}'} + + def delete( + self, resource_group_name, peering_name, custom_headers=None, raw=False, **operation_config): + """Deletes 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_name: The name of the peering. + :type peering_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'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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/peerings/{peeringName}'} + + def update( + self, resource_group_name, peering_name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates tags for a 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_name: The name of the peering. + :type peering_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: Peering or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.Peering 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'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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('Peering', 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/peerings/{peeringName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all of the peerings 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 Peering + :rtype: + ~azure.mgmt.peering.models.PeeringPaged[~azure.mgmt.peering.models.Peering] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeeringPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings'} + + 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 Peering + :rtype: + ~azure.mgmt.peering.models.PeeringPaged[~azure.mgmt.peering.models.Peering] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeeringPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerings'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_prefixes_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_prefixes_operations.py new file mode 100644 index 000000000000..08b618b2518e --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_prefixes_operations.py @@ -0,0 +1,110 @@ +# 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. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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 prepare_request(next_link=None): + 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) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + 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 + header_dict = None + if raw: + header_dict = {} + deserialized = models.PeeringServicePrefixPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_peering_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/version.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/version.py new file mode 100644 index 000000000000..0529c1b3b0f0 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/version.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0rc1" + diff --git a/sdk/peering/azure-mgmt-peering/sdk_packaging.toml b/sdk/peering/azure-mgmt-peering/sdk_packaging.toml new file mode 100644 index 000000000000..cbeb3e2f1461 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-peering" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Peering Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/peering/azure-mgmt-peering/setup.cfg b/sdk/peering/azure-mgmt-peering/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/peering/azure-mgmt-peering/setup.py b/sdk/peering/azure-mgmt-peering/setup.py new file mode 100644 index 000000000000..190b4f7046c0 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/setup.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-peering" +PACKAGE_PPRINT_NAME = "Peering Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.rst', encoding='utf-8') as f: + readme = f.read() +with open('HISTORY.rst', encoding='utf-8') as f: + history = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)