How to use the azure.core.tracing.decorator.distributed_trace function in azure

To help you get started, we’ve selected a few azure examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-python / sdk / storage / azure-storage-file-share / azure / storage / fileshare / _share_service_client.py View on Github external
    @distributed_trace
    def get_service_properties(self, **kwargs):
        # type: (Any) -> Dict[str, Any]
        """Gets the properties of a storage account's File Share service, including
        Azure Storage Analytics.

        :keyword int timeout:
            The timeout parameter is expressed in seconds.
        :returns: A dictionary containing file service properties such as
            analytics logging, hour/minute metrics, cors rules, etc.
        :rtype: Dict[str, Any]

        .. admonition:: Example:

            .. literalinclude:: ../samples/file_samples_service.py
                :start-after: [START get_service_properties]
                :end-before: [END get_service_properties]
github Azure / azure-sdk-for-python / sdk / storage / azure-storage-queue / azure / storage / queue / _queue_client.py View on Github external
    @distributed_trace
    def set_queue_metadata(self, metadata=None, **kwargs):
        # type: (Optional[Dict[str, Any]], Optional[Any]) -> None
        """Sets user-defined metadata on the specified queue.

        Metadata is associated with the queue as name-value pairs.

        :param metadata:
            A dict containing name-value pairs to associate with the
            queue as metadata.
        :type metadata: dict(str, str)
        :keyword int timeout:
            The server timeout, expressed in seconds.

        .. admonition:: Example:

            .. literalinclude:: ../samples/queue_samples_message.py
github Azure / azure-sdk-for-python / sdk / keyvault / azure-keyvault-secrets / azure / keyvault / secrets / _client.py View on Github external
    @distributed_trace
    def restore_secret_backup(self, backup, **kwargs):
        # type: (bytes, **Any) -> SecretProperties
        """Restore a backed up secret. Requires the secrets/restore permission.

        :param bytes backup: The raw bytes of the secret backup
        :returns: The restored secret
        :rtype: ~azure.keyvault.secrets.SecretProperties
        :raises:
            :class:`~azure.core.exceptions.ResourceExistsError` if the secret's name is already in use,
            :class:`~azure.core.exceptions.HttpResponseError` for other errors

        Example:
            .. literalinclude:: ../tests/test_samples_secrets.py
                :start-after: [START restore_secret_backup]
                :end-before: [END restore_secret_backup]
                :language: python
github Azure / azure-sdk-for-python / sdk / storage / azure-storage-queue / azure / storage / queue / _queue_client.py View on Github external
    @distributed_trace
    def clear_messages(self, **kwargs):
        # type: (Optional[Any]) -> None
        """Deletes all messages from the specified queue.

        :keyword int timeout:
            The server timeout, expressed in seconds.

        .. admonition:: Example:

            .. literalinclude:: ../samples/queue_samples_message.py
                :start-after: [START clear_messages]
                :end-before: [END clear_messages]
                :language: python
                :dedent: 12
                :caption: Clears all messages.
        """
github Azure / azure-sdk-for-python / sdk / storage / azure-storage-queue / azure / storage / queue / _queue_client.py View on Github external
    @distributed_trace
    def set_queue_access_policy(self, signed_identifiers, **kwargs):
        # type: (Dict[str, AccessPolicy], Optional[Any]) -> None
        """Sets stored access policies for the queue that may be used with Shared
        Access Signatures.

        When you set permissions for a queue, the existing permissions are replaced.
        To update the queue's permissions, call :func:`~get_queue_access_policy` to fetch
        all access policies associated with the queue, modify the access policy
        that you wish to change, and then call this function with the complete
        set of data to perform the update.

        When you establish a stored access policy on a queue, it may take up to
        30 seconds to take effect. During this interval, a shared access signature
        that is associated with the stored access policy will throw an
        :class:`HttpResponseError` until the access policy becomes active.
github Azure / azure-sdk-for-python / sdk / storage / azure-storage-storage / blob / _container_client.py View on Github external
    @distributed_trace
    def set_premium_page_blob_tier_blobs(
        self,
        premium_page_blob_tier,  # type: Union[str, PremiumPageBlobTier]
        *blobs,  # type: Union[str, BlobProperties]
        **kwargs
    ):
        # type: (...) -> Iterator[HttpResponse]
        """Sets the page blob tiers on the blobs. This API is only supported for page blobs on premium accounts.

        :param premium_page_blob_tier:
            A page blob tier value to set the blob to. The tier correlates to the size of the
            blob and number of allowed IOPS. This is only applicable to page blobs on
            premium storage accounts.
        :type premium_page_blob_tier: ~azure.storage.blob.PremiumPageBlobTier
        :param blobs: The blobs with which to interact. This can be a single blob, or multiple values can
            be supplied, where each value is either the name of the blob (str) or BlobProperties.
github Azure / azure-sdk-for-python / sdk / keyvault / azure-keyvault-keys / azure / keyvault / keys / _client.py View on Github external
    @distributed_trace
    def create_rsa_key(self, name, **kwargs):
        # type: (str, **Any) -> KeyVaultKey
        """Create a new RSA key. If ``name`` is already in use, create a new version of the key. Requires the
        keys/create permission.

        :param str name: The name for the new key. Key Vault will generate the key's version.
        :returns: The created key
        :rtype: ~azure.keyvault.keys.KeyVaultKey
        :raises: :class:`~azure.core.exceptions.HttpResponseError`

        Keyword arguments
            - **size** (int): Key size in bits, for example 2048, 3072, or 4096.
            - **hardware_protected** (bool): Whether the key should be created in a hardware security module.
              Defaults to ``False``.
            - **key_operations** (list[str or :class:`~azure.keyvault.keys.KeyOperation`]): Allowed key operations
            - **enabled** (bool): Whether the key is enabled for use.
github Azure / azure-sdk-for-python / sdk / keyvault / azure-keyvault-certificates / azure / keyvault / certificates / client.py View on Github external
    @distributed_trace
    def list_certificate_versions(self, name, **kwargs):
        # type: (str, **Any) -> Iterable[CertificateProperties]
        """List the versions of a certificate.

        The GetCertificateVersions operation returns the versions of a
        certificate in the key vault. This operation requires the
        certificates/list permission.

        :param str name: The name of the certificate.
        :returns: An iterator like instance of CertificateProperties
        :rtype:
         ~azure.core.paging.ItemPaged[~azure.keyvault.certificates.models.CertificateProperties]
        :raises: :class:`~azure.core.exceptions.HttpResponseError`

        Example:
            .. literalinclude:: ../tests/test_examples_certificates.py
github Azure / azure-sdk-for-python / sdk / storage / azure-storage-storage / blob / _container_client.py View on Github external
    @distributed_trace
    def create_container(self, metadata=None, public_access=None, **kwargs):
        # type: (Optional[Dict[str, str]], Optional[Union[PublicAccess, str]], **Any) -> None
        """
        Creates a new container under the specified account. If the container
        with the same name already exists, the operation fails.

        :param metadata:
            A dict with name_value pairs to associate with the
            container as metadata. Example:{'Category':'test'}
        :type metadata: dict[str, str]
        :param ~azure.storage.blob.PublicAccess public_access:
            Possible values include: 'container', 'blob'.
        :keyword int timeout:
            The timeout parameter is expressed in seconds.
        :rtype: None