Skip to content

Commit 557416a

Browse files
author
SDK Automation
committed
Generated from a48cb1477225fd96c3d2a7891c41c68ff61bbbc1
Fixing linting issues
1 parent 1430470 commit 557416a

File tree

5 files changed

+105
-1
lines changed

5 files changed

+105
-1
lines changed

sdk/network/azure-mgmt-network/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is the Microsoft Azure Network Management Client Library.
44
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5-
For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/)
5+
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77

88
# Usage

sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
from ._models_py3 import BastionActiveSessionListResult
9898
from ._models_py3 import BastionHost
9999
from ._models_py3 import BastionHostIPConfiguration
100+
from ._models_py3 import BastionHostListResult
100101
from ._models_py3 import BastionSessionState
101102
from ._models_py3 import BastionShareableLink
102103
from ._models_py3 import BastionShareableLinkListRequest
@@ -507,6 +508,7 @@
507508
from ._models import BastionActiveSessionListResult
508509
from ._models import BastionHost
509510
from ._models import BastionHostIPConfiguration
511+
from ._models import BastionHostListResult
510512
from ._models import BastionSessionState
511513
from ._models import BastionShareableLink
512514
from ._models import BastionShareableLinkListRequest
@@ -1132,6 +1134,7 @@
11321134
'BastionActiveSessionListResult',
11331135
'BastionHost',
11341136
'BastionHostIPConfiguration',
1137+
'BastionHostListResult',
11351138
'BastionSessionState',
11361139
'BastionShareableLink',
11371140
'BastionShareableLinkListRequest',

sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_models.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4066,6 +4066,26 @@ def __init__(self, **kwargs):
40664066
self.type = None
40674067

40684068

4069+
class BastionHostListResult(Model):
4070+
"""Response for ListBastionHosts API service call.
4071+
4072+
:param value: List of Bastion Hosts in a resource group.
4073+
:type value: list[~azure.mgmt.network.v2020_05_01.models.BastionHost]
4074+
:param next_link: URL to get the next set of results.
4075+
:type next_link: str
4076+
"""
4077+
4078+
_attribute_map = {
4079+
'value': {'key': 'value', 'type': '[BastionHost]'},
4080+
'next_link': {'key': 'nextLink', 'type': 'str'},
4081+
}
4082+
4083+
def __init__(self, **kwargs):
4084+
super(BastionHostListResult, self).__init__(**kwargs)
4085+
self.value = kwargs.get('value', None)
4086+
self.next_link = kwargs.get('next_link', None)
4087+
4088+
40694089
class BastionSessionState(Model):
40704090
"""The session state detail for a target.
40714091

sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/models/_models_py3.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4066,6 +4066,26 @@ def __init__(self, *, subnet, public_ip_address, id: str=None, private_ip_alloca
40664066
self.type = None
40674067

40684068

4069+
class BastionHostListResult(Model):
4070+
"""Response for ListBastionHosts API service call.
4071+
4072+
:param value: List of Bastion Hosts in a resource group.
4073+
:type value: list[~azure.mgmt.network.v2020_05_01.models.BastionHost]
4074+
:param next_link: URL to get the next set of results.
4075+
:type next_link: str
4076+
"""
4077+
4078+
_attribute_map = {
4079+
'value': {'key': 'value', 'type': '[BastionHost]'},
4080+
'next_link': {'key': 'nextLink', 'type': 'str'},
4081+
}
4082+
4083+
def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None:
4084+
super(BastionHostListResult, self).__init__(**kwargs)
4085+
self.value = value
4086+
self.next_link = next_link
4087+
4088+
40694089
class BastionSessionState(Model):
40704090
"""The session state detail for a target.
40714091

sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_networks_operations.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,3 +629,64 @@ def internal_paging(next_link=None):
629629

630630
return deserialized
631631
list_usage.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages'}
632+
633+
def get_bastion_hosts(
634+
self, resource_group_name, virtual_network_name, custom_headers=None, raw=False, **operation_config):
635+
"""Get a list of bastion hosts accessible from the given network.
636+
637+
:param resource_group_name: The name of the resource group.
638+
:type resource_group_name: str
639+
:param virtual_network_name: The name of the virtual network.
640+
:type virtual_network_name: str
641+
:param dict custom_headers: headers that will be added to the request
642+
:param bool raw: returns the direct response alongside the
643+
deserialized response
644+
:param operation_config: :ref:`Operation configuration
645+
overrides<msrest:optionsforoperations>`.
646+
:return: BastionHostListResult or ClientRawResponse if raw=true
647+
:rtype: ~azure.mgmt.network.v2020_05_01.models.BastionHostListResult
648+
or ~msrest.pipeline.ClientRawResponse
649+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
650+
"""
651+
# Construct URL
652+
url = self.get_bastion_hosts.metadata['url']
653+
path_format_arguments = {
654+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
655+
'virtualNetworkName': self._serialize.url("virtual_network_name", virtual_network_name, 'str'),
656+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
657+
}
658+
url = self._client.format_url(url, **path_format_arguments)
659+
660+
# Construct parameters
661+
query_parameters = {}
662+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
663+
664+
# Construct headers
665+
header_parameters = {}
666+
header_parameters['Accept'] = 'application/json'
667+
if self.config.generate_client_request_id:
668+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
669+
if custom_headers:
670+
header_parameters.update(custom_headers)
671+
if self.config.accept_language is not None:
672+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
673+
674+
# Construct and send request
675+
request = self._client.get(url, query_parameters, header_parameters)
676+
response = self._client.send(request, stream=False, **operation_config)
677+
678+
if response.status_code not in [200]:
679+
exp = CloudError(response)
680+
exp.request_id = response.headers.get('x-ms-request-id')
681+
raise exp
682+
683+
deserialized = None
684+
if response.status_code == 200:
685+
deserialized = self._deserialize('BastionHostListResult', response)
686+
687+
if raw:
688+
client_raw_response = ClientRawResponse(deserialized, response)
689+
return client_raw_response
690+
691+
return deserialized
692+
get_bastion_hosts.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/bastionHosts'}

0 commit comments

Comments
 (0)