示例#1
0
    def list_secret_versions(
            self, name: str,
            **kwargs: "**Any") -> AsyncIterable[SecretAttributes]:
        """List all versions of a secret, including their identifiers and attributes but not their values. Requires the
        secrets/list permission.

        :param str name: Name of the secret
        :returns: An iterator of secrets
        :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.secrets.models.SecretAttributes]

        Example:
            .. literalinclude:: ../tests/test_samples_secrets_async.py
                :start-after: [START list_secret_versions]
                :end-before: [END list_secret_versions]
                :language: python
                :caption: List all versions of a secret
                :dedent: 8
        """
        max_results = kwargs.get("max_page_size")
        return self._client.get_secret_versions(
            self.vault_url,
            name,
            maxresults=max_results,
            cls=lambda objs:
            [SecretAttributes._from_secret_item(x) for x in objs],
            **kwargs)
示例#2
0
    def list_secrets(self, **kwargs: Mapping[str, Any]) -> AsyncIterable[SecretAttributes]:
        """List the latest identifier and attributes of all secrets in the vault, not including their values. Requires
        the secrets/list permission.

        :returns: An iterator of secrets
        :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.keyvault.secrets.models.SecretAttributes]

        Example:
            .. literalinclude:: ../tests/test_samples_secrets_async.py
                :start-after: [START list_secrets]
                :end-before: [END list_secrets]
                :language: python
                :caption: Lists all secrets
                :dedent: 8
        """
        max_results = kwargs.get("max_page_size")
        return self._client.get_secrets(
            self.vault_url,
            maxresults=max_results,
            cls=lambda objs: [SecretAttributes._from_secret_item(x) for x in objs],
            **kwargs
        )