@@ -578,9 +578,26 @@ def get_long_running_output(response):
578578 return LROPoller (self ._client , raw_result , get_long_running_output , polling_method )
579579 delete_private_endpoint_connection .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}' }
580580
581-
582- def _check_private_link_service_visibility_initial (
581+ def check_private_link_service_visibility (
583582 self , location , private_link_service_alias = None , custom_headers = None , raw = False , ** operation_config ):
583+ """Checks the subscription is visible to private link service.
584+
585+ :param location: The location of the domain name.
586+ :type location: str
587+ :param private_link_service_alias: The alias of the private link
588+ service.
589+ :type private_link_service_alias: str
590+ :param dict custom_headers: headers that will be added to the request
591+ :param bool raw: returns the direct response alongside the
592+ deserialized response
593+ :param operation_config: :ref:`Operation configuration
594+ overrides<msrest:optionsforoperations>`.
595+ :return: PrivateLinkServiceVisibility or ClientRawResponse if raw=true
596+ :rtype:
597+ ~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility or
598+ ~msrest.pipeline.ClientRawResponse
599+ :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
600+ """
584601 parameters = models .CheckPrivateLinkServiceVisibilityRequest (private_link_service_alias = private_link_service_alias )
585602
586603 # Construct URL
@@ -613,13 +630,12 @@ def _check_private_link_service_visibility_initial(
613630 request = self ._client .post (url , query_parameters , header_parameters , body_content )
614631 response = self ._client .send (request , stream = False , ** operation_config )
615632
616- if response .status_code not in [200 , 202 ]:
633+ if response .status_code not in [200 ]:
617634 exp = CloudError (response )
618635 exp .request_id = response .headers .get ('x-ms-request-id' )
619636 raise exp
620637
621638 deserialized = None
622-
623639 if response .status_code == 200 :
624640 deserialized = self ._deserialize ('PrivateLinkServiceVisibility' , response )
625641
@@ -628,59 +644,30 @@ def _check_private_link_service_visibility_initial(
628644 return client_raw_response
629645
630646 return deserialized
647+ check_private_link_service_visibility .metadata = {'url' : '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility' }
631648
632- def check_private_link_service_visibility (
633- self , location , private_link_service_alias = None , custom_headers = None , raw = False , polling = True , ** operation_config ):
649+ def check_private_link_service_visibility_by_resource_group (
650+ self , location , resource_group_name , private_link_service_alias = None , custom_headers = None , raw = False , ** operation_config ):
634651 """Checks the subscription is visible to private link service.
635652
636653 :param location: The location of the domain name.
637654 :type location: str
655+ :param resource_group_name: The name of the resource group.
656+ :type resource_group_name: str
638657 :param private_link_service_alias: The alias of the private link
639658 service.
640659 :type private_link_service_alias: str
641660 :param dict custom_headers: headers that will be added to the request
642- :param bool raw: The poller return type is ClientRawResponse, the
643- direct response alongside the deserialized response
644- :param polling: True for ARMPolling, False for no polling, or a
645- polling object for personal polling strategy
646- :return: An instance of LROPoller that returns
647- PrivateLinkServiceVisibility or
648- ClientRawResponse<PrivateLinkServiceVisibility> if raw==True
661+ :param bool raw: returns the direct response alongside the
662+ deserialized response
663+ :param operation_config: :ref:`Operation configuration
664+ overrides<msrest:optionsforoperations>`.
665+ :return: PrivateLinkServiceVisibility or ClientRawResponse if raw=true
649666 :rtype:
650- ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility]
651- or
652- ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility]]
667+ ~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility or
668+ ~msrest.pipeline.ClientRawResponse
653669 :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
654670 """
655- raw_result = self ._check_private_link_service_visibility_initial (
656- location = location ,
657- private_link_service_alias = private_link_service_alias ,
658- custom_headers = custom_headers ,
659- raw = True ,
660- ** operation_config
661- )
662-
663- def get_long_running_output (response ):
664- deserialized = self ._deserialize ('PrivateLinkServiceVisibility' , response )
665-
666- if raw :
667- client_raw_response = ClientRawResponse (deserialized , response )
668- return client_raw_response
669-
670- return deserialized
671-
672- lro_delay = operation_config .get (
673- 'long_running_operation_timeout' ,
674- self .config .long_running_operation_timeout )
675- if polling is True : polling_method = ARMPolling (lro_delay , lro_options = {'final-state-via' : 'location' }, ** operation_config )
676- elif polling is False : polling_method = NoPolling ()
677- else : polling_method = polling
678- return LROPoller (self ._client , raw_result , get_long_running_output , polling_method )
679- check_private_link_service_visibility .metadata = {'url' : '/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility' }
680-
681-
682- def _check_private_link_service_visibility_by_resource_group_initial (
683- self , location , resource_group_name , private_link_service_alias = None , custom_headers = None , raw = False , ** operation_config ):
684671 parameters = models .CheckPrivateLinkServiceVisibilityRequest (private_link_service_alias = private_link_service_alias )
685672
686673 # Construct URL
@@ -714,13 +701,12 @@ def _check_private_link_service_visibility_by_resource_group_initial(
714701 request = self ._client .post (url , query_parameters , header_parameters , body_content )
715702 response = self ._client .send (request , stream = False , ** operation_config )
716703
717- if response .status_code not in [200 , 202 ]:
704+ if response .status_code not in [200 ]:
718705 exp = CloudError (response )
719706 exp .request_id = response .headers .get ('x-ms-request-id' )
720707 raise exp
721708
722709 deserialized = None
723-
724710 if response .status_code == 200 :
725711 deserialized = self ._deserialize ('PrivateLinkServiceVisibility' , response )
726712
@@ -729,57 +715,6 @@ def _check_private_link_service_visibility_by_resource_group_initial(
729715 return client_raw_response
730716
731717 return deserialized
732-
733- def check_private_link_service_visibility_by_resource_group (
734- self , location , resource_group_name , private_link_service_alias = None , custom_headers = None , raw = False , polling = True , ** operation_config ):
735- """Checks the subscription is visible to private link service.
736-
737- :param location: The location of the domain name.
738- :type location: str
739- :param resource_group_name: The name of the resource group.
740- :type resource_group_name: str
741- :param private_link_service_alias: The alias of the private link
742- service.
743- :type private_link_service_alias: str
744- :param dict custom_headers: headers that will be added to the request
745- :param bool raw: The poller return type is ClientRawResponse, the
746- direct response alongside the deserialized response
747- :param polling: True for ARMPolling, False for no polling, or a
748- polling object for personal polling strategy
749- :return: An instance of LROPoller that returns
750- PrivateLinkServiceVisibility or
751- ClientRawResponse<PrivateLinkServiceVisibility> if raw==True
752- :rtype:
753- ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility]
754- or
755- ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2019_04_01.models.PrivateLinkServiceVisibility]]
756- :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
757- """
758- raw_result = self ._check_private_link_service_visibility_by_resource_group_initial (
759- location = location ,
760- resource_group_name = resource_group_name ,
761- private_link_service_alias = private_link_service_alias ,
762- custom_headers = custom_headers ,
763- raw = True ,
764- ** operation_config
765- )
766-
767- def get_long_running_output (response ):
768- deserialized = self ._deserialize ('PrivateLinkServiceVisibility' , response )
769-
770- if raw :
771- client_raw_response = ClientRawResponse (deserialized , response )
772- return client_raw_response
773-
774- return deserialized
775-
776- lro_delay = operation_config .get (
777- 'long_running_operation_timeout' ,
778- self .config .long_running_operation_timeout )
779- if polling is True : polling_method = ARMPolling (lro_delay , lro_options = {'final-state-via' : 'location' }, ** operation_config )
780- elif polling is False : polling_method = NoPolling ()
781- else : polling_method = polling
782- return LROPoller (self ._client , raw_result , get_long_running_output , polling_method )
783718 check_private_link_service_visibility_by_resource_group .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/locations/{location}/checkPrivateLinkServiceVisibility' }
784719
785720 def list_auto_approved_private_link_services (
0 commit comments