Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-mgmt-network] Added O365Policy to VpnSite resource. #1620

Open
wants to merge 2 commits into
base: sdkAutomation/azure-mgmt-network
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,26 @@ def get_long_running_output(response):
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
delete_private_endpoint_connection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}'}


def _check_private_link_service_visibility_initial(
def check_private_link_service_visibility(
self, location, private_link_service_alias=None, custom_headers=None, raw=False, **operation_config):
"""Checks the subscription is visible to private link service.

:param location: The location of the domain name.
:type location: str
:param private_link_service_alias: The alias of the private link
service.
:type private_link_service_alias: 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<msrest:optionsforoperations>`.
:return: PrivateLinkServiceVisibility or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
parameters = models.CheckPrivateLinkServiceVisibilityRequest(private_link_service_alias=private_link_service_alias)

# Construct URL
Expand Down Expand Up @@ -613,13 +630,12 @@ def _check_private_link_service_visibility_initial(
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 202]:
if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('PrivateLinkServiceVisibility', response)

Expand All @@ -628,59 +644,30 @@ def _check_private_link_service_visibility_initial(
return client_raw_response

return deserialized
check_private_link_service_visibility.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'}

def check_private_link_service_visibility(
self, location, private_link_service_alias=None, custom_headers=None, raw=False, polling=True, **operation_config):
def check_private_link_service_visibility_by_resource_group(
self, location, resource_group_name, private_link_service_alias=None, custom_headers=None, raw=False, **operation_config):
"""Checks the subscription is visible to private link service.

:param location: The location of the domain name.
:type location: str
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param private_link_service_alias: The alias of the private link
service.
:type private_link_service_alias: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns
PrivateLinkServiceVisibility or
ClientRawResponse<PrivateLinkServiceVisibility> if raw==True
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: PrivateLinkServiceVisibility or ClientRawResponse if raw=true
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility]]
~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._check_private_link_service_visibility_initial(
location=location,
private_link_service_alias=private_link_service_alias,
custom_headers=custom_headers,
raw=True,
**operation_config
)

def get_long_running_output(response):
deserialized = self._deserialize('PrivateLinkServiceVisibility', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
check_private_link_service_visibility.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'}


def _check_private_link_service_visibility_by_resource_group_initial(
self, location, resource_group_name, private_link_service_alias=None, custom_headers=None, raw=False, **operation_config):
parameters = models.CheckPrivateLinkServiceVisibilityRequest(private_link_service_alias=private_link_service_alias)

# Construct URL
Expand Down Expand Up @@ -714,13 +701,12 @@ def _check_private_link_service_visibility_by_resource_group_initial(
request = self._client.post(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 202]:
if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

deserialized = None

if response.status_code == 200:
deserialized = self._deserialize('PrivateLinkServiceVisibility', response)

Expand All @@ -729,57 +715,6 @@ def _check_private_link_service_visibility_by_resource_group_initial(
return client_raw_response

return deserialized

def check_private_link_service_visibility_by_resource_group(
self, location, resource_group_name, private_link_service_alias=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Checks the subscription is visible to private link service.

:param location: The location of the domain name.
:type location: str
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param private_link_service_alias: The alias of the private link
service.
:type private_link_service_alias: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns
PrivateLinkServiceVisibility or
ClientRawResponse<PrivateLinkServiceVisibility> if raw==True
:rtype:
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._check_private_link_service_visibility_by_resource_group_initial(
location=location,
resource_group_name=resource_group_name,
private_link_service_alias=private_link_service_alias,
custom_headers=custom_headers,
raw=True,
**operation_config
)

def get_long_running_output(response):
deserialized = self._deserialize('PrivateLinkServiceVisibility', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response

return deserialized

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
check_private_link_service_visibility_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility'}

def list_auto_approved_private_link_services(
Expand Down
Loading