KeysOperations Class

KeysOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
KeysOperations

Constructor

KeysOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

Methods

create_if_not_exist

Creates the first version of a new key if it does not exist. If it already exists, then the existing key is returned without any write operations being performed. This API does not create subsequent versions, and does not update existing keys.

get

Gets the current version of the specified key from the specified key vault.

get_version

Gets the specified version of the specified key in the specified key vault.

list

Lists the keys in the specified key vault.

list_versions

Lists the versions of the specified key in the specified key vault.

create_if_not_exist

Creates the first version of a new key if it does not exist. If it already exists, then the existing key is returned without any write operations being performed. This API does not create subsequent versions, and does not update existing keys.

async create_if_not_exist(resource_group_name: str, vault_name: str, key_name: str, parameters: azure.mgmt.keyvault.v2021_06_01_preview.models._models_py3.KeyCreateParameters, **kwargs: Any) -> azure.mgmt.keyvault.v2021_06_01_preview.models._models_py3.Key

Parameters

resource_group_name
str
Required

The name of the resource group which contains the specified key vault.

vault_name
str
Required

The name of the key vault which contains the key to be created.

key_name
str
Required

The name of the key to be created.

parameters
KeyCreateParameters
Required

The parameters used to create the specified key.

cls
callable

A custom type or function that will be passed the direct response

Returns

Key, or the result of cls(response)

Return type

Key

Exceptions

get

Gets the current version of the specified key from the specified key vault.

async get(resource_group_name: str, vault_name: str, key_name: str, **kwargs: Any) -> azure.mgmt.keyvault.v2021_06_01_preview.models._models_py3.Key

Parameters

resource_group_name
str
Required

The name of the resource group which contains the specified key vault.

vault_name
str
Required

The name of the vault which contains the key to be retrieved.

key_name
str
Required

The name of the key to be retrieved.

cls
callable

A custom type or function that will be passed the direct response

Returns

Key, or the result of cls(response)

Return type

Key

Exceptions

get_version

Gets the specified version of the specified key in the specified key vault.

async get_version(resource_group_name: str, vault_name: str, key_name: str, key_version: str, **kwargs: Any) -> azure.mgmt.keyvault.v2021_06_01_preview.models._models_py3.Key

Parameters

resource_group_name
str
Required

The name of the resource group which contains the specified key vault.

vault_name
str
Required

The name of the vault which contains the key version to be retrieved.

key_name
str
Required

The name of the key version to be retrieved.

key_version
str
Required

The version of the key to be retrieved.

cls
callable

A custom type or function that will be passed the direct response

Returns

Key, or the result of cls(response)

Return type

Key

Exceptions

list

Lists the keys in the specified key vault.

list(resource_group_name: str, vault_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.keyvault.v2021_06_01_preview.models._models_py3.KeyListResult]

Parameters

resource_group_name
str
Required

The name of the resource group which contains the specified key vault.

vault_name
str
Required

The name of the vault which contains the keys to be retrieved.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either KeyListResult or the result of cls(response)

Return type

Exceptions

list_versions

Lists the versions of the specified key in the specified key vault.

list_versions(resource_group_name: str, vault_name: str, key_name: str, **kwargs: Any) -> AsyncIterable[azure.mgmt.keyvault.v2021_06_01_preview.models._models_py3.KeyListResult]

Parameters

resource_group_name
str
Required

The name of the resource group which contains the specified key vault.

vault_name
str
Required

The name of the vault which contains the key versions to be retrieved.

key_name
str
Required

The name of the key versions to be retrieved.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either KeyListResult or the result of cls(response)

Return type

Exceptions

Attributes

models

models = <module 'azure.mgmt.keyvault.v2021_06_01_preview.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\keyvault\\v2021_06_01_preview\\models\\__init__.py'>