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 index 9e303a0aa953..fabd77f8a74b 100644 --- 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 @@ -18,7 +18,10 @@ from .operations import Operations from .operations import PeerAsnsOperations from .operations import PeeringLocationsOperations +from .operations import RegisteredAsnsOperations +from .operations import RegisteredPrefixesOperations from .operations import PeeringsOperations +from .operations import PeeringServiceCountriesOperations from .operations import PeeringServiceLocationsOperations from .operations import PrefixesOperations from .operations import PeeringServiceProvidersOperations @@ -40,8 +43,14 @@ class PeeringManagementClient(PeeringManagementClientOperationsMixin, SDKClient) :vartype peer_asns: azure.mgmt.peering.operations.PeerAsnsOperations :ivar peering_locations: PeeringLocations operations :vartype peering_locations: azure.mgmt.peering.operations.PeeringLocationsOperations + :ivar registered_asns: RegisteredAsns operations + :vartype registered_asns: azure.mgmt.peering.operations.RegisteredAsnsOperations + :ivar registered_prefixes: RegisteredPrefixes operations + :vartype registered_prefixes: azure.mgmt.peering.operations.RegisteredPrefixesOperations :ivar peerings: Peerings operations :vartype peerings: azure.mgmt.peering.operations.PeeringsOperations + :ivar peering_service_countries: PeeringServiceCountries operations + :vartype peering_service_countries: azure.mgmt.peering.operations.PeeringServiceCountriesOperations :ivar peering_service_locations: PeeringServiceLocations operations :vartype peering_service_locations: azure.mgmt.peering.operations.PeeringServiceLocationsOperations :ivar prefixes: Prefixes operations @@ -66,7 +75,7 @@ def __init__( super(PeeringManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-09-01-preview' + self.api_version = '2020-01-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -78,8 +87,14 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.peering_locations = PeeringLocationsOperations( self._client, self.config, self._serialize, self._deserialize) + self.registered_asns = RegisteredAsnsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.registered_prefixes = RegisteredPrefixesOperations( + self._client, self.config, self._serialize, self._deserialize) self.peerings = PeeringsOperations( self._client, self.config, self._serialize, self._deserialize) + self.peering_service_countries = PeeringServiceCountriesOperations( + self._client, self.config, self._serialize, self._deserialize) self.peering_service_locations = PeeringServiceLocationsOperations( self._client, self.config, self._serialize, self._deserialize) self.prefixes = PrefixesOperations( 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 index afe897a2a540..d6b96d971a13 100644 --- a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/__init__.py +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/__init__.py @@ -12,7 +12,7 @@ try: from ._models_py3 import BgpSession from ._models_py3 import CheckServiceProviderAvailabilityInput - from ._models_py3 import ContactInfo + from ._models_py3 import ContactDetail from ._models_py3 import DirectConnection from ._models_py3 import DirectPeeringFacility from ._models_py3 import ErrorResponse, ErrorResponseException @@ -28,11 +28,15 @@ from ._models_py3 import PeeringLocationPropertiesExchange from ._models_py3 import PeeringPropertiesDirect from ._models_py3 import PeeringPropertiesExchange + from ._models_py3 import PeeringRegisteredAsn + from ._models_py3 import PeeringRegisteredPrefix from ._models_py3 import PeeringService + from ._models_py3 import PeeringServiceCountry from ._models_py3 import PeeringServiceLocation from ._models_py3 import PeeringServicePrefix from ._models_py3 import PeeringServicePrefixEvent from ._models_py3 import PeeringServiceProvider + from ._models_py3 import PeeringServiceSku from ._models_py3 import PeeringSku from ._models_py3 import Resource from ._models_py3 import ResourceTags @@ -40,7 +44,7 @@ except (SyntaxError, ImportError): from ._models import BgpSession from ._models import CheckServiceProviderAvailabilityInput - from ._models import ContactInfo + from ._models import ContactDetail from ._models import DirectConnection from ._models import DirectPeeringFacility from ._models import ErrorResponse, ErrorResponseException @@ -56,11 +60,15 @@ from ._models import PeeringLocationPropertiesExchange from ._models import PeeringPropertiesDirect from ._models import PeeringPropertiesExchange + from ._models import PeeringRegisteredAsn + from ._models import PeeringRegisteredPrefix from ._models import PeeringService + from ._models import PeeringServiceCountry from ._models import PeeringServiceLocation from ._models import PeeringServicePrefix from ._models import PeeringServicePrefixEvent from ._models import PeeringServiceProvider + from ._models import PeeringServiceSku from ._models import PeeringSku from ._models import Resource from ._models import ResourceTags @@ -69,12 +77,14 @@ from ._paged_models import PeerAsnPaged from ._paged_models import PeeringLocationPaged from ._paged_models import PeeringPaged +from ._paged_models import PeeringRegisteredAsnPaged +from ._paged_models import PeeringRegisteredPrefixPaged +from ._paged_models import PeeringServiceCountryPaged 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, @@ -85,6 +95,7 @@ SessionStateV6, DirectPeeringType, ProvisioningState, + Role, ValidationState, PrefixValidationState, LearnedType, @@ -93,7 +104,7 @@ __all__ = [ 'BgpSession', 'CheckServiceProviderAvailabilityInput', - 'ContactInfo', + 'ContactDetail', 'DirectConnection', 'DirectPeeringFacility', 'ErrorResponse', 'ErrorResponseException', @@ -109,11 +120,15 @@ 'PeeringLocationPropertiesExchange', 'PeeringPropertiesDirect', 'PeeringPropertiesExchange', + 'PeeringRegisteredAsn', + 'PeeringRegisteredPrefix', 'PeeringService', + 'PeeringServiceCountry', 'PeeringServiceLocation', 'PeeringServicePrefix', 'PeeringServicePrefixEvent', 'PeeringServiceProvider', + 'PeeringServiceSku', 'PeeringSku', 'Resource', 'ResourceTags', @@ -122,11 +137,13 @@ 'OperationPaged', 'PeerAsnPaged', 'PeeringLocationPaged', + 'PeeringRegisteredAsnPaged', + 'PeeringRegisteredPrefixPaged', + 'PeeringServiceCountryPaged', 'PeeringServiceLocationPaged', 'PeeringServicePrefixPaged', 'PeeringServiceProviderPaged', 'PeeringServicePaged', - 'Name', 'Tier', 'Family', 'Size', @@ -137,6 +154,7 @@ 'SessionStateV6', 'DirectPeeringType', 'ProvisioningState', + 'Role', '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 index fc31afd88ca0..2601c22c04ab 100644 --- a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_models.py +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/models/_models.py @@ -96,9 +96,11 @@ def __init__(self, **kwargs): class CheckServiceProviderAvailabilityInput(Model): """Class for CheckServiceProviderAvailabilityInput. - :param peering_service_location: Gets or sets the PeeringServiceLocation + :param peering_service_location: Gets or sets the peering service + location. :type peering_service_location: str - :param peering_service_provider: Gets or sets the PeeringServiceProvider + :param peering_service_provider: Gets or sets the peering service + provider. :type peering_service_provider: str """ @@ -121,23 +123,28 @@ class CloudError(Model): } -class ContactInfo(Model): - """The contact information of the peer. +class ContactDetail(Model): + """The contact detail class. - :param emails: The list of email addresses. - :type emails: list[str] - :param phone: The list of contact numbers. - :type phone: list[str] + :param role: The role of the contact. Possible values include: 'Noc', + 'Policy', 'Technical', 'Service', 'Other' + :type role: str or ~azure.mgmt.peering.models.Role + :param email: The e-mail address of the contact. + :type email: str + :param phone: The phone number of the contact. + :type phone: str """ _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - 'phone': {'key': 'phone', 'type': '[str]'}, + 'role': {'key': 'role', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, } def __init__(self, **kwargs): - super(ContactInfo, self).__init__(**kwargs) - self.emails = kwargs.get('emails', None) + super(ContactDetail, self).__init__(**kwargs) + self.role = kwargs.get('role', None) + self.email = kwargs.get('email', None) self.phone = kwargs.get('phone', None) @@ -215,7 +222,7 @@ class DirectPeeringFacility(Model): :param address: The address of the direct peering facility. :type address: str :param direct_peering_type: The type of the direct peering. Possible - values include: 'Edge', 'Transit', 'Cdn', 'Internal' + values include: 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' :type direct_peering_type: str or ~azure.mgmt.peering.models.DirectPeeringType :param peering_db_facility_id: The PeeringDB.com ID of the facility. @@ -493,8 +500,8 @@ class PeerAsn(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_contact_detail: The contact details of the peer. + :type peer_contact_detail: list[~azure.mgmt.peering.models.ContactDetail] :param peer_name: The name of the peer. :type peer_name: str :param validation_state: The validation state of the ASN associated with @@ -516,7 +523,7 @@ class PeerAsn(Resource): '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_contact_detail': {'key': 'properties.peerContactDetail', 'type': '[ContactDetail]'}, 'peer_name': {'key': 'properties.peerName', 'type': 'str'}, 'validation_state': {'key': 'properties.validationState', 'type': 'str'}, 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, @@ -525,7 +532,7 @@ class PeerAsn(Resource): 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_contact_detail = kwargs.get('peer_contact_detail', None) self.peer_name = kwargs.get('peer_name', None) self.validation_state = kwargs.get('validation_state', None) self.error_message = None @@ -739,7 +746,7 @@ class PeeringPropertiesDirect(Model): :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' + include: 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' :type direct_peering_type: str or ~azure.mgmt.peering.models.DirectPeeringType """ @@ -784,6 +791,114 @@ def __init__(self, **kwargs): self.peer_asn = kwargs.get('peer_asn', None) +class PeeringRegisteredAsn(Resource): + """The customer's ASN that is registered by the peering service 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 asn: The customer's ASN from which traffic originates. + :type asn: int + :ivar peering_service_prefix_key: The peering service prefix key that is + to be shared with the customer. + :vartype peering_service_prefix_key: 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 + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'peering_service_prefix_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'asn': {'key': 'properties.asn', 'type': 'int'}, + 'peering_service_prefix_key': {'key': 'properties.peeringServicePrefixKey', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeeringRegisteredAsn, self).__init__(**kwargs) + self.asn = kwargs.get('asn', None) + self.peering_service_prefix_key = None + self.provisioning_state = None + + +class PeeringRegisteredPrefix(Resource): + """The customer's prefix that is registered by the peering service 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 prefix: The customer's prefix from which traffic originates. + :type prefix: str + :ivar prefix_validation_state: The prefix validation state. Possible + values include: 'None', 'Invalid', 'Verified', 'Failed', 'Pending', + 'Warning', 'Unknown' + :vartype prefix_validation_state: str or + ~azure.mgmt.peering.models.PrefixValidationState + :ivar peering_service_prefix_key: The peering service prefix key that is + to be shared with the customer. + :vartype peering_service_prefix_key: str + :ivar error_message: The error message associated with the validation + state, if any. + :vartype error_message: 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 + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'prefix_validation_state': {'readonly': True}, + 'peering_service_prefix_key': {'readonly': True}, + 'error_message': {'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'}, + 'peering_service_prefix_key': {'key': 'properties.peeringServicePrefixKey', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeeringRegisteredPrefix, self).__init__(**kwargs) + self.prefix = kwargs.get('prefix', None) + self.prefix_validation_state = None + self.peering_service_prefix_key = None + self.error_message = None + self.provisioning_state = None + + class PeeringService(Resource): """Peering Service. @@ -798,6 +913,8 @@ class PeeringService(Resource): :vartype id: str :ivar type: The type of the resource. :vartype type: str + :param sku: The SKU that defines the type of the peering service. + :type sku: ~azure.mgmt.peering.models.PeeringServiceSku :param peering_service_location: The PeeringServiceLocation of the Customer. :type peering_service_location: str @@ -825,6 +942,7 @@ class PeeringService(Resource): 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'PeeringServiceSku'}, 'peering_service_location': {'key': 'properties.peeringServiceLocation', 'type': 'str'}, 'peering_service_provider': {'key': 'properties.peeringServiceProvider', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -834,6 +952,7 @@ class PeeringService(Resource): def __init__(self, **kwargs): super(PeeringService, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) self.peering_service_location = kwargs.get('peering_service_location', None) self.peering_service_provider = kwargs.get('peering_service_provider', None) self.provisioning_state = None @@ -841,8 +960,38 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) +class PeeringServiceCountry(Resource): + """The peering service country. + + 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(PeeringServiceCountry, self).__init__(**kwargs) + + class PeeringServiceLocation(Resource): - """PeeringService location. + """The peering service location. Variables are only populated by the server, and will be ignored when sending a request. @@ -910,6 +1059,8 @@ class PeeringServicePrefix(Resource): :ivar events: The list of events for peering service prefix :vartype events: list[~azure.mgmt.peering.models.PeeringServicePrefixEvent] + :param peering_service_prefix_key: The peering service prefix key + :type peering_service_prefix_key: str :ivar provisioning_state: The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' :vartype provisioning_state: str or @@ -936,6 +1087,7 @@ class PeeringServicePrefix(Resource): 'learned_type': {'key': 'properties.learnedType', 'type': 'str'}, 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, 'events': {'key': 'properties.events', 'type': '[PeeringServicePrefixEvent]'}, + 'peering_service_prefix_key': {'key': 'properties.peeringServicePrefixKey', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -946,6 +1098,7 @@ def __init__(self, **kwargs): self.learned_type = None self.error_message = None self.events = None + self.peering_service_prefix_key = kwargs.get('peering_service_prefix_key', None) self.provisioning_state = None @@ -1028,14 +1181,27 @@ def __init__(self, **kwargs): self.service_provider_name = kwargs.get('service_provider_name', None) +class PeeringServiceSku(Model): + """The SKU that defines the type of the peering service. + + :param name: The name of the peering service SKU. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeeringServiceSku, self).__init__(**kwargs) + self.name = kwargs.get('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 name: The name of the peering SKU. + :type name: str :param tier: The tier of the peering SKU. Possible values include: 'Basic', 'Premium' :type tier: str or ~azure.mgmt.peering.models.Tier 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 index d92200c18eea..967857cfecd5 100644 --- 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 @@ -96,9 +96,11 @@ def __init__(self, *, session_prefix_v4: str=None, session_prefix_v6: str=None, class CheckServiceProviderAvailabilityInput(Model): """Class for CheckServiceProviderAvailabilityInput. - :param peering_service_location: Gets or sets the PeeringServiceLocation + :param peering_service_location: Gets or sets the peering service + location. :type peering_service_location: str - :param peering_service_provider: Gets or sets the PeeringServiceProvider + :param peering_service_provider: Gets or sets the peering service + provider. :type peering_service_provider: str """ @@ -121,23 +123,28 @@ class CloudError(Model): } -class ContactInfo(Model): - """The contact information of the peer. +class ContactDetail(Model): + """The contact detail class. - :param emails: The list of email addresses. - :type emails: list[str] - :param phone: The list of contact numbers. - :type phone: list[str] + :param role: The role of the contact. Possible values include: 'Noc', + 'Policy', 'Technical', 'Service', 'Other' + :type role: str or ~azure.mgmt.peering.models.Role + :param email: The e-mail address of the contact. + :type email: str + :param phone: The phone number of the contact. + :type phone: str """ _attribute_map = { - 'emails': {'key': 'emails', 'type': '[str]'}, - 'phone': {'key': 'phone', 'type': '[str]'}, + 'role': {'key': 'role', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, } - def __init__(self, *, emails=None, phone=None, **kwargs) -> None: - super(ContactInfo, self).__init__(**kwargs) - self.emails = emails + def __init__(self, *, role=None, email: str=None, phone: str=None, **kwargs) -> None: + super(ContactDetail, self).__init__(**kwargs) + self.role = role + self.email = email self.phone = phone @@ -215,7 +222,7 @@ class DirectPeeringFacility(Model): :param address: The address of the direct peering facility. :type address: str :param direct_peering_type: The type of the direct peering. Possible - values include: 'Edge', 'Transit', 'Cdn', 'Internal' + values include: 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' :type direct_peering_type: str or ~azure.mgmt.peering.models.DirectPeeringType :param peering_db_facility_id: The PeeringDB.com ID of the facility. @@ -493,8 +500,8 @@ class PeerAsn(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_contact_detail: The contact details of the peer. + :type peer_contact_detail: list[~azure.mgmt.peering.models.ContactDetail] :param peer_name: The name of the peer. :type peer_name: str :param validation_state: The validation state of the ASN associated with @@ -516,16 +523,16 @@ class PeerAsn(Resource): '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_contact_detail': {'key': 'properties.peerContactDetail', 'type': '[ContactDetail]'}, 'peer_name': {'key': 'properties.peerName', 'type': 'str'}, 'validation_state': {'key': 'properties.validationState', 'type': 'str'}, 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, } - def __init__(self, *, peer_asn: int=None, peer_contact_info=None, peer_name: str=None, validation_state=None, **kwargs) -> None: + def __init__(self, *, peer_asn: int=None, peer_contact_detail=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_contact_detail = peer_contact_detail self.peer_name = peer_name self.validation_state = validation_state self.error_message = None @@ -739,7 +746,7 @@ class PeeringPropertiesDirect(Model): :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' + include: 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' :type direct_peering_type: str or ~azure.mgmt.peering.models.DirectPeeringType """ @@ -784,6 +791,114 @@ def __init__(self, *, connections=None, peer_asn=None, **kwargs) -> None: self.peer_asn = peer_asn +class PeeringRegisteredAsn(Resource): + """The customer's ASN that is registered by the peering service 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 asn: The customer's ASN from which traffic originates. + :type asn: int + :ivar peering_service_prefix_key: The peering service prefix key that is + to be shared with the customer. + :vartype peering_service_prefix_key: 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 + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'peering_service_prefix_key': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'asn': {'key': 'properties.asn', 'type': 'int'}, + 'peering_service_prefix_key': {'key': 'properties.peeringServicePrefixKey', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, asn: int=None, **kwargs) -> None: + super(PeeringRegisteredAsn, self).__init__(**kwargs) + self.asn = asn + self.peering_service_prefix_key = None + self.provisioning_state = None + + +class PeeringRegisteredPrefix(Resource): + """The customer's prefix that is registered by the peering service 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 prefix: The customer's prefix from which traffic originates. + :type prefix: str + :ivar prefix_validation_state: The prefix validation state. Possible + values include: 'None', 'Invalid', 'Verified', 'Failed', 'Pending', + 'Warning', 'Unknown' + :vartype prefix_validation_state: str or + ~azure.mgmt.peering.models.PrefixValidationState + :ivar peering_service_prefix_key: The peering service prefix key that is + to be shared with the customer. + :vartype peering_service_prefix_key: str + :ivar error_message: The error message associated with the validation + state, if any. + :vartype error_message: 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 + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'prefix_validation_state': {'readonly': True}, + 'peering_service_prefix_key': {'readonly': True}, + 'error_message': {'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'}, + 'peering_service_prefix_key': {'key': 'properties.peeringServicePrefixKey', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, prefix: str=None, **kwargs) -> None: + super(PeeringRegisteredPrefix, self).__init__(**kwargs) + self.prefix = prefix + self.prefix_validation_state = None + self.peering_service_prefix_key = None + self.error_message = None + self.provisioning_state = None + + class PeeringService(Resource): """Peering Service. @@ -798,6 +913,8 @@ class PeeringService(Resource): :vartype id: str :ivar type: The type of the resource. :vartype type: str + :param sku: The SKU that defines the type of the peering service. + :type sku: ~azure.mgmt.peering.models.PeeringServiceSku :param peering_service_location: The PeeringServiceLocation of the Customer. :type peering_service_location: str @@ -825,6 +942,7 @@ class PeeringService(Resource): 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'PeeringServiceSku'}, 'peering_service_location': {'key': 'properties.peeringServiceLocation', 'type': 'str'}, 'peering_service_provider': {'key': 'properties.peeringServiceProvider', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, @@ -832,8 +950,9 @@ class PeeringService(Resource): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, location: str, peering_service_location: str=None, peering_service_provider: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, sku=None, peering_service_location: str=None, peering_service_provider: str=None, tags=None, **kwargs) -> None: super(PeeringService, self).__init__(**kwargs) + self.sku = sku self.peering_service_location = peering_service_location self.peering_service_provider = peering_service_provider self.provisioning_state = None @@ -841,8 +960,38 @@ def __init__(self, *, location: str, peering_service_location: str=None, peering self.tags = tags +class PeeringServiceCountry(Resource): + """The peering service country. + + 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(PeeringServiceCountry, self).__init__(**kwargs) + + class PeeringServiceLocation(Resource): - """PeeringService location. + """The peering service location. Variables are only populated by the server, and will be ignored when sending a request. @@ -910,6 +1059,8 @@ class PeeringServicePrefix(Resource): :ivar events: The list of events for peering service prefix :vartype events: list[~azure.mgmt.peering.models.PeeringServicePrefixEvent] + :param peering_service_prefix_key: The peering service prefix key + :type peering_service_prefix_key: str :ivar provisioning_state: The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' :vartype provisioning_state: str or @@ -936,16 +1087,18 @@ class PeeringServicePrefix(Resource): 'learned_type': {'key': 'properties.learnedType', 'type': 'str'}, 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, 'events': {'key': 'properties.events', 'type': '[PeeringServicePrefixEvent]'}, + 'peering_service_prefix_key': {'key': 'properties.peeringServicePrefixKey', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, prefix: str=None, **kwargs) -> None: + def __init__(self, *, prefix: str=None, peering_service_prefix_key: str=None, **kwargs) -> None: super(PeeringServicePrefix, self).__init__(**kwargs) self.prefix = prefix self.prefix_validation_state = None self.learned_type = None self.error_message = None self.events = None + self.peering_service_prefix_key = peering_service_prefix_key self.provisioning_state = None @@ -1028,14 +1181,27 @@ def __init__(self, *, service_provider_name: str=None, **kwargs) -> None: self.service_provider_name = service_provider_name +class PeeringServiceSku(Model): + """The SKU that defines the type of the peering service. + + :param name: The name of the peering service SKU. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(PeeringServiceSku, self).__init__(**kwargs) + self.name = 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 name: The name of the peering SKU. + :type name: str :param tier: The tier of the peering SKU. Possible values include: 'Basic', 'Premium' :type tier: str or ~azure.mgmt.peering.models.Tier @@ -1054,7 +1220,7 @@ class PeeringSku(Model): 'size': {'key': 'size', 'type': 'str'}, } - def __init__(self, *, name=None, tier=None, family=None, size=None, **kwargs) -> None: + def __init__(self, *, name: str=None, tier=None, family=None, size=None, **kwargs) -> None: super(PeeringSku, self).__init__(**kwargs) self.name = name self.tier = tier 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 index c06074238113..525770f4a3ef 100644 --- 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 @@ -64,6 +64,45 @@ class PeeringLocationPaged(Paged): def __init__(self, *args, **kwargs): super(PeeringLocationPaged, self).__init__(*args, **kwargs) +class PeeringRegisteredAsnPaged(Paged): + """ + A paging container for iterating over a list of :class:`PeeringRegisteredAsn ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PeeringRegisteredAsn]'} + } + + def __init__(self, *args, **kwargs): + + super(PeeringRegisteredAsnPaged, self).__init__(*args, **kwargs) +class PeeringRegisteredPrefixPaged(Paged): + """ + A paging container for iterating over a list of :class:`PeeringRegisteredPrefix ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PeeringRegisteredPrefix]'} + } + + def __init__(self, *args, **kwargs): + + super(PeeringRegisteredPrefixPaged, self).__init__(*args, **kwargs) +class PeeringServiceCountryPaged(Paged): + """ + A paging container for iterating over a list of :class:`PeeringServiceCountry ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PeeringServiceCountry]'} + } + + def __init__(self, *args, **kwargs): + + super(PeeringServiceCountryPaged, self).__init__(*args, **kwargs) class PeeringServiceLocationPaged(Paged): """ A paging container for iterating over a list of :class:`PeeringServiceLocation ` object 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 index 2b757fd4427f..53bea817c995 100644 --- 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 @@ -12,16 +12,6 @@ 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" @@ -101,6 +91,8 @@ class DirectPeeringType(str, Enum): transit = "Transit" cdn = "Cdn" internal = "Internal" + ix = "Ix" + ix_rs = "IxRs" class ProvisioningState(str, Enum): @@ -111,6 +103,15 @@ class ProvisioningState(str, Enum): failed = "Failed" +class Role(str, Enum): + + noc = "Noc" + policy = "Policy" + technical = "Technical" + service = "Service" + other = "Other" + + class ValidationState(str, Enum): none = "None" 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 index cdd15747d39d..fd6e41d5445e 100644 --- a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/__init__.py +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/__init__.py @@ -13,7 +13,10 @@ from ._operations import Operations from ._peer_asns_operations import PeerAsnsOperations from ._peering_locations_operations import PeeringLocationsOperations +from ._registered_asns_operations import RegisteredAsnsOperations +from ._registered_prefixes_operations import RegisteredPrefixesOperations from ._peerings_operations import PeeringsOperations +from ._peering_service_countries_operations import PeeringServiceCountriesOperations from ._peering_service_locations_operations import PeeringServiceLocationsOperations from ._prefixes_operations import PrefixesOperations from ._peering_service_providers_operations import PeeringServiceProvidersOperations @@ -25,7 +28,10 @@ 'Operations', 'PeerAsnsOperations', 'PeeringLocationsOperations', + 'RegisteredAsnsOperations', + 'RegisteredPrefixesOperations', 'PeeringsOperations', + 'PeeringServiceCountriesOperations', 'PeeringServiceLocationsOperations', 'PrefixesOperations', 'PeeringServiceProvidersOperations', 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 index 131a2771c2c1..e2391ffba1c9 100644 --- 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 @@ -24,7 +24,7 @@ class LegacyPeeringsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-09-01-preview". + :ivar api_version: The client API version. Constant value: "2020-01-01-preview". """ models = models @@ -34,12 +34,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01-preview" + self.api_version = "2020-01-01-preview" self.config = config def list( - self, peering_location, kind, custom_headers=None, raw=False, **operation_config): + self, peering_location, kind, asn=None, custom_headers=None, raw=False, **operation_config): """Lists all of the legacy peerings under the given subscription matching the specified kind and location. @@ -48,6 +48,8 @@ def list( :param kind: The kind of the peering. Possible values include: 'Direct', 'Exchange' :type kind: str + :param asn: The ASN number associated with a legacy peering. + :type asn: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -72,6 +74,8 @@ def prepare_request(next_link=None): query_parameters = {} query_parameters['peeringLocation'] = self._serialize.query("peering_location", peering_location, 'str') query_parameters['kind'] = self._serialize.query("kind", kind, 'str') + if asn is not None: + query_parameters['asn'] = self._serialize.query("asn", asn, 'int') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: 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 index 3e049e50cc15..193b6b2ab538 100644 --- a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_operations.py +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_operations.py @@ -24,7 +24,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-09-01-preview". + :ivar api_version: The client API version. Constant value: "2020-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01-preview" + self.api_version = "2020-01-01-preview" self.config = config 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 index cb397734c859..fa965792817c 100644 --- 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 @@ -24,7 +24,7 @@ class PeerAsnsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-09-01-preview". + :ivar api_version: The client API version. Constant value: "2020-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01-preview" + self.api_version = "2020-01-01-preview" self.config = config 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 index 6cf7c67dd8ee..c2b71cd7b1b4 100644 --- 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 @@ -24,7 +24,7 @@ class PeeringLocationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-09-01-preview". + :ivar api_version: The client API version. Constant value: "2020-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01-preview" + self.api_version = "2020-01-01-preview" self.config = config @@ -47,7 +47,7 @@ def list( 'Direct', 'Exchange' :type kind: str :param direct_peering_type: The type of direct peering. Possible - values include: 'Edge', 'Transit', 'Cdn', 'Internal' + values include: 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' :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 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 index 85630b814cb2..f42083b22d89 100644 --- 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 @@ -21,11 +21,11 @@ def check_service_provider_availability( """Checks if the peering service provider is present within 1000 miles of customer's location. - :param peering_service_location: Gets or sets the - PeeringServiceLocation + :param peering_service_location: Gets or sets the peering service + location. :type peering_service_location: str - :param peering_service_provider: Gets or sets the - PeeringServiceProvider + :param peering_service_provider: Gets or sets the peering service + provider. :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 diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_countries_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_countries_operations.py new file mode 100644 index 000000000000..239997bd1df2 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_countries_operations.py @@ -0,0 +1,104 @@ +# 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 PeeringServiceCountriesOperations(object): + """PeeringServiceCountriesOperations 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: "2020-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-01-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available countries for peering service. + + :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 PeeringServiceCountry + :rtype: + ~azure.mgmt.peering.models.PeeringServiceCountryPaged[~azure.mgmt.peering.models.PeeringServiceCountry] + :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.PeeringServiceCountryPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceCountries'} 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 index cdf508d203c0..21bb6997cc78 100644 --- 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 @@ -24,7 +24,7 @@ class PeeringServiceLocationsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-09-01-preview". + :ivar api_version: The client API version. Constant value: "2020-01-01-preview". """ models = models @@ -34,15 +34,17 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01-preview" + self.api_version = "2020-01-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. + self, country=None, custom_headers=None, raw=False, **operation_config): + """Lists all of the available locations for peering service. + :param country: The country of interest, in which the locations are to + be present. + :type country: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -65,6 +67,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + if country is not None: + query_parameters['country'] = self._serialize.query("country", country, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: 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 index 4aba0deb4a86..85e334e0ca6c 100644 --- 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 @@ -24,7 +24,7 @@ class PeeringServiceProvidersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-09-01-preview". + :ivar api_version: The client API version. Constant value: "2020-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01-preview" + self.api_version = "2020-01-01-preview" self.config = config 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 index ecac472f7b58..107dfc1d9f7b 100644 --- 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 @@ -24,7 +24,7 @@ class PeeringServicesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-09-01-preview". + :ivar api_version: The client API version. Constant value: "2020-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01-preview" + self.api_version = "2020-01-01-preview" self.config = config 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 index 40da1c496759..d45dfc85bdab 100644 --- 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 @@ -24,7 +24,7 @@ class PeeringsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-09-01-preview". + :ivar api_version: The client API version. Constant value: "2020-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01-preview" + self.api_version = "2020-01-01-preview" self.config = config 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 index 3b94252cdd96..1f3b5bb27d6b 100644 --- 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 @@ -24,7 +24,7 @@ class PrefixesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The client API version. Constant value: "2019-09-01-preview". + :ivar api_version: The client API version. Constant value: "2020-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-09-01-preview" + self.api_version = "2020-01-01-preview" self.config = config @@ -107,7 +107,7 @@ def get( 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, prefix=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, peering_service_name, prefix_name, prefix=None, peering_service_prefix_key=None, custom_headers=None, raw=False, **operation_config): """Creates a new prefix with the specified name under the given subscription, resource group and peering service. @@ -119,6 +119,8 @@ def create_or_update( :type prefix_name: str :param prefix: The prefix from which your traffic originates. :type prefix: str + :param peering_service_prefix_key: The peering service prefix key + :type peering_service_prefix_key: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -130,7 +132,7 @@ def create_or_update( :raises: :class:`ErrorResponseException` """ - peering_service_prefix = models.PeeringServicePrefix(prefix=prefix) + peering_service_prefix = models.PeeringServicePrefix(prefix=prefix, peering_service_prefix_key=peering_service_prefix_key) # Construct URL url = self.create_or_update.metadata['url'] diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_registered_asns_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_registered_asns_operations.py new file mode 100644 index 000000000000..b413f0151b09 --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_registered_asns_operations.py @@ -0,0 +1,305 @@ +# 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 RegisteredAsnsOperations(object): + """RegisteredAsnsOperations 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: "2020-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-01-01-preview" + + self.config = config + + def get( + self, resource_group_name, peering_name, registered_asn_name, custom_headers=None, raw=False, **operation_config): + """Gets an existing registered ASN with the specified name under the given + subscription, resource group and peering. + + :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 registered_asn_name: The name of the registered ASN. + :type registered_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: PeeringRegisteredAsn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringRegisteredAsn 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'), + 'registeredAsnName': self._serialize.url("registered_asn_name", registered_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('PeeringRegisteredAsn', 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}/registeredAsns/{registeredAsnName}'} + + def create_or_update( + self, resource_group_name, peering_name, registered_asn_name, asn=None, custom_headers=None, raw=False, **operation_config): + """Creates a new registered ASN with the specified name under the given + subscription, resource group and peering. + + :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 registered_asn_name: The name of the ASN. + :type registered_asn_name: str + :param asn: The customer's ASN from which traffic originates. + :type asn: int + :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: PeeringRegisteredAsn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringRegisteredAsn or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + registered_asn = models.PeeringRegisteredAsn(asn=asn) + + # 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'), + 'registeredAsnName': self._serialize.url("registered_asn_name", registered_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(registered_asn, 'PeeringRegisteredAsn') + + # 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('PeeringRegisteredAsn', response) + if response.status_code == 201: + deserialized = self._deserialize('PeeringRegisteredAsn', 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}/registeredAsns/{registeredAsnName}'} + + def delete( + self, resource_group_name, peering_name, registered_asn_name, custom_headers=None, raw=False, **operation_config): + """Deletes an existing registered ASN with the specified name under the + given subscription, resource group and peering. + + :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 registered_asn_name: The name of the registered ASN. + :type registered_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 = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'registeredAsnName': self._serialize.url("registered_asn_name", registered_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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/registeredAsns/{registeredAsnName}'} + + def list_by_peering( + self, resource_group_name, peering_name, custom_headers=None, raw=False, **operation_config): + """Lists all registered ASNs under the given subscription, resource group + and peering. + + :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: An iterator like instance of PeeringRegisteredAsn + :rtype: + ~azure.mgmt.peering.models.PeeringRegisteredAsnPaged[~azure.mgmt.peering.models.PeeringRegisteredAsn] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_peering.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') + + 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.PeeringRegisteredAsnPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_peering.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/registeredAsns'} diff --git a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_registered_prefixes_operations.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_registered_prefixes_operations.py new file mode 100644 index 000000000000..b9d8fab0ef8c --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_registered_prefixes_operations.py @@ -0,0 +1,305 @@ +# 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 RegisteredPrefixesOperations(object): + """RegisteredPrefixesOperations 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: "2020-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-01-01-preview" + + self.config = config + + def get( + self, resource_group_name, peering_name, registered_prefix_name, custom_headers=None, raw=False, **operation_config): + """Gets an existing registered prefix with the specified name under the + given subscription, resource group and peering. + + :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 registered_prefix_name: The name of the registered prefix. + :type registered_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: PeeringRegisteredPrefix or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringRegisteredPrefix 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'), + 'registeredPrefixName': self._serialize.url("registered_prefix_name", registered_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('PeeringRegisteredPrefix', 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}/registeredPrefixes/{registeredPrefixName}'} + + def create_or_update( + self, resource_group_name, peering_name, registered_prefix_name, prefix=None, custom_headers=None, raw=False, **operation_config): + """Creates a new registered prefix with the specified name under the given + subscription, resource group and peering. + + :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 registered_prefix_name: The name of the registered prefix. + :type registered_prefix_name: str + :param prefix: The customer's prefix from which traffic originates. + :type prefix: 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: PeeringRegisteredPrefix or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringRegisteredPrefix or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + registered_prefix = models.PeeringRegisteredPrefix(prefix=prefix) + + # 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'), + 'registeredPrefixName': self._serialize.url("registered_prefix_name", registered_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(registered_prefix, 'PeeringRegisteredPrefix') + + # 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('PeeringRegisteredPrefix', response) + if response.status_code == 201: + deserialized = self._deserialize('PeeringRegisteredPrefix', 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}/registeredPrefixes/{registeredPrefixName}'} + + def delete( + self, resource_group_name, peering_name, registered_prefix_name, custom_headers=None, raw=False, **operation_config): + """Deletes an existing registered prefix with the specified name under the + given subscription, resource group and peering. + + :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 registered_prefix_name: The name of the registered prefix. + :type registered_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'), + 'peeringName': self._serialize.url("peering_name", peering_name, 'str'), + 'registeredPrefixName': self._serialize.url("registered_prefix_name", registered_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/peerings/{peeringName}/registeredPrefixes/{registeredPrefixName}'} + + def list_by_peering( + self, resource_group_name, peering_name, custom_headers=None, raw=False, **operation_config): + """Lists all registered prefixes under the given subscription, resource + group and peering. + + :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: An iterator like instance of PeeringRegisteredPrefix + :rtype: + ~azure.mgmt.peering.models.PeeringRegisteredPrefixPaged[~azure.mgmt.peering.models.PeeringRegisteredPrefix] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_peering.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') + + 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.PeeringRegisteredPrefixPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_peering.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/registeredPrefixes'}