Exemple #1
0
    def begin_create(
        self,
        resource_group_name,  # type: str
        account_name,  # type: str
        parameters,  # type: "_models.StorageAccountCreateParameters"
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.StorageAccount"]
        """Asynchronously creates a new storage account with the specified parameters. If an account is
        already created and a subsequent create request is issued with different properties, the
        account properties will be updated. If an account is already created and a subsequent create or
        update request is issued with the exact same set of properties, the request will succeed.

        :param resource_group_name: The name of the resource group within the user's subscription. The
         name is case insensitive.
        :type resource_group_name: str
        :param account_name: The name of the storage account within the specified resource group.
         Storage account names must be between 3 and 24 characters in length and use numbers and lower-
         case letters only.
        :type account_name: str
        :param parameters: The parameters to provide for the created account.
        :type parameters: ~azure.mgmt.storage.v2015_06_15.models.StorageAccountCreateParameters
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: Pass in True if you'd like the ARMPolling polling method,
         False for no polling, or your own initialized polling object for a personal polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either StorageAccount or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.storage.v2015_06_15.models.StorageAccount]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls',
                         None)  # type: ClsType["_models.StorageAccount"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._create_initial(
                resource_group_name=resource_group_name,
                account_name=account_name,
                parameters=parameters,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('StorageAccount',
                                             pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'resourceGroupName':
            self._serialize.url("resource_group_name",
                                resource_group_name,
                                'str',
                                max_length=90,
                                min_length=1,
                                pattern=r'^[-\w\._\(\)]+$'),
            'accountName':
            self._serialize.url("account_name",
                                account_name,
                                'str',
                                max_length=24,
                                min_length=3),
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_download(
        self,
        resource_group_name,  # type: str
        virtual_wan_name,  # type: str
        request,  # type: "_models.GetVpnSitesConfigurationRequest"
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller[None]
        """Gives the sas-url to download the configurations for vpn-sites in a resource group.

        :param resource_group_name: The resource group name.
        :type resource_group_name: str
        :param virtual_wan_name: The name of the VirtualWAN for which configuration of all vpn-sites is
         needed.
        :type virtual_wan_name: str
        :param request: Parameters supplied to download vpn-sites configuration.
        :type request: ~azure.mgmt.network.v2018_10_01.models.GetVpnSitesConfigurationRequest
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling.
         Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either None or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[None]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling', True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._download_initial(
                resource_group_name=resource_group_name,
                virtual_wan_name=virtual_wan_name,
                request=request,
                cls=lambda x,y,z: x,
                **kwargs
            )

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            if cls:
                return cls(pipeline_response, None, {})

        path_format_arguments = {
            'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
            'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
            'virtualWANName': self._serialize.url("virtual_wan_name", virtual_wan_name, 'str'),
        }

        if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments,  **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
    def begin_delete(
        self,
        resource_group_name,  # type: str
        workspace_name,  # type: str
        compute_name,  # type: str
        underlying_resource_action,  # type: Union[str, "_models.UnderlyingResourceAction"]
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller[None]
        """Deletes specified Machine Learning compute.

        :param resource_group_name: Name of the resource group in which workspace is located.
        :type resource_group_name: str
        :param workspace_name: Name of Azure Machine Learning workspace.
        :type workspace_name: str
        :param compute_name: Name of the Azure Machine Learning compute.
        :type compute_name: str
        :param underlying_resource_action: Delete the underlying compute if 'Delete', or detach the
         underlying compute from workspace if 'Detach'.
        :type underlying_resource_action: str or ~azure.mgmt.machinelearningservices.models.UnderlyingResourceAction
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either None or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[None]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling', True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._delete_initial(
                resource_group_name=resource_group_name,
                workspace_name=workspace_name,
                compute_name=compute_name,
                underlying_resource_action=underlying_resource_action,
                cls=lambda x,y,z: x,
                **kwargs
            )

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            if cls:
                return cls(pipeline_response, None, {})

        path_format_arguments = {
            'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
            'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
            'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'),
            'computeName': self._serialize.url("compute_name", compute_name, 'str'),
        }

        if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments,  **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
Exemple #4
0
    def begin_delete(
        self,
        resource_group_name,  # type: str
        route_table_name,  # type: str
        route_name,  # type: str
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller
        """Deletes the specified route from a route table.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param route_table_name: The name of the route table.
        :type route_table_name: str
        :param route_name: The name of the route.
        :type route_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either None or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[None]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling', True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._delete_initial(
                resource_group_name=resource_group_name,
                route_table_name=route_table_name,
                route_name=route_name,
                cls=lambda x,y,z: x,
                **kwargs
            )

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            if cls:
                return cls(pipeline_response, None, {})

        if polling is True: polling_method = ARMPolling(lro_delay,  **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
Exemple #5
0
    def begin_update(
            self, resource_group_name: str, vm_name: str,
            vm_extension_name: str,
            extension_parameters: "_models.VirtualMachineExtensionUpdate",
            **kwargs: Any) -> LROPoller["_models.VirtualMachineExtension"]:
        """The operation to update the extension.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param vm_name: The name of the virtual machine where the extension should be updated.
        :type vm_name: str
        :param vm_extension_name: The name of the virtual machine extension.
        :type vm_extension_name: str
        :param extension_parameters: Parameters supplied to the Update Virtual Machine Extension
         operation.
        :type extension_parameters:
         ~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtensionUpdate
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
         operation to not poll, or pass in your own initialized polling object for a personal polling
         strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of LROPoller that returns either VirtualMachineExtension or the result of
         cls(response)
        :rtype:
         ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2018_06_01.models.VirtualMachineExtension]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        content_type = kwargs.pop('content_type',
                                  "application/json")  # type: Optional[str]
        polling = kwargs.pop(
            'polling',
            True)  # type: Union[bool, azure.core.polling.PollingMethod]
        cls = kwargs.pop(
            'cls', None)  # type: ClsType["_models.VirtualMachineExtension"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._update_initial(
                resource_group_name=resource_group_name,
                vm_name=vm_name,
                vm_extension_name=vm_extension_name,
                extension_parameters=extension_parameters,
                content_type=content_type,
                cls=lambda x, y, z: x,
                **kwargs)
        kwargs.pop('error_map', None)

        def get_long_running_output(pipeline_response):
            response = pipeline_response.http_response
            deserialized = self._deserialize('VirtualMachineExtension',
                                             pipeline_response)
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_update(self, resource_group_name: str, account_name: str,
                     body: "_models.NetAppAccountPatch",
                     **kwargs: Any) -> LROPoller["_models.NetAppAccount"]:
        """Update a NetApp account.

        Patch the specified NetApp account.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param account_name: The name of the NetApp account.
        :type account_name: str
        :param body: NetApp Account object supplied in the body of the operation.
        :type body: ~azure.mgmt.netapp.models.NetAppAccountPatch
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
         operation to not poll, or pass in your own initialized polling object for a personal polling
         strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of LROPoller that returns either NetAppAccount or the result of
         cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.NetAppAccount]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        content_type = kwargs.pop('content_type',
                                  "application/json")  # type: Optional[str]
        polling = kwargs.pop(
            'polling',
            True)  # type: Union[bool, azure.core.polling.PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.NetAppAccount"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._update_initial(
                resource_group_name=resource_group_name,
                account_name=account_name,
                body=body,
                content_type=content_type,
                cls=lambda x, y, z: x,
                **kwargs)
        kwargs.pop('error_map', None)

        def get_long_running_output(pipeline_response):
            response = pipeline_response.http_response
            deserialized = self._deserialize('NetAppAccount',
                                             pipeline_response)
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                lro_options={'final-state-via': 'location'},
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_execute_command(
        self,
        request,  # type: "_models.DataFlowDebugCommandRequest"
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.DataFlowDebugCommandResponse"]
        """Execute a data flow debug command.

        :param request: Data flow debug command definition.
        :type request: ~azure.synapse.artifacts.models.DataFlowDebugCommandRequest
        :keyword api_version: Api Version. The default value is "2020-12-01". Note that overriding this
         default value may result in unsupported behavior.
        :paramtype api_version: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be LROBasePolling. Pass in False for
         this operation to not poll, or pass in your own initialized polling object for a personal
         polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of LROPoller that returns either DataFlowDebugCommandResponse or the
         result of cls(response)
        :rtype:
         ~azure.core.polling.LROPoller[~azure.synapse.artifacts.models.DataFlowDebugCommandResponse]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = kwargs.pop('api_version', "2020-12-01")  # type: str
        content_type = kwargs.pop('content_type', "application/json")  # type: Optional[str]
        polling = kwargs.pop('polling', True)  # type: Union[bool, azure.core.polling.PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.DataFlowDebugCommandResponse"]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._execute_command_initial(
                request=request,
                api_version=api_version,
                content_type=content_type,
                cls=lambda x,y,z: x,
                **kwargs
            )
        kwargs.pop('error_map', None)

        def get_long_running_output(pipeline_response):
            response = pipeline_response.http_response
            deserialized = self._deserialize('DataFlowDebugCommandResponse', pipeline_response)
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized


        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
        }

        if polling is True: polling_method = LROBasePolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
Exemple #8
0
    def begin_create(
        self,
        resource_group_name,  # type: str
        workspace_name,  # type: str
        sql_pool_name,  # type: str
        parameters,  # type: "_models.CreateSqlPoolRestorePointDefinition"
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.RestorePoint"]
        """Creates a restore point for a data warehouse.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
        :type resource_group_name: str
        :param workspace_name: The name of the workspace.
        :type workspace_name: str
        :param sql_pool_name: SQL pool name.
        :type sql_pool_name: str
        :param parameters: The definition for creating the restore point of this Sql pool.
        :type parameters: ~azure.mgmt.synapse.models.CreateSqlPoolRestorePointDefinition
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling.
         Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either RestorePoint or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.synapse.models.RestorePoint]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.RestorePoint"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._create_initial(
                resource_group_name=resource_group_name,
                workspace_name=workspace_name,
                sql_pool_name=sql_pool_name,
                parameters=parameters,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('RestorePoint', pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id,
                                'str',
                                min_length=1),
            'resourceGroupName':
            self._serialize.url("resource_group_name",
                                resource_group_name,
                                'str',
                                max_length=90,
                                min_length=1),
            'workspaceName':
            self._serialize.url("workspace_name", workspace_name, 'str'),
            'sqlPoolName':
            self._serialize.url("sql_pool_name", sql_pool_name, 'str'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                lro_options={'final-state-via': 'location'},
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_create(
            self, alias_name: str, body: "_models.PutAliasRequest",
            **kwargs: Any) -> LROPoller["_models.SubscriptionAliasResponse"]:
        """Create Alias Subscription.

        :param alias_name: AliasName is the name for the subscription creation request. Note that this
         is not the same as subscription name and this doesn’t have any other lifecycle need beyond the
         request for subscription creation.
        :type alias_name: str
        :param body:
        :type body: ~azure.mgmt.subscription.models.PutAliasRequest
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
         operation to not poll, or pass in your own initialized polling object for a personal polling
         strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of LROPoller that returns either SubscriptionAliasResponse or the result
         of cls(response)
        :rtype:
         ~azure.core.polling.LROPoller[~azure.mgmt.subscription.models.SubscriptionAliasResponse]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        content_type = kwargs.pop('content_type',
                                  "application/json")  # type: Optional[str]
        polling = kwargs.pop(
            'polling',
            True)  # type: Union[bool, azure.core.polling.PollingMethod]
        cls = kwargs.pop(
            'cls', None)  # type: ClsType["_models.SubscriptionAliasResponse"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._create_initial(alias_name=alias_name,
                                              body=body,
                                              content_type=content_type,
                                              cls=lambda x, y, z: x,
                                              **kwargs)
        kwargs.pop('error_map', None)

        def get_long_running_output(pipeline_response):
            response = pipeline_response.http_response
            deserialized = self._deserialize('SubscriptionAliasResponse',
                                             pipeline_response)
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_update(self, resource_group_name: str, disk_access_name: str,
                     disk_access: "_models.DiskAccessUpdate",
                     **kwargs: Any) -> LROPoller["_models.DiskAccess"]:
        """Updates (patches) a disk access resource.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param disk_access_name: The name of the disk access resource that is being created. The name
         can't be changed after the disk encryption set is created. Supported characters for the name
         are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
        :type disk_access_name: str
        :param disk_access: disk access object supplied in the body of the Patch disk access operation.
        :type disk_access: ~azure.mgmt.compute.v2020_06_30.models.DiskAccessUpdate
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
         operation to not poll, or pass in your own initialized polling object for a personal polling
         strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of LROPoller that returns either DiskAccess or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2020_06_30.models.DiskAccess]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        api_version = kwargs.pop('api_version', "2020-06-30")  # type: str
        content_type = kwargs.pop('content_type',
                                  "application/json")  # type: Optional[str]
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.DiskAccess"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._update_initial(
                resource_group_name=resource_group_name,
                disk_access_name=disk_access_name,
                disk_access=disk_access,
                api_version=api_version,
                content_type=content_type,
                cls=lambda x, y, z: x,
                **kwargs)
        kwargs.pop('error_map', None)

        def get_long_running_output(pipeline_response):
            response = pipeline_response.http_response
            deserialized = self._deserialize('DiskAccess', pipeline_response)
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        return LROPoller(self._client, raw_result, get_long_running_output,
                         polling_method)
    def begin_batch_update(
        self,
        resource_group_name: str,
        server_name: str,
        parameters: "_models.ConfigurationListForBatchUpdate",
        **kwargs: Any
    ) -> LROPoller["_models.ConfigurationListResult"]:
        """Update a list of configurations in a given server.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
        :type resource_group_name: str
        :param server_name: The name of the server.
        :type server_name: str
        :param parameters: The parameters for updating a list of server configuration.
        :type parameters:
         ~azure.mgmt.rdbms.mysql_flexibleservers.models.ConfigurationListForBatchUpdate
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
         operation to not poll, or pass in your own initialized polling object for a personal polling
         strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of LROPoller that returns either ConfigurationListResult or the result of
         cls(response)
        :rtype:
         ~azure.core.polling.LROPoller[~azure.mgmt.rdbms.mysql_flexibleservers.models.ConfigurationListResult]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        content_type = kwargs.pop('content_type', "application/json")  # type: Optional[str]
        polling = kwargs.pop('polling', True)  # type: Union[bool, azure.core.polling.PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.ConfigurationListResult"]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._batch_update_initial(
                resource_group_name=resource_group_name,
                server_name=server_name,
                parameters=parameters,
                content_type=content_type,
                cls=lambda x,y,z: x,
                **kwargs
            )
        kwargs.pop('error_map', None)

        def get_long_running_output(pipeline_response):
            response = pipeline_response.http_response
            deserialized = self._deserialize('ConfigurationListResult', pipeline_response)
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized


        if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
    def begin_update(
        self,
        resource_group_name,  # type: str
        managed_instance_name,  # type: str
        restorable_dropped_database_id,  # type: str
        policy_name,  # type: Union[str, "models.ManagedShortTermRetentionPolicyName"]
        parameters,  # type: "models.ManagedBackupShortTermRetentionPolicy"
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["models.ManagedBackupShortTermRetentionPolicy"]
        """Sets a database's long term retention policy.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param managed_instance_name: The name of the managed instance.
        :type managed_instance_name: str
        :param restorable_dropped_database_id:
        :type restorable_dropped_database_id: str
        :param policy_name: The policy name. Should always be "default".
        :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName
        :param parameters: The long term retention policy info.
        :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either ManagedBackupShortTermRetentionPolicy or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling', True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["models.ManagedBackupShortTermRetentionPolicy"]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._update_initial(
                resource_group_name=resource_group_name,
                managed_instance_name=managed_instance_name,
                restorable_dropped_database_id=restorable_dropped_database_id,
                policy_name=policy_name,
                parameters=parameters,
                cls=lambda x,y,z: x,
                **kwargs
            )

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('ManagedBackupShortTermRetentionPolicy', pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True: polling_method = ARMPolling(lro_delay,  **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
    def begin_delete(
        self,
        resource_group_name,  # type: str
        account_name,  # type: str
        share_subscription_name,  # type: str
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.OperationResponse"]
        """Delete shareSubscription in an account.

        Delete a shareSubscription in an account.

        :param resource_group_name: The resource group name.
        :type resource_group_name: str
        :param account_name: The name of the share account.
        :type account_name: str
        :param share_subscription_name: The name of the shareSubscription.
        :type share_subscription_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either OperationResponse or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.datashare.models.OperationResponse]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling', True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.OperationResponse"]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._delete_initial(
                resource_group_name=resource_group_name,
                account_name=account_name,
                share_subscription_name=share_subscription_name,
                cls=lambda x,y,z: x,
                **kwargs
            )

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('OperationResponse', pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
            'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
            'accountName': self._serialize.url("account_name", account_name, 'str'),
            'shareSubscriptionName': self._serialize.url("share_subscription_name", share_subscription_name, 'str'),
        }

        if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments,  **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
    def begin_update(
            self,
            resource_group_name,  # type: str
            registry_name,  # type: str
            task_run_name,  # type: str
            update_parameters,  # type: "models.TaskRunUpdateParameters"
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["models.TaskRun"]
        """Updates a task run with the specified parameters.

        :param resource_group_name: The name of the resource group to which the container registry
         belongs.
        :type resource_group_name: str
        :param registry_name: The name of the container registry.
        :type registry_name: str
        :param task_run_name: The name of the task run.
        :type task_run_name: str
        :param update_parameters: The parameters for updating a task run.
        :type update_parameters: ~azure.mgmt.containerregistry.v2019_12_01_preview.models.TaskRunUpdateParameters
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either TaskRun or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerregistry.v2019_12_01_preview.models.TaskRun]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["models.TaskRun"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._update_initial(
                resource_group_name=resource_group_name,
                registry_name=registry_name,
                task_run_name=task_run_name,
                update_parameters=update_parameters,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('TaskRun', pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_update(
            self,
            resource_group_name,  # type: str
            account_name,  # type: str
            pool_name,  # type: str
            body,  # type: "_models.CapacityPoolPatch"
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.CapacityPool"]
        """Update a capacity pool.

        Patch the specified capacity pool.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param account_name: The name of the NetApp account.
        :type account_name: str
        :param pool_name: The name of the capacity pool.
        :type pool_name: str
        :param body: Capacity pool object supplied in the body of the operation.
        :type body: ~azure.mgmt.netapp.models.CapacityPoolPatch
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling.
         Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either CapacityPool or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.netapp.models.CapacityPool]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.CapacityPool"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._update_initial(
                resource_group_name=resource_group_name,
                account_name=account_name,
                pool_name=pool_name,
                body=body,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('CapacityPool', pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
            'resourceGroupName':
            self._serialize.url("resource_group_name",
                                resource_group_name,
                                'str',
                                max_length=90,
                                min_length=1,
                                pattern=r'^[-\w\._\(\)]+$'),
            'accountName':
            self._serialize.url("account_name", account_name, 'str'),
            'poolName':
            self._serialize.url("pool_name",
                                pool_name,
                                'str',
                                max_length=64,
                                min_length=1,
                                pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                lro_options={'final-state-via': 'location'},
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
Exemple #16
0
    def begin_delete(
            self,
            resource_group_name,  # type: str
            resource_name,  # type: str
            private_endpoint_connection_name,  # type: str
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller[None]
        """Deletes a private endpoint connection.

        Deletes the private endpoint connection in the specified managed cluster.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param resource_name: The name of the managed cluster resource.
        :type resource_name: str
        :param private_endpoint_connection_name: The name of the private endpoint connection.
        :type private_endpoint_connection_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either None or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[None]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._delete_initial(
                resource_group_name=resource_group_name,
                resource_name=resource_name,
                private_endpoint_connection_name=
                private_endpoint_connection_name,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            if cls:
                return cls(pipeline_response, None, {})

        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
            'resourceGroupName':
            self._serialize.url("resource_group_name",
                                resource_group_name,
                                'str',
                                min_length=1),
            'resourceName':
            self._serialize.url(
                "resource_name",
                resource_name,
                'str',
                max_length=63,
                min_length=1,
                pattern=
                r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'),
            'privateEndpointConnectionName':
            self._serialize.url("private_endpoint_connection_name",
                                private_endpoint_connection_name, 'str'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_create_or_update(
        self,
        resource_group_name,  # type: str
        route_table_name,  # type: str
        parameters,  # type: "_models.RouteTable"
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.RouteTable"]
        """Create or updates a route table in a specified resource group.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param route_table_name: The name of the route table.
        :type route_table_name: str
        :param parameters: Parameters supplied to the create or update route table operation.
        :type parameters: ~azure.mgmt.network.v2019_04_01.models.RouteTable
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling.
         Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either RouteTable or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2019_04_01.models.RouteTable]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling', True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.RouteTable"]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._create_or_update_initial(
                resource_group_name=resource_group_name,
                route_table_name=route_table_name,
                parameters=parameters,
                cls=lambda x,y,z: x,
                **kwargs
            )

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('RouteTable', pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
            'routeTableName': self._serialize.url("route_table_name", route_table_name, 'str'),
            'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
        }

        if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments,  **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
    def begin_restore_files(self, resource_group_name: str, account_name: str,
                            pool_name: str, volume_name: str,
                            snapshot_name: str,
                            body: "_models.SnapshotRestoreFiles",
                            **kwargs: Any) -> LROPoller[None]:
        """Create a new Snapshot Restore Files request.

        Restore the specified files from the specified snapshot to the active filesystem.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param account_name: The name of the NetApp account.
        :type account_name: str
        :param pool_name: The name of the capacity pool.
        :type pool_name: str
        :param volume_name: The name of the volume.
        :type volume_name: str
        :param snapshot_name: The name of the snapshot.
        :type snapshot_name: str
        :param body: Restore payload supplied in the body of the operation.
        :type body: ~azure.mgmt.netapp.models.SnapshotRestoreFiles
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
         operation to not poll, or pass in your own initialized polling object for a personal polling
         strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of LROPoller that returns either None or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[None]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        content_type = kwargs.pop('content_type',
                                  "application/json")  # type: Optional[str]
        polling = kwargs.pop(
            'polling',
            True)  # type: Union[bool, azure.core.polling.PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._restore_files_initial(
                resource_group_name=resource_group_name,
                account_name=account_name,
                pool_name=pool_name,
                volume_name=volume_name,
                snapshot_name=snapshot_name,
                body=body,
                content_type=content_type,
                cls=lambda x, y, z: x,
                **kwargs)
        kwargs.pop('error_map', None)

        def get_long_running_output(pipeline_response):
            if cls:
                return cls(pipeline_response, None, {})

        if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
Exemple #19
0
    def begin_query(
        self,
        resource_group_name,  # type: str
        network_watcher_name,  # type: str
        connection_monitor_name,  # type: str
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller
        """Query a snapshot of the most recent connection states.

        :param resource_group_name: The name of the resource group containing Network Watcher.
        :type resource_group_name: str
        :param network_watcher_name: The name of the Network Watcher resource.
        :type network_watcher_name: str
        :param connection_monitor_name: The name given to the connection monitor.
        :type connection_monitor_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either ConnectionMonitorQueryResult or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2019_06_01.models.ConnectionMonitorQueryResult]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling', True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["models.ConnectionMonitorQueryResult"]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._query_initial(
                resource_group_name=resource_group_name,
                network_watcher_name=network_watcher_name,
                connection_monitor_name=connection_monitor_name,
                cls=lambda x,y,z: x,
                **kwargs
            )

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('ConnectionMonitorQueryResult', pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'},  **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
    def begin_initiate_scan(
        self,
        resource_group_name,  # type: str
        server_name,  # type: str
        database_name,  # type: str
        vulnerability_assessment_name,  # type: Union[str, "models.VulnerabilityAssessmentName"]
        scan_id,  # type: str
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller[None]
        """Executes a Vulnerability Assessment database scan.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param server_name: The name of the server.
        :type server_name: str
        :param database_name: The name of the database.
        :type database_name: str
        :param vulnerability_assessment_name: The name of the vulnerability assessment.
        :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName
        :param scan_id: The vulnerability assessment scan Id of the scan to retrieve.
        :type scan_id: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either None or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[None]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling', True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._initiate_scan_initial(
                resource_group_name=resource_group_name,
                server_name=server_name,
                database_name=database_name,
                vulnerability_assessment_name=vulnerability_assessment_name,
                scan_id=scan_id,
                cls=lambda x,y,z: x,
                **kwargs
            )

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            if cls:
                return cls(pipeline_response, None, {})

        if polling is True: polling_method = ARMPolling(lro_delay,  **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
    def begin_delete(
            self,
            resource_group_name,  # type: str
            account_name,  # type: str
            backup_policy_name,  # type: str
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller[None]
        """Delete a backup policy.

        Delete backup policy.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param account_name: The name of the NetApp account.
        :type account_name: str
        :param backup_policy_name: Backup policy Name which uniquely identify backup policy.
        :type backup_policy_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling.
         Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either None or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[None]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._delete_initial(
                resource_group_name=resource_group_name,
                account_name=account_name,
                backup_policy_name=backup_policy_name,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            if cls:
                return cls(pipeline_response, None, {})

        path_format_arguments = {
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
            'resourceGroupName':
            self._serialize.url("resource_group_name",
                                resource_group_name,
                                'str',
                                max_length=90,
                                min_length=1,
                                pattern=r'^[-\w\._\(\)]+$'),
            'accountName':
            self._serialize.url("account_name", account_name, 'str'),
            'backupPolicyName':
            self._serialize.url("backup_policy_name", backup_policy_name,
                                'str'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                lro_options={'final-state-via': 'location'},
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
Exemple #22
0
    def begin_create_or_update(
            self,
            resource_group_name,  # type: str
            express_route_gateway_name,  # type: str
            connection_name,  # type: str
            put_express_route_connection_parameters,  # type: "_models.ExpressRouteConnection"
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.ExpressRouteConnection"]
        """Creates a connection between an ExpressRoute gateway and an ExpressRoute circuit.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param express_route_gateway_name: The name of the ExpressRoute gateway.
        :type express_route_gateway_name: str
        :param connection_name: The name of the connection subresource.
        :type connection_name: str
        :param put_express_route_connection_parameters: Parameters required in an
         ExpressRouteConnection PUT operation.
        :type put_express_route_connection_parameters: ~azure.mgmt.network.v2019_02_01.models.ExpressRouteConnection
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: Pass in True if you'd like the ARMPolling polling method,
         False for no polling, or your own initialized polling object for a personal polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either ExpressRouteConnection or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2019_02_01.models.ExpressRouteConnection]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop(
            'cls', None)  # type: ClsType["_models.ExpressRouteConnection"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._create_or_update_initial(
                resource_group_name=resource_group_name,
                express_route_gateway_name=express_route_gateway_name,
                connection_name=connection_name,
                put_express_route_connection_parameters=
                put_express_route_connection_parameters,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('ExpressRouteConnection',
                                             pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'resourceGroupName':
            self._serialize.url("resource_group_name", resource_group_name,
                                'str'),
            'expressRouteGatewayName':
            self._serialize.url("express_route_gateway_name",
                                express_route_gateway_name, 'str'),
            'connectionName':
            self._serialize.url("connection_name", connection_name, 'str'),
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                lro_options={'final-state-via': 'azure-async-operation'},
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
Exemple #23
0
    def begin_create_or_update(
            self,
            resource_group_name,  # type: str
            network_security_group_name,  # type: str
            security_rule_name,  # type: str
            security_rule_parameters,  # type: "models.SecurityRule"
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["models.SecurityRule"]
        """Creates or updates a security rule in the specified network security group.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param network_security_group_name: The name of the network security group.
        :type network_security_group_name: str
        :param security_rule_name: The name of the security rule.
        :type security_rule_name: str
        :param security_rule_parameters: Parameters supplied to the create or update network security
         rule operation.
        :type security_rule_parameters: ~azure.mgmt.network.v2018_10_01.models.SecurityRule
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either SecurityRule or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2018_10_01.models.SecurityRule]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["models.SecurityRule"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._create_or_update_initial(
                resource_group_name=resource_group_name,
                network_security_group_name=network_security_group_name,
                security_rule_name=security_rule_name,
                security_rule_parameters=security_rule_parameters,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('SecurityRule', pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_create_or_update(
            self,
            resource_group_name,  # type: str
            managed_instance_name,  # type: str
            administrator_name,  # type: Union[str, "_models.AdministratorName"]
            parameters,  # type: "_models.ManagedInstanceAdministrator"
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.ManagedInstanceAdministrator"]
        """Creates or updates a managed instance administrator.

        :param resource_group_name: The name of the resource group that contains the resource. You can
         obtain this value from the Azure Resource Manager API or the portal.
        :type resource_group_name: str
        :param managed_instance_name: The name of the managed instance.
        :type managed_instance_name: str
        :param administrator_name:
        :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName
        :param parameters: The requested administrator parameters.
        :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdministrator
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: Pass in True if you'd like the ARMPolling polling method,
         False for no polling, or your own initialized polling object for a personal polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either ManagedInstanceAdministrator or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop(
            'cls',
            None)  # type: ClsType["_models.ManagedInstanceAdministrator"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._create_or_update_initial(
                resource_group_name=resource_group_name,
                managed_instance_name=managed_instance_name,
                administrator_name=administrator_name,
                parameters=parameters,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('ManagedInstanceAdministrator',
                                             pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'resourceGroupName':
            self._serialize.url("resource_group_name", resource_group_name,
                                'str'),
            'managedInstanceName':
            self._serialize.url("managed_instance_name", managed_instance_name,
                                'str'),
            'administratorName':
            self._serialize.url("administrator_name", administrator_name,
                                'str'),
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
Exemple #25
0
    def begin_update_tags(
            self,
            resource_group_name,  # type: str
            local_network_gateway_name,  # type: str
            parameters,  # type: "_models.TagsObject"
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.LocalNetworkGateway"]
        """Updates a local network gateway tags.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param local_network_gateway_name: The name of the local network gateway.
        :type local_network_gateway_name: str
        :param parameters: Parameters supplied to update local network gateway tags.
        :type parameters: ~azure.mgmt.network.v2018_12_01.models.TagsObject
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either LocalNetworkGateway or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2018_12_01.models.LocalNetworkGateway]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls',
                         None)  # type: ClsType["_models.LocalNetworkGateway"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._update_tags_initial(
                resource_group_name=resource_group_name,
                local_network_gateway_name=local_network_gateway_name,
                parameters=parameters,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('LocalNetworkGateway',
                                             pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'resourceGroupName':
            self._serialize.url("resource_group_name", resource_group_name,
                                'str'),
            'localNetworkGatewayName':
            self._serialize.url("local_network_gateway_name",
                                local_network_gateway_name,
                                'str',
                                min_length=1),
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_update(
            self, resource_group_name: str, gallery_name: str,
            gallery_image_name: str, gallery_image_version_name: str,
            gallery_image_version: "_models.GalleryImageVersionUpdate",
            **kwargs: Any) -> LROPoller["_models.GalleryImageVersion"]:
        """Update a gallery Image Version.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param gallery_name: The name of the Shared Image Gallery in which the Image Definition
         resides.
        :type gallery_name: str
        :param gallery_image_name: The name of the gallery Image Definition in which the Image Version
         is to be updated.
        :type gallery_image_name: str
        :param gallery_image_version_name: The name of the gallery Image Version to be updated. Needs
         to follow semantic version name pattern: The allowed characters are digit and period. Digits
         must be within the range of a 32-bit integer. Format:
         :code:`<MajorVersion>`.:code:`<MinorVersion>`.:code:`<Patch>`.
        :type gallery_image_version_name: str
        :param gallery_image_version: Parameters supplied to the update gallery Image Version
         operation.
        :type gallery_image_version: ~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersionUpdate
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
         operation to not poll, or pass in your own initialized polling object for a personal polling
         strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of LROPoller that returns either GalleryImageVersion or the result of
         cls(response)
        :rtype:
         ~azure.core.polling.LROPoller[~azure.mgmt.compute.v2019_12_01.models.GalleryImageVersion]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        content_type = kwargs.pop('content_type',
                                  "application/json")  # type: Optional[str]
        polling = kwargs.pop(
            'polling',
            True)  # type: Union[bool, azure.core.polling.PollingMethod]
        cls = kwargs.pop('cls',
                         None)  # type: ClsType["_models.GalleryImageVersion"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._update_initial(
                resource_group_name=resource_group_name,
                gallery_name=gallery_name,
                gallery_image_name=gallery_image_name,
                gallery_image_version_name=gallery_image_version_name,
                gallery_image_version=gallery_image_version,
                content_type=content_type,
                cls=lambda x, y, z: x,
                **kwargs)
        kwargs.pop('error_map', None)

        def get_long_running_output(pipeline_response):
            response = pipeline_response.http_response
            deserialized = self._deserialize('GalleryImageVersion',
                                             pipeline_response)
            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
    def begin_create_or_update(
        self,
        resource_group_name,  # type: str
        workspace_name,  # type: str
        compute_name,  # type: str
        parameters,  # type: "_models.ComputeResource"
        **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.ComputeResource"]
        """Creates or updates compute. This call will overwrite a compute if it exists. This is a
        nonrecoverable operation. If your intent is to create a new compute, do a GET first to verify
        that it does not exist yet.

        :param resource_group_name: Name of the resource group in which workspace is located.
        :type resource_group_name: str
        :param workspace_name: Name of Azure Machine Learning workspace.
        :type workspace_name: str
        :param compute_name: Name of the Azure Machine Learning compute.
        :type compute_name: str
        :param parameters: Payload with Machine Learning compute definition.
        :type parameters: ~azure.mgmt.machinelearningservices.models.ComputeResource
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either ComputeResource or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.ComputeResource]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling', True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType["_models.ComputeResource"]
        lro_delay = kwargs.pop(
            'polling_interval',
            self._config.polling_interval
        )
        cont_token = kwargs.pop('continuation_token', None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._create_or_update_initial(
                resource_group_name=resource_group_name,
                workspace_name=workspace_name,
                compute_name=compute_name,
                parameters=parameters,
                cls=lambda x,y,z: x,
                **kwargs
            )

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('ComputeResource', pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
            'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
            'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'),
            'computeName': self._serialize.url("compute_name", compute_name, 'str'),
        }

        if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments,  **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output
            )
        else:
            return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
    def begin_delete(self, resource_group_name: str, gallery_name: str,
                     gallery_image_name: str, gallery_image_version_name: str,
                     **kwargs: Any) -> LROPoller[None]:
        """Delete a gallery Image Version.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param gallery_name: The name of the Shared Image Gallery in which the Image Definition
         resides.
        :type gallery_name: str
        :param gallery_image_name: The name of the gallery Image Definition in which the Image Version
         resides.
        :type gallery_image_name: str
        :param gallery_image_version_name: The name of the gallery Image Version to be deleted.
        :type gallery_image_version_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this
         operation to not poll, or pass in your own initialized polling object for a personal polling
         strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
         Retry-After header is present.
        :return: An instance of LROPoller that returns either None or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[None]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        polling = kwargs.pop(
            'polling',
            True)  # type: Union[bool, azure.core.polling.PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._delete_initial(
                resource_group_name=resource_group_name,
                gallery_name=gallery_name,
                gallery_image_name=gallery_image_name,
                gallery_image_version_name=gallery_image_version_name,
                cls=lambda x, y, z: x,
                **kwargs)
        kwargs.pop('error_map', None)

        def get_long_running_output(pipeline_response):
            if cls:
                return cls(pipeline_response, None, {})

        if polling is True: polling_method = ARMPolling(lro_delay, **kwargs)
        elif polling is False: polling_method = NoPolling()
        else: polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
Exemple #29
0
    def begin_delete(
            self,
            resource_group_name,  # type: str
            network_security_group_name,  # type: str
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller[None]
        """Deletes the specified network security group.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param network_security_group_name: The name of the network security group.
        :type network_security_group_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: Pass in True if you'd like the ARMPolling polling method,
         False for no polling, or your own initialized polling object for a personal polling strategy.
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either None or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[None]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._delete_initial(
                resource_group_name=resource_group_name,
                network_security_group_name=network_security_group_name,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            if cls:
                return cls(pipeline_response, None, {})

        path_format_arguments = {
            'resourceGroupName':
            self._serialize.url("resource_group_name", resource_group_name,
                                'str'),
            'networkSecurityGroupName':
            self._serialize.url("network_security_group_name",
                                network_security_group_name, 'str'),
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)
Exemple #30
0
    def begin_create_or_update(
            self,
            resource_group_name,  # type: str
            circuit_name,  # type: str
            peering_name,  # type: str
            peering_parameters,  # type: "_models.ExpressRouteCircuitPeering"
            **kwargs  # type: Any
    ):
        # type: (...) -> LROPoller["_models.ExpressRouteCircuitPeering"]
        """Creates or updates a peering in the specified express route circuits.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param circuit_name: The name of the express route circuit.
        :type circuit_name: str
        :param peering_name: The name of the peering.
        :type peering_name: str
        :param peering_parameters: Parameters supplied to the create or update express route circuit
         peering operation.
        :type peering_parameters: ~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering
        :keyword callable cls: A custom type or function that will be passed the direct response
        :keyword str continuation_token: A continuation token to restart a poller from a saved state.
        :keyword polling: True for ARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :paramtype polling: bool or ~azure.core.polling.PollingMethod
        :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
        :return: An instance of LROPoller that returns either ExpressRouteCircuitPeering or the result of cls(response)
        :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2017_06_01.models.ExpressRouteCircuitPeering]
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        polling = kwargs.pop('polling',
                             True)  # type: Union[bool, PollingMethod]
        cls = kwargs.pop(
            'cls', None)  # type: ClsType["_models.ExpressRouteCircuitPeering"]
        lro_delay = kwargs.pop('polling_interval',
                               self._config.polling_interval)
        cont_token = kwargs.pop('continuation_token',
                                None)  # type: Optional[str]
        if cont_token is None:
            raw_result = self._create_or_update_initial(
                resource_group_name=resource_group_name,
                circuit_name=circuit_name,
                peering_name=peering_name,
                peering_parameters=peering_parameters,
                cls=lambda x, y, z: x,
                **kwargs)

        kwargs.pop('error_map', None)
        kwargs.pop('content_type', None)

        def get_long_running_output(pipeline_response):
            deserialized = self._deserialize('ExpressRouteCircuitPeering',
                                             pipeline_response)

            if cls:
                return cls(pipeline_response, deserialized, {})
            return deserialized

        path_format_arguments = {
            'resourceGroupName':
            self._serialize.url("resource_group_name", resource_group_name,
                                'str'),
            'circuitName':
            self._serialize.url("circuit_name", circuit_name, 'str'),
            'peeringName':
            self._serialize.url("peering_name", peering_name, 'str'),
            'subscriptionId':
            self._serialize.url("self._config.subscription_id",
                                self._config.subscription_id, 'str'),
        }

        if polling is True:
            polling_method = ARMPolling(
                lro_delay,
                path_format_arguments=path_format_arguments,
                **kwargs)
        elif polling is False:
            polling_method = NoPolling()
        else:
            polling_method = polling
        if cont_token:
            return LROPoller.from_continuation_token(
                polling_method=polling_method,
                continuation_token=cont_token,
                client=self._client,
                deserialization_callback=get_long_running_output)
        else:
            return LROPoller(self._client, raw_result, get_long_running_output,
                             polling_method)