diff --git a/sdk/peering/azure-mgmt-peering/HISTORY.rst b/sdk/peering/azure-mgmt-peering/HISTORY.rst index 8a589f5f9a92..d3b55bbc1ccd 100644 --- a/sdk/peering/azure-mgmt-peering/HISTORY.rst +++ b/sdk/peering/azure-mgmt-peering/HISTORY.rst @@ -3,6 +3,13 @@ Release History =============== +0.1.0rc2 (2019-10-24) ++++++++++++++++++++++ + +**Breaking changes** + +- Migrated operations from PeeringServicePrefixesOperations to PrefixesOperations + 0.1.0rc1 (2019-09-26) +++++++++++++++++++++ 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 6509e2c4056a..9e303a0aa953 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 @@ -20,7 +20,6 @@ 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 @@ -45,8 +44,6 @@ class PeeringManagementClient(PeeringManagementClientOperationsMixin, SDKClient) :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 @@ -69,7 +66,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-08-01-preview' + self.api_version = '2019-09-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -85,8 +82,6 @@ def __init__( 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( 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 76921f6bcfa8..afe897a2a540 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 @@ -31,6 +31,7 @@ from ._models_py3 import PeeringService from ._models_py3 import PeeringServiceLocation from ._models_py3 import PeeringServicePrefix + from ._models_py3 import PeeringServicePrefixEvent from ._models_py3 import PeeringServiceProvider from ._models_py3 import PeeringSku from ._models_py3 import Resource @@ -58,6 +59,7 @@ from ._models import PeeringService from ._models import PeeringServiceLocation from ._models import PeeringServicePrefix + from ._models import PeeringServicePrefixEvent from ._models import PeeringServiceProvider from ._models import PeeringSku from ._models import Resource @@ -110,6 +112,7 @@ 'PeeringService', 'PeeringServiceLocation', 'PeeringServicePrefix', + 'PeeringServicePrefixEvent', 'PeeringServiceProvider', 'PeeringSku', 'Resource', 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 60ac670ced22..fc31afd88ca0 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 @@ -149,9 +149,9 @@ class DirectConnection(Model): :param bandwidth_in_mbps: The bandwidth of the connection. :type bandwidth_in_mbps: int - :param provisioned_bandwidth_in_mbps: The bandwidth that is actually + :ivar provisioned_bandwidth_in_mbps: The bandwidth that is actually provisioned. - :type provisioned_bandwidth_in_mbps: int + :vartype provisioned_bandwidth_in_mbps: int :param session_address_provider: The field indicating if Microsoft provides session ip addresses. Possible values include: 'Microsoft', 'Peer' @@ -173,10 +173,15 @@ class DirectConnection(Model): :param connection_identifier: The unique identifier (GUID) for the connection. :type connection_identifier: str + :ivar error_message: The error message related to the connection state, if + any. + :vartype error_message: str """ _validation = { + 'provisioned_bandwidth_in_mbps': {'readonly': True}, 'connection_state': {'readonly': True}, + 'error_message': {'readonly': True}, } _attribute_map = { @@ -188,18 +193,20 @@ class DirectConnection(Model): 'connection_state': {'key': 'connectionState', 'type': 'str'}, 'bgp_session': {'key': 'bgpSession', 'type': 'BgpSession'}, 'connection_identifier': {'key': 'connectionIdentifier', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', '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.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) + self.error_message = None class DirectPeeringFacility(Model): @@ -291,10 +298,14 @@ class ExchangeConnection(Model): :param connection_identifier: The unique identifier (GUID) for the connection. :type connection_identifier: str + :ivar error_message: The error message related to the connection state, if + any. + :vartype error_message: str """ _validation = { 'connection_state': {'readonly': True}, + 'error_message': {'readonly': True}, } _attribute_map = { @@ -302,6 +313,7 @@ class ExchangeConnection(Model): 'connection_state': {'key': 'connectionState', 'type': 'str'}, 'bgp_session': {'key': 'bgpSession', 'type': 'BgpSession'}, 'connection_identifier': {'key': 'connectionIdentifier', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, } def __init__(self, **kwargs): @@ -310,6 +322,7 @@ def __init__(self, **kwargs): self.connection_state = None self.bgp_session = kwargs.get('bgp_session', None) self.connection_identifier = kwargs.get('connection_identifier', None) + self.error_message = None class ExchangePeeringFacility(Model): @@ -487,12 +500,15 @@ class PeerAsn(Resource): :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 + :ivar error_message: The error message for the validation state + :vartype error_message: str """ _validation = { 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'error_message': {'readonly': True}, } _attribute_map = { @@ -503,6 +519,7 @@ class PeerAsn(Resource): 'peer_contact_info': {'key': 'properties.peerContactInfo', 'type': 'ContactInfo'}, 'peer_name': {'key': 'properties.peerName', 'type': 'str'}, 'validation_state': {'key': 'properties.validationState', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, } def __init__(self, **kwargs): @@ -511,6 +528,7 @@ def __init__(self, **kwargs): 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) + self.error_message = None class Peering(Resource): @@ -709,12 +727,15 @@ def __init__(self, **kwargs): class PeeringPropertiesDirect(Model): """The properties that define a direct peering. + Variables are only populated by the server, and will be ignored when + sending a request. + :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 + :ivar use_for_peering_service: The flag that indicates whether or not the peering is used for peering service. - :type use_for_peering_service: bool + :vartype 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 @@ -723,6 +744,10 @@ class PeeringPropertiesDirect(Model): ~azure.mgmt.peering.models.DirectPeeringType """ + _validation = { + 'use_for_peering_service': {'readonly': True}, + } + _attribute_map = { 'connections': {'key': 'connections', 'type': '[DirectConnection]'}, 'use_for_peering_service': {'key': 'useForPeeringService', 'type': 'bool'}, @@ -733,7 +758,7 @@ class PeeringPropertiesDirect(Model): 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.use_for_peering_service = None self.peer_asn = kwargs.get('peer_asn', None) self.direct_peering_type = kwargs.get('direct_peering_type', None) @@ -870,16 +895,21 @@ class PeeringServicePrefix(Resource): :vartype id: str :ivar type: The type of the resource. :vartype type: str - :param prefix: Valid route prefix + :param prefix: The prefix from which your traffic originates. :type prefix: str - :param prefix_validation_state: The prefix validation state. Possible + :ivar prefix_validation_state: The prefix validation state. Possible values include: 'None', 'Invalid', 'Verified', 'Failed', 'Pending', - 'Unknown' - :type prefix_validation_state: str or + 'Warning', 'Unknown' + :vartype 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 learned_type: The prefix learned type. Possible values include: + 'None', 'ViaServiceProvider', 'ViaSession' + :vartype learned_type: str or ~azure.mgmt.peering.models.LearnedType + :ivar error_message: The error message for validation state + :vartype error_message: str + :ivar events: The list of events for peering service prefix + :vartype events: + list[~azure.mgmt.peering.models.PeeringServicePrefixEvent] :ivar provisioning_state: The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' :vartype provisioning_state: str or @@ -890,6 +920,10 @@ class PeeringServicePrefix(Resource): 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'prefix_validation_state': {'readonly': True}, + 'learned_type': {'readonly': True}, + 'error_message': {'readonly': True}, + 'events': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -900,17 +934,66 @@ class PeeringServicePrefix(Resource): 'prefix': {'key': 'properties.prefix', 'type': 'str'}, 'prefix_validation_state': {'key': 'properties.prefixValidationState', 'type': 'str'}, 'learned_type': {'key': 'properties.learnedType', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + 'events': {'key': 'properties.events', 'type': '[PeeringServicePrefixEvent]'}, '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.prefix_validation_state = None + self.learned_type = None + self.error_message = None + self.events = None self.provisioning_state = None +class PeeringServicePrefixEvent(Model): + """The details of the event associated with a prefix. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar event_timestamp: The timestamp of the event associated with a + prefix. + :vartype event_timestamp: datetime + :ivar event_type: The type of the event associated with a prefix. + :vartype event_type: str + :ivar event_summary: The summary of the event associated with a prefix. + :vartype event_summary: str + :ivar event_level: The level of the event associated with a prefix. + :vartype event_level: str + :ivar event_description: The description of the event associated with a + prefix. + :vartype event_description: str + """ + + _validation = { + 'event_timestamp': {'readonly': True}, + 'event_type': {'readonly': True}, + 'event_summary': {'readonly': True}, + 'event_level': {'readonly': True}, + 'event_description': {'readonly': True}, + } + + _attribute_map = { + 'event_timestamp': {'key': 'eventTimestamp', 'type': 'iso-8601'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'event_summary': {'key': 'eventSummary', 'type': 'str'}, + 'event_level': {'key': 'eventLevel', 'type': 'str'}, + 'event_description': {'key': 'eventDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PeeringServicePrefixEvent, self).__init__(**kwargs) + self.event_timestamp = None + self.event_type = None + self.event_summary = None + self.event_level = None + self.event_description = None + + class PeeringServiceProvider(Resource): """PeeringService provider. 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 6f78c6170d1e..d92200c18eea 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 @@ -149,9 +149,9 @@ class DirectConnection(Model): :param bandwidth_in_mbps: The bandwidth of the connection. :type bandwidth_in_mbps: int - :param provisioned_bandwidth_in_mbps: The bandwidth that is actually + :ivar provisioned_bandwidth_in_mbps: The bandwidth that is actually provisioned. - :type provisioned_bandwidth_in_mbps: int + :vartype provisioned_bandwidth_in_mbps: int :param session_address_provider: The field indicating if Microsoft provides session ip addresses. Possible values include: 'Microsoft', 'Peer' @@ -173,10 +173,15 @@ class DirectConnection(Model): :param connection_identifier: The unique identifier (GUID) for the connection. :type connection_identifier: str + :ivar error_message: The error message related to the connection state, if + any. + :vartype error_message: str """ _validation = { + 'provisioned_bandwidth_in_mbps': {'readonly': True}, 'connection_state': {'readonly': True}, + 'error_message': {'readonly': True}, } _attribute_map = { @@ -188,18 +193,20 @@ class DirectConnection(Model): 'connection_state': {'key': 'connectionState', 'type': 'str'}, 'bgp_session': {'key': 'bgpSession', 'type': 'BgpSession'}, 'connection_identifier': {'key': 'connectionIdentifier', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', '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: + def __init__(self, *, 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.provisioned_bandwidth_in_mbps = None 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 + self.error_message = None class DirectPeeringFacility(Model): @@ -291,10 +298,14 @@ class ExchangeConnection(Model): :param connection_identifier: The unique identifier (GUID) for the connection. :type connection_identifier: str + :ivar error_message: The error message related to the connection state, if + any. + :vartype error_message: str """ _validation = { 'connection_state': {'readonly': True}, + 'error_message': {'readonly': True}, } _attribute_map = { @@ -302,6 +313,7 @@ class ExchangeConnection(Model): 'connection_state': {'key': 'connectionState', 'type': 'str'}, 'bgp_session': {'key': 'bgpSession', 'type': 'BgpSession'}, 'connection_identifier': {'key': 'connectionIdentifier', 'type': 'str'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, } def __init__(self, *, peering_db_facility_id: int=None, bgp_session=None, connection_identifier: str=None, **kwargs) -> None: @@ -310,6 +322,7 @@ def __init__(self, *, peering_db_facility_id: int=None, bgp_session=None, connec self.connection_state = None self.bgp_session = bgp_session self.connection_identifier = connection_identifier + self.error_message = None class ExchangePeeringFacility(Model): @@ -487,12 +500,15 @@ class PeerAsn(Resource): :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 + :ivar error_message: The error message for the validation state + :vartype error_message: str """ _validation = { 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'error_message': {'readonly': True}, } _attribute_map = { @@ -503,6 +519,7 @@ class PeerAsn(Resource): 'peer_contact_info': {'key': 'properties.peerContactInfo', 'type': 'ContactInfo'}, '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: @@ -511,6 +528,7 @@ def __init__(self, *, peer_asn: int=None, peer_contact_info=None, peer_name: str self.peer_contact_info = peer_contact_info self.peer_name = peer_name self.validation_state = validation_state + self.error_message = None class Peering(Resource): @@ -709,12 +727,15 @@ def __init__(self, *, peering_facilities=None, **kwargs) -> None: class PeeringPropertiesDirect(Model): """The properties that define a direct peering. + Variables are only populated by the server, and will be ignored when + sending a request. + :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 + :ivar use_for_peering_service: The flag that indicates whether or not the peering is used for peering service. - :type use_for_peering_service: bool + :vartype 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 @@ -723,6 +744,10 @@ class PeeringPropertiesDirect(Model): ~azure.mgmt.peering.models.DirectPeeringType """ + _validation = { + 'use_for_peering_service': {'readonly': True}, + } + _attribute_map = { 'connections': {'key': 'connections', 'type': '[DirectConnection]'}, 'use_for_peering_service': {'key': 'useForPeeringService', 'type': 'bool'}, @@ -730,10 +755,10 @@ class PeeringPropertiesDirect(Model): '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: + def __init__(self, *, connections=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.use_for_peering_service = None self.peer_asn = peer_asn self.direct_peering_type = direct_peering_type @@ -870,16 +895,21 @@ class PeeringServicePrefix(Resource): :vartype id: str :ivar type: The type of the resource. :vartype type: str - :param prefix: Valid route prefix + :param prefix: The prefix from which your traffic originates. :type prefix: str - :param prefix_validation_state: The prefix validation state. Possible + :ivar prefix_validation_state: The prefix validation state. Possible values include: 'None', 'Invalid', 'Verified', 'Failed', 'Pending', - 'Unknown' - :type prefix_validation_state: str or + 'Warning', 'Unknown' + :vartype 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 learned_type: The prefix learned type. Possible values include: + 'None', 'ViaServiceProvider', 'ViaSession' + :vartype learned_type: str or ~azure.mgmt.peering.models.LearnedType + :ivar error_message: The error message for validation state + :vartype error_message: str + :ivar events: The list of events for peering service prefix + :vartype events: + list[~azure.mgmt.peering.models.PeeringServicePrefixEvent] :ivar provisioning_state: The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' :vartype provisioning_state: str or @@ -890,6 +920,10 @@ class PeeringServicePrefix(Resource): 'name': {'readonly': True}, 'id': {'readonly': True}, 'type': {'readonly': True}, + 'prefix_validation_state': {'readonly': True}, + 'learned_type': {'readonly': True}, + 'error_message': {'readonly': True}, + 'events': {'readonly': True}, 'provisioning_state': {'readonly': True}, } @@ -900,17 +934,66 @@ class PeeringServicePrefix(Resource): 'prefix': {'key': 'properties.prefix', 'type': 'str'}, 'prefix_validation_state': {'key': 'properties.prefixValidationState', 'type': 'str'}, 'learned_type': {'key': 'properties.learnedType', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + 'events': {'key': 'properties.events', 'type': '[PeeringServicePrefixEvent]'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, prefix: str=None, prefix_validation_state=None, learned_type=None, **kwargs) -> None: + def __init__(self, *, prefix: str=None, **kwargs) -> None: super(PeeringServicePrefix, self).__init__(**kwargs) self.prefix = prefix - self.prefix_validation_state = prefix_validation_state - self.learned_type = learned_type + self.prefix_validation_state = None + self.learned_type = None + self.error_message = None + self.events = None self.provisioning_state = None +class PeeringServicePrefixEvent(Model): + """The details of the event associated with a prefix. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar event_timestamp: The timestamp of the event associated with a + prefix. + :vartype event_timestamp: datetime + :ivar event_type: The type of the event associated with a prefix. + :vartype event_type: str + :ivar event_summary: The summary of the event associated with a prefix. + :vartype event_summary: str + :ivar event_level: The level of the event associated with a prefix. + :vartype event_level: str + :ivar event_description: The description of the event associated with a + prefix. + :vartype event_description: str + """ + + _validation = { + 'event_timestamp': {'readonly': True}, + 'event_type': {'readonly': True}, + 'event_summary': {'readonly': True}, + 'event_level': {'readonly': True}, + 'event_description': {'readonly': True}, + } + + _attribute_map = { + 'event_timestamp': {'key': 'eventTimestamp', 'type': 'iso-8601'}, + 'event_type': {'key': 'eventType', 'type': 'str'}, + 'event_summary': {'key': 'eventSummary', 'type': 'str'}, + 'event_level': {'key': 'eventLevel', 'type': 'str'}, + 'event_description': {'key': 'eventDescription', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PeeringServicePrefixEvent, self).__init__(**kwargs) + self.event_timestamp = None + self.event_type = None + self.event_summary = None + self.event_level = None + self.event_description = None + + class PeeringServiceProvider(Resource): """PeeringService provider. 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 37c0a42f2acb..2b757fd4427f 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 @@ -126,11 +126,12 @@ class PrefixValidationState(str, Enum): verified = "Verified" failed = "Failed" pending = "Pending" + warning = "Warning" unknown = "Unknown" class LearnedType(str, Enum): none = "None" - via_partner = "ViaPartner" + via_service_provider = "ViaServiceProvider" 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 index c5b265b97999..cdd15747d39d 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 @@ -15,7 +15,6 @@ 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 @@ -28,7 +27,6 @@ 'PeeringLocationsOperations', 'PeeringsOperations', 'PeeringServiceLocationsOperations', - 'PeeringServicePrefixesOperations', 'PrefixesOperations', 'PeeringServiceProvidersOperations', 'PeeringServicesOperations', 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 2a60be96b3fc..131a2771c2c1 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-08-01-preview". + :ivar api_version: The client API version. Constant value: "2019-09-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-08-01-preview" + self.api_version = "2019-09-01-preview" self.config = config 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 d94d1ea31dbc..3e049e50cc15 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-08-01-preview". + :ivar api_version: The client API version. Constant value: "2019-09-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-08-01-preview" + self.api_version = "2019-09-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 90f31ead3bf7..cb397734c859 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-08-01-preview". + :ivar api_version: The client API version. Constant value: "2019-09-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-08-01-preview" + self.api_version = "2019-09-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 6935adb7da8f..6cf7c67dd8ee 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-08-01-preview". + :ivar api_version: The client API version. Constant value: "2019-09-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-08-01-preview" + self.api_version = "2019-09-01-preview" self.config = config 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 d5fcb77a4189..cdf508d203c0 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-08-01-preview". + :ivar api_version: The client API version. Constant value: "2019-09-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-08-01-preview" + self.api_version = "2019-09-01-preview" self.config = config 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 deleted file mode 100644 index 979613cd9dc5..000000000000 --- a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/operations/_peering_service_prefixes_operations.py +++ /dev/null @@ -1,229 +0,0 @@ -# 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 index 18197e1202f8..4aba0deb4a86 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-08-01-preview". + :ivar api_version: The client API version. Constant value: "2019-09-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-08-01-preview" + self.api_version = "2019-09-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 7c5c7837466d..ecac472f7b58 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-08-01-preview". + :ivar api_version: The client API version. Constant value: "2019-09-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-08-01-preview" + self.api_version = "2019-09-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 f8b79147bc57..40da1c496759 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-08-01-preview". + :ivar api_version: The client API version. Constant value: "2019-09-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-08-01-preview" + self.api_version = "2019-09-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 08b618b2518e..3b94252cdd96 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-08-01-preview". + :ivar api_version: The client API version. Constant value: "2019-09-01-preview". """ models = models @@ -34,18 +34,219 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-08-01-preview" + self.api_version = "2019-09-01-preview" self.config = config + def get( + self, resource_group_name, peering_service_name, prefix_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets an existing prefix with the specified name under the given + subscription, resource group and peering service. + + :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 prefix_name: The name of the prefix. + :type prefix_name: str + :param expand: The properties to be expanded. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: 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 = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + 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, prefix=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. + + :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 prefix_name: The name of the prefix. + :type prefix_name: str + :param prefix: The prefix from which your 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: PeeringServicePrefix or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.peering.models.PeeringServicePrefix or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + peering_service_prefix = models.PeeringServicePrefix(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'), + '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): + """Deletes an existing prefix with the specified name under the given + subscription, resource group and peering service. + + :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 prefix_name: The name of the prefix. + :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}'} + 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. + self, resource_group_name, peering_service_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Lists all prefixes under the given subscription, resource group and + peering service. - :param resource_group_name: The resource group name. + :param resource_group_name: The name of the resource group. :type resource_group_name: str - :param peering_service_name: The peering service name. + :param peering_service_name: The name of the peering service. :type peering_service_name: str + :param expand: The properties to be expanded. + :type expand: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -70,6 +271,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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/version.py b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/version.py index 0529c1b3b0f0..ad4aa9eb3df5 100644 --- a/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/version.py +++ b/sdk/peering/azure-mgmt-peering/azure/mgmt/peering/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0rc1" +VERSION = "0.1.0rc2" diff --git a/sdk/peering/azure-mgmt-peering/tests/recordings/test_mgmt_peering.test_peering.yaml b/sdk/peering/azure-mgmt-peering/tests/recordings/test_mgmt_peering.test_peering.yaml new file mode 100644 index 000000000000..90ba1891bb3d --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/tests/recordings/test_mgmt_peering.test_peering.yaml @@ -0,0 +1,183 @@ +interactions: +- request: + body: '{"properties": {"peeringServiceLocation": "California", "peeringServiceProvider": + "Kordia Limited"}, "location": "westus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '122' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.6.8 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.8 + msrest_azure/0.4.34 azure-mgmt-peering/0.1.0rc1 Azure-SDK-For-Python + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_peering_test_peeringc05b0c55/providers/Microsoft.Peering/peeringServices/MyPeerServiceName?api-version=2019-09-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"peeringServiceLocation\": \"California\"\ + ,\r\n \"peeringServiceProvider\": \"Kordia Limited\",\r\n \"provisioningState\"\ + : \"Succeeded\"\r\n },\r\n \"location\": \"westus\",\r\n \"eTag\": \"e242c145-decb-4c6f-be6d-ddd1909a69e4\"\ + ,\r\n \"name\": \"MyPeerServiceName\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_peering_test_peeringc05b0c55/providers/Microsoft.Peering/peeringServices/MyPeerServiceName\"\ + ,\r\n \"type\": \"Microsoft.Peering/peeringServices\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '496' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Oct 2019 04:21:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '99' + status: + code: 201 + message: Created +- request: + body: '{"properties": {"prefix": "192.168.1.0/24"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '44' + Content-Type: + - application/json; charset=utf-8 + User-Agent: + - python/3.6.8 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.8 + msrest_azure/0.4.34 azure-mgmt-peering/0.1.0rc1 Azure-SDK-For-Python + accept-language: + - en-US + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_peering_test_peeringc05b0c55/providers/Microsoft.Peering/peeringServices/MyPeerServiceName/prefixes/MyPeerPrefix?api-version=2019-09-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"prefix\": \"192.168.1.0/24\",\r\n\ + \ \"prefixValidationState\": \"Pending\",\r\n \"learnedType\": \"None\"\ + ,\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"name\": \"MyPeerPrefix\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_peering_test_peeringc05b0c55/providers/Microsoft.Peering/peeringServices/MyPeerServiceName/prefixes/MyPeerPrefix\"\ + ,\r\n \"type\": \"Microsoft.Peering/peeringServices/prefixes\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '454' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Oct 2019 04:21:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python/3.6.8 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.8 + msrest_azure/0.4.34 azure-mgmt-peering/0.1.0rc1 Azure-SDK-For-Python + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_peering_test_peeringc05b0c55/providers/Microsoft.Peering/peeringServices/MyPeerServiceName/prefixes/MyPeerPrefix?api-version=2019-09-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 24 Oct 2019 04:21:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - python/3.6.8 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.8 + msrest_azure/0.4.34 azure-mgmt-peering/0.1.0rc1 Azure-SDK-For-Python + accept-language: + - en-US + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test_mgmt_peering_test_peeringc05b0c55/providers/Microsoft.Peering/peeringServices/MyPeerServiceName?api-version=2019-09-01-preview + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Thu, 24 Oct 2019 04:21:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/peering/azure-mgmt-peering/tests/test_mgmt_peering.py b/sdk/peering/azure-mgmt-peering/tests/test_mgmt_peering.py new file mode 100644 index 000000000000..af3c9cad404e --- /dev/null +++ b/sdk/peering/azure-mgmt-peering/tests/test_mgmt_peering.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import unittest + +import azure.mgmt.peering +from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer + +AZURE_LOCATION = 'westus' + +class MgmtPeeringTest(AzureMgmtTestCase): + + def setUp(self): + super(MgmtPeeringTest, self).setUp() + self.mgmt_client = self.create_mgmt_client( + azure.mgmt.peering.PeeringManagementClient + ) + + @ResourceGroupPreparer(location=AZURE_LOCATION) + def test_peering(self, resource_group): + + PEERING_SERVICE_NAME = "MyPeerServiceName" + PREFIX_NAME = "MyPeerPrefix" + PREFIX_VALUE = "192.168.1.0/24" + + BODY = { + "properties": { + "peeringServiceLocation": "California", + "peeringServiceProvider": "Kordia Limited" + }, + "location": "westus" + } + azure_operation_poller = self.mgmt_client.peering_services.create_or_update(resource_group.name, PEERING_SERVICE_NAME, BODY) + self.assertEqual(azure_operation_poller.name, PEERING_SERVICE_NAME) + self.assertEqual(azure_operation_poller.provisioning_state, "Succeeded") + + azure_operation_poller = self.mgmt_client.prefixes.create_or_update(resource_group.name, PEERING_SERVICE_NAME, PREFIX_NAME, prefix=PREFIX_VALUE) + self.assertEqual(azure_operation_poller.prefix, PREFIX_VALUE) + self.assertEqual(azure_operation_poller.provisioning_state, "Succeeded") + + azure_operation_poller = self.mgmt_client.prefixes.delete(resource_group.name, PEERING_SERVICE_NAME, PREFIX_NAME, prefix=PREFIX_VALUE) + + BODY = {} + azure_operation_poller = self.mgmt_client.peering_services.delete(resource_group.name, PEERING_SERVICE_NAME, BODY) + + +#------------------------------------------------------------------------------ +if __name__ == '__main__': + unittest.main()