Skip to content

Commit 8eb85ab

Browse files
authored
Generated from b9c1d4353fbd76618c6f3f73d9d5e0b508b843e5 (#3884)
Add support for list api for global reach connections
1 parent 4b9dcbe commit 8eb85ab

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed

azure-mgmt-network/azure/mgmt/network/v2018_10_01/models/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@
579579
from .endpoint_service_result_paged import EndpointServiceResultPaged
580580
from .express_route_circuit_authorization_paged import ExpressRouteCircuitAuthorizationPaged
581581
from .express_route_circuit_peering_paged import ExpressRouteCircuitPeeringPaged
582+
from .express_route_circuit_connection_paged import ExpressRouteCircuitConnectionPaged
582583
from .express_route_circuit_paged import ExpressRouteCircuitPaged
583584
from .express_route_service_provider_paged import ExpressRouteServiceProviderPaged
584585
from .express_route_cross_connection_paged import ExpressRouteCrossConnectionPaged
@@ -1015,6 +1016,7 @@
10151016
'EndpointServiceResultPaged',
10161017
'ExpressRouteCircuitAuthorizationPaged',
10171018
'ExpressRouteCircuitPeeringPaged',
1019+
'ExpressRouteCircuitConnectionPaged',
10181020
'ExpressRouteCircuitPaged',
10191021
'ExpressRouteServiceProviderPaged',
10201022
'ExpressRouteCrossConnectionPaged',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.paging import Paged
13+
14+
15+
class ExpressRouteCircuitConnectionPaged(Paged):
16+
"""
17+
A paging container for iterating over a list of :class:`ExpressRouteCircuitConnection <azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitConnection>` object
18+
"""
19+
20+
_attribute_map = {
21+
'next_link': {'key': 'nextLink', 'type': 'str'},
22+
'current_page': {'key': 'value', 'type': '[ExpressRouteCircuitConnection]'}
23+
}
24+
25+
def __init__(self, *args, **kwargs):
26+
27+
super(ExpressRouteCircuitConnectionPaged, self).__init__(*args, **kwargs)

azure-mgmt-network/azure/mgmt/network/v2018_10_01/operations/express_route_circuit_connections_operations.py

+74
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,77 @@ def get_long_running_output(response):
315315
else: polling_method = polling
316316
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
317317
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections/{connectionName}'}
318+
319+
def list(
320+
self, resource_group_name, circuit_name, peering_name, custom_headers=None, raw=False, **operation_config):
321+
"""Gets all global reach connections associated with a private peering in
322+
an express route circuit.
323+
324+
:param resource_group_name: The name of the resource group.
325+
:type resource_group_name: str
326+
:param circuit_name: The name of the circuit.
327+
:type circuit_name: str
328+
:param peering_name: The name of the peering.
329+
:type peering_name: str
330+
:param dict custom_headers: headers that will be added to the request
331+
:param bool raw: returns the direct response alongside the
332+
deserialized response
333+
:param operation_config: :ref:`Operation configuration
334+
overrides<msrest:optionsforoperations>`.
335+
:return: An iterator like instance of ExpressRouteCircuitConnection
336+
:rtype:
337+
~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitConnectionPaged[~azure.mgmt.network.v2018_10_01.models.ExpressRouteCircuitConnection]
338+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
339+
"""
340+
def internal_paging(next_link=None, raw=False):
341+
342+
if not next_link:
343+
# Construct URL
344+
url = self.list.metadata['url']
345+
path_format_arguments = {
346+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
347+
'circuitName': self._serialize.url("circuit_name", circuit_name, 'str'),
348+
'peeringName': self._serialize.url("peering_name", peering_name, 'str'),
349+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
350+
}
351+
url = self._client.format_url(url, **path_format_arguments)
352+
353+
# Construct parameters
354+
query_parameters = {}
355+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
356+
357+
else:
358+
url = next_link
359+
query_parameters = {}
360+
361+
# Construct headers
362+
header_parameters = {}
363+
header_parameters['Accept'] = 'application/json'
364+
if self.config.generate_client_request_id:
365+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
366+
if custom_headers:
367+
header_parameters.update(custom_headers)
368+
if self.config.accept_language is not None:
369+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
370+
371+
# Construct and send request
372+
request = self._client.get(url, query_parameters, header_parameters)
373+
response = self._client.send(request, stream=False, **operation_config)
374+
375+
if response.status_code not in [200]:
376+
exp = CloudError(response)
377+
exp.request_id = response.headers.get('x-ms-request-id')
378+
raise exp
379+
380+
return response
381+
382+
# Deserialize response
383+
deserialized = models.ExpressRouteCircuitConnectionPaged(internal_paging, self._deserialize.dependencies)
384+
385+
if raw:
386+
header_dict = {}
387+
client_raw_response = models.ExpressRouteCircuitConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict)
388+
return client_raw_response
389+
390+
return deserialized
391+
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/connections'}

0 commit comments

Comments
 (0)