async def create_or_update(self,
                               resource_group_name,
                               cluster_name,
                               parameters,
                               *,
                               custom_headers=None,
                               raw=False,
                               polling=True,
                               **operation_config):
        """Create or update a Log Analytics cluster.

        :param resource_group_name: The name of the resource group. The name
         is case insensitive.
        :type resource_group_name: str
        :param cluster_name: The name of the Log Analytics cluster.
        :type cluster_name: str
        :param parameters: The parameters required to create or update a Log
         Analytics cluster.
        :type parameters: ~azure.mgmt.loganalytics.models.Cluster
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for AsyncARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of Cluster or ClientRawResponse<Cluster> if
         raw==True
        :rtype: ~~azure.mgmt.loganalytics.models.Cluster or
         ~msrest.pipeline.ClientRawResponse[~azure.mgmt.loganalytics.models.Cluster]
        :raises:
         :class:`ClusterErrorResponseException<azure.mgmt.loganalytics.models.ClusterErrorResponseException>`
        """
        raw_result = await self._create_or_update_initial(
            resource_group_name=resource_group_name,
            cluster_name=cluster_name,
            parameters=parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

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

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

            return deserialized

        lro_delay = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        if polling is True:
            polling_method = AsyncARMPolling(lro_delay, **operation_config)
        elif polling is False:
            polling_method = AsyncNoPolling()
        else:
            polling_method = polling
        return await async_poller(self._client, raw_result,
                                  get_long_running_output, polling_method)
示例#2
0
    async def put_async_retry_succeeded(self,
                                        product=None,
                                        *,
                                        custom_headers=None,
                                        raw=False,
                                        polling=True,
                                        **operation_config):
        """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is
        required message header for all requests. Long running put request,
        service returns a 200 to the initial request, with an entity that
        contains ProvisioningState=’Creating’. Poll the endpoint indicated in
        the Azure-AsyncOperation header for operation status.

        :param product: Product to put
        :type product: ~lro.models.Product
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for AsyncARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of Product or ClientRawResponse<Product> if
         raw==True
        :rtype: ~~lro.models.Product or
         ~msrest.pipeline.ClientRawResponse[~lro.models.Product]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = await self._put_async_retry_succeeded_initial(
            product=product,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            header_dict = {
                'Azure-AsyncOperation': 'str',
                'Location': 'str',
                'Retry-After': 'int',
            }
            deserialized = self._deserialize('Product', response)

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

            return deserialized

        lro_delay = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        if polling is True:
            polling_method = AsyncARMPolling(lro_delay, **operation_config)
        elif polling is False:
            polling_method = AsyncNoPolling()
        else:
            polling_method = polling
        return await async_poller(self._client, raw_result,
                                  get_long_running_output, polling_method)
示例#3
0
    async def delete(self,
                     resource_group_name,
                     workspace_name,
                     linked_service_name,
                     *,
                     custom_headers=None,
                     raw=False,
                     polling=True,
                     **operation_config):
        """Deletes a linked service instance.

        :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 linked_service_name: Name of the linked service.
        :type linked_service_name: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for AsyncARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of LinkedService or
         ClientRawResponse<LinkedService> if raw==True
        :rtype: ~~azure.mgmt.loganalytics.models.LinkedService or
         ~msrest.pipeline.ClientRawResponse[~azure.mgmt.loganalytics.models.LinkedService]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = await self._delete_initial(
            resource_group_name=resource_group_name,
            workspace_name=workspace_name,
            linked_service_name=linked_service_name,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

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

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

            return deserialized

        lro_delay = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        if polling is True:
            polling_method = AsyncARMPolling(lro_delay, **operation_config)
        elif polling is False:
            polling_method = AsyncNoPolling()
        else:
            polling_method = polling
        return await async_poller(self._client, raw_result,
                                  get_long_running_output, polling_method)
示例#4
0
    async def delete(self,
                     resource_group_name,
                     workspace_name,
                     force=None,
                     *,
                     custom_headers=None,
                     raw=False,
                     polling=True,
                     **operation_config):
        """Deletes a workspace resource. To recover the workspace, create it again
        with the same name, in the same subscription, resource group and
        location. The name is kept for 14 days and cannot be used for another
        workspace. To remove the workspace completely and release the name, use
        the force flag.

        :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 force: Deletes the workspace without the recovery option. A
         workspace that was deleted with this flag cannot be recovered.
        :type force: bool
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for AsyncARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of None or ClientRawResponse<None> if raw==True
        :rtype: ~None or ~msrest.pipeline.ClientRawResponse[None]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = await self._delete_initial(
            resource_group_name=resource_group_name,
            workspace_name=workspace_name,
            force=force,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            if raw:
                client_raw_response = ClientRawResponse(None, response)
                return client_raw_response

        lro_delay = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        if polling is True:
            polling_method = AsyncARMPolling(lro_delay, **operation_config)
        elif polling is False:
            polling_method = AsyncNoPolling()
        else:
            polling_method = polling
        return await async_poller(self._client, raw_result,
                                  get_long_running_output, polling_method)
示例#5
0
    async def post202_retry200(self,
                               product=None,
                               *,
                               custom_headers=None,
                               raw=False,
                               polling=True,
                               **operation_config):
        """x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is
        required message header for all requests. Long running post request,
        service returns a 202 to the initial request, with 'Location' and
        'Retry-After' headers, Polls return a 200 with a response body after
        success.

        :param product: Product to put
        :type product: ~lro.models.Product
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for AsyncARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of None or ClientRawResponse<None> if raw==True
        :rtype: ~None or ~msrest.pipeline.ClientRawResponse[None]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = await self._post202_retry200_initial(
            product=product,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            if raw:
                client_raw_response = ClientRawResponse(None, response)
                client_raw_response.add_headers({
                    'Location': 'str',
                    'Retry-After': 'int',
                })
                return client_raw_response

        lro_delay = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        if polling is True:
            polling_method = AsyncARMPolling(lro_delay, **operation_config)
        elif polling is False:
            polling_method = AsyncNoPolling()
        else:
            polling_method = polling
        return await async_poller(self._client, raw_result,
                                  get_long_running_output, polling_method)
示例#6
0
    async def delete(self,
                     resource_group_name,
                     resource_name,
                     *,
                     custom_headers=None,
                     raw=False,
                     polling=True,
                     **operation_config):
        """Deletes a OpenShift cluster with the specified subscription, resource
        group and resource name.

        Deletes a OpenShift cluster with the specified subscription, resource
        group and resource name.  The operation returns nothing.

        :param resource_group_name: The name of the resource group.
        :type resource_group_name: str
        :param resource_name: The name of the OpenShift cluster resource.
        :type resource_name: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for AsyncARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of None or ClientRawResponse<None> if raw==True
        :rtype: ~None or ~msrest.pipeline.ClientRawResponse[None]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = await self._delete_initial(
            resource_group_name=resource_group_name,
            resource_name=resource_name,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

        def get_long_running_output(response):
            if raw:
                client_raw_response = ClientRawResponse(None, response)
                return client_raw_response

        lro_delay = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        if polling is True:
            polling_method = AsyncARMPolling(lro_delay, **operation_config)
        elif polling is False:
            polling_method = AsyncNoPolling()
        else:
            polling_method = polling
        return await async_poller(self._client, raw_result,
                                  get_long_running_output, polling_method)
    async def get_multiple_pages_lro(
            self, client_request_id=None, paging_get_multiple_pages_lro_options=None, *, custom_headers=None, raw=False, polling=True, **operation_config):
        """A long-running paging operation that includes a nextLink that has 10
        pages.

        :param client_request_id:
        :type client_request_id: str
        :param paging_get_multiple_pages_lro_options: Additional parameters
         for the operation
        :type paging_get_multiple_pages_lro_options:
         ~paging.models.PagingGetMultiplePagesLroOptions
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for AsyncARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of ProductResult or
         ClientRawResponse<ProductResult> if raw==True
        :rtype: ~~paging.models.ProductResult or
         ~msrest.pipeline.ClientRawResponse[~paging.models.ProductResult]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = await self._get_multiple_pages_lro_initial(
            client_request_id=client_request_id,
            paging_get_multiple_pages_lro_options=paging_get_multiple_pages_lro_options,
            custom_headers=custom_headers,
            raw=True,
            **operation_config
        )

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

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

            return deserialized

        lro_delay = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        if polling is True: polling_method = AsyncARMPolling(lro_delay, **operation_config)
        elif polling is False: polling_method = AsyncNoPolling()
        else: polling_method = polling
        return await async_poller(self._client, raw_result, get_long_running_output, polling_method)
    async def create(self,
                     resource_group_name,
                     account_name,
                     parameters,
                     *,
                     custom_headers=None,
                     raw=False,
                     polling=True,
                     **operation_config):
        """Asynchronously creates a new storage account with the specified
        parameters. Existing accounts cannot be updated with this API and
        should instead use the Update Storage Account API. If an account is
        already created and subsequent PUT request is issued with exact same
        set of properties, then HTTP 200 would be returned. .

        :param resource_group_name: The name of the resource group within the
         user’s subscription.
        :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: ~storage.models.StorageAccountCreateParameters
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: The poller return type is ClientRawResponse, the
         direct response alongside the deserialized response
        :param polling: True for AsyncARMPolling, False for no polling, or a
         polling object for personal polling strategy
        :return: An instance of StorageAccount or
         ClientRawResponse<StorageAccount> if raw==True
        :rtype: ~~storage.models.StorageAccount or
         ~msrest.pipeline.ClientRawResponse[~storage.models.StorageAccount]
        :raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
        """
        raw_result = await self._create_initial(
            resource_group_name=resource_group_name,
            account_name=account_name,
            parameters=parameters,
            custom_headers=custom_headers,
            raw=True,
            **operation_config)

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

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

            return deserialized

        lro_delay = operation_config.get(
            'long_running_operation_timeout',
            self.config.long_running_operation_timeout)
        if polling is True:
            polling_method = AsyncARMPolling(lro_delay, **operation_config)
        elif polling is False:
            polling_method = AsyncNoPolling()
        else:
            polling_method = polling
        return await async_poller(self._client, raw_result,
                                  get_long_running_output, polling_method)