KeysOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

KeyVaultManagementClient's

<xref:keys> attribute.

Inheritance
builtins.object
KeysOperations

Constructor

KeysOperations(*args, **kwargs)

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.

create_if_not_exist(resource_group_name: str, vault_name: str, key_name: str, parameters: _models.KeyCreateParameters, *, content_type: str = 'application/json', **kwargs: Any) -> _models.Key

Parameters

Name Description
resource_group_name
Required
str

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

vault_name
Required
str

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

key_name
Required
str

The name of the key to be created. Required.

parameters
Required

The parameters used to create the specified key. Is either a KeyCreateParameters type or a IO type. Required.

Keyword-Only Parameters

Name Description
content_type
str

Body Parameter content-type. Known values are: 'application/json'. Default value is None.

cls

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

Returns

Type Description
Key

Key or the result of cls(response)

Exceptions

Type Description

get

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

get(resource_group_name: str, vault_name: str, key_name: str, **kwargs: Any) -> Key

Parameters

Name Description
resource_group_name
Required
str

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

vault_name
Required
str

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

key_name
Required
str

The name of the key to be retrieved. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description
Key

Key or the result of cls(response)

Exceptions

Type Description

get_version

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

get_version(resource_group_name: str, vault_name: str, key_name: str, key_version: str, **kwargs: Any) -> Key

Parameters

Name Description
resource_group_name
Required
str

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

vault_name
Required
str

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

key_name
Required
str

The name of the key version to be retrieved. Required.

key_version
Required
str

The version of the key to be retrieved. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description
Key

Key or the result of cls(response)

Exceptions

Type Description

list

Lists the keys in the specified key vault.

list(resource_group_name: str, vault_name: str, **kwargs: Any) -> Iterable[Key]

Parameters

Name Description
resource_group_name
Required
str

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

vault_name
Required
str

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

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

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) -> Iterable[Key]

Parameters

Name Description
resource_group_name
Required
str

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

vault_name
Required
str

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

key_name
Required
str

The name of the key versions to be retrieved. Required.

Keyword-Only Parameters

Name Description
cls

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

Returns

Type Description

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

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.keyvault.v2020_04_01_preview.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\keyvault\\v2020_04_01_preview\\models\\__init__.py'>