Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR azure-mgmt-keyvault] Add keys as a child proxy resource under vaults (AKV's ARM contract). #14975

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/keyvault/azure-mgmt-keyvault/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For a more complete view of Azure libraries, see the [azure sdk python release](

# Usage

For code examples, see [Key Vault Management](https://docs.microsoft.com/python/api/overview/azure/?view=azure-python-preview)
For code examples, see [Key Vault Management](https://docs.microsoft.com/python/api/overview/azure/key-vault)
on docs.microsoft.com.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2016-10-01: :mod:`v2016_10_01.models<azure.mgmt.keyvault.v2016_10_01.models>`
* 2018-02-14: :mod:`v2018_02_14.models<azure.mgmt.keyvault.v2018_02_14.models>`
* 2019-09-01: :mod:`v2019_09_01.models<azure.mgmt.keyvault.v2019_09_01.models>`
* 2020-04-01-preview: :mod:`v2020_04_01_preview.models<azure.mgmt.keyvault.v2020_04_01_preview.models>`
"""
if api_version == '2016-10-01':
from .v2016_10_01 import models
Expand All @@ -85,15 +86,45 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-09-01':
from .v2019_09_01 import models
return models
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
def keys(self):
"""Instance depends on the API version:

* 2019-09-01: :class:`KeysOperations<azure.mgmt.keyvault.v2019_09_01.operations.KeysOperations>`
"""
api_version = self._get_api_version('keys')
if api_version == '2019-09-01':
from .v2019_09_01.operations import KeysOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def managed_hsms(self):
"""Instance depends on the API version:

* 2020-04-01-preview: :class:`ManagedHsmsOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.ManagedHsmsOperations>`
"""
api_version = self._get_api_version('managed_hsms')
if api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import ManagedHsmsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def operations(self):
"""Instance depends on the API version:

* 2016-10-01: :class:`Operations<azure.mgmt.keyvault.v2016_10_01.operations.Operations>`
* 2018-02-14: :class:`Operations<azure.mgmt.keyvault.v2018_02_14.operations.Operations>`
* 2019-09-01: :class:`Operations<azure.mgmt.keyvault.v2019_09_01.operations.Operations>`
* 2020-04-01-preview: :class:`Operations<azure.mgmt.keyvault.v2020_04_01_preview.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2016-10-01':
Expand All @@ -102,6 +133,8 @@ def operations(self):
from .v2018_02_14.operations import Operations as OperationClass
elif api_version == '2019-09-01':
from .v2019_09_01.operations import Operations as OperationClass
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import Operations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -112,12 +145,15 @@ def private_endpoint_connections(self):

* 2018-02-14: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2018_02_14.operations.PrivateEndpointConnectionsOperations>`
* 2019-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2019_09_01.operations.PrivateEndpointConnectionsOperations>`
* 2020-04-01-preview: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.PrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2018-02-14':
from .v2018_02_14.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2019-09-01':
from .v2019_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import PrivateEndpointConnectionsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -128,12 +164,15 @@ def private_link_resources(self):

* 2018-02-14: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2018_02_14.operations.PrivateLinkResourcesOperations>`
* 2019-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2019_09_01.operations.PrivateLinkResourcesOperations>`
* 2020-04-01-preview: :class:`PrivateLinkResourcesOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.PrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2018-02-14':
from .v2018_02_14.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2019-09-01':
from .v2019_09_01.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import PrivateLinkResourcesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -145,6 +184,7 @@ def vaults(self):
* 2016-10-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2016_10_01.operations.VaultsOperations>`
* 2018-02-14: :class:`VaultsOperations<azure.mgmt.keyvault.v2018_02_14.operations.VaultsOperations>`
* 2019-09-01: :class:`VaultsOperations<azure.mgmt.keyvault.v2019_09_01.operations.VaultsOperations>`
* 2020-04-01-preview: :class:`VaultsOperations<azure.mgmt.keyvault.v2020_04_01_preview.operations.VaultsOperations>`
"""
api_version = self._get_api_version('vaults')
if api_version == '2016-10-01':
Expand All @@ -153,6 +193,8 @@ def vaults(self):
from .v2018_02_14.operations import VaultsOperations as OperationClass
elif api_version == '2019-09-01':
from .v2019_09_01.operations import VaultsOperations as OperationClass
elif api_version == '2020-04-01-preview':
from .v2020_04_01_preview.operations import VaultsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,9 @@ class VaultPatchProperties(Model):
:type tenant_id: str
:param sku: SKU details
:type sku: ~azure.mgmt.keyvault.v2018_02_14.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID.
:type access_policies:
list[~azure.mgmt.keyvault.v2018_02_14.models.AccessPolicyEntry]
:param enabled_for_deployment: Property to specify whether Azure Virtual
Expand Down Expand Up @@ -988,10 +988,10 @@ class VaultProperties(Model):
:type tenant_id: str
:param sku: Required. SKU details
:type sku: ~azure.mgmt.keyvault.v2018_02_14.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID. When `createMode` is set to `recover`, access
policies are not required. Otherwise, access policies are required.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID. When `createMode` is set to `recover`,
access policies are not required. Otherwise, access policies are required.
:type access_policies:
list[~azure.mgmt.keyvault.v2018_02_14.models.AccessPolicyEntry]
:param vault_uri: The URI of the vault for performing operations on keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,9 @@ class VaultPatchProperties(Model):
:type tenant_id: str
:param sku: SKU details
:type sku: ~azure.mgmt.keyvault.v2018_02_14.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID.
:type access_policies:
list[~azure.mgmt.keyvault.v2018_02_14.models.AccessPolicyEntry]
:param enabled_for_deployment: Property to specify whether Azure Virtual
Expand Down Expand Up @@ -988,10 +988,10 @@ class VaultProperties(Model):
:type tenant_id: str
:param sku: Required. SKU details
:type sku: ~azure.mgmt.keyvault.v2018_02_14.models.Sku
:param access_policies: An array of 0 to 16 identities that have access to
the key vault. All identities in the array must use the same tenant ID as
the key vault's tenant ID. When `createMode` is set to `recover`, access
policies are not required. Otherwise, access policies are required.
:param access_policies: An array of 0 to 1024 identities that have access
to the key vault. All identities in the array must use the same tenant ID
as the key vault's tenant ID. When `createMode` is set to `recover`,
access policies are not required. Otherwise, access policies are required.
:type access_policies:
list[~azure.mgmt.keyvault.v2018_02_14.models.AccessPolicyEntry]
:param vault_uri: The URI of the vault for performing operations on keys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from .operations import Operations
from .operations import KeysOperations
from . import models


Expand All @@ -34,6 +35,8 @@ class KeyVaultManagementClient(SDKClient):
:vartype private_link_resources: azure.mgmt.keyvault.v2019_09_01.operations.PrivateLinkResourcesOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.keyvault.v2019_09_01.operations.Operations
:ivar keys: Keys operations
:vartype keys: azure.mgmt.keyvault.v2019_09_01.operations.KeysOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand Down Expand Up @@ -64,3 +67,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.keys = KeysOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@

try:
from ._models_py3 import AccessPolicyEntry
from ._models_py3 import Attributes
from ._models_py3 import CheckNameAvailabilityResult
from ._models_py3 import DeletedVault
from ._models_py3 import DeletedVaultProperties
from ._models_py3 import IPRule
from ._models_py3 import Key
from ._models_py3 import KeyAttributes
from ._models_py3 import KeyCreateParameters
from ._models_py3 import KeyProperties
from ._models_py3 import LogSpecification
from ._models_py3 import NetworkRuleSet
from ._models_py3 import Operation
Expand All @@ -40,10 +45,15 @@
from ._models_py3 import VirtualNetworkRule
except (SyntaxError, ImportError):
from ._models import AccessPolicyEntry
from ._models import Attributes
from ._models import CheckNameAvailabilityResult
from ._models import DeletedVault
from ._models import DeletedVaultProperties
from ._models import IPRule
from ._models import Key
from ._models import KeyAttributes
from ._models import KeyCreateParameters
from ._models import KeyProperties
from ._models import LogSpecification
from ._models import NetworkRuleSet
from ._models import Operation
Expand All @@ -68,6 +78,7 @@
from ._models import VaultProperties
from ._models import VirtualNetworkRule
from ._paged_models import DeletedVaultPaged
from ._paged_models import KeyPaged
from ._paged_models import OperationPaged
from ._paged_models import ResourcePaged
from ._paged_models import VaultPaged
Expand All @@ -83,15 +94,24 @@
PrivateEndpointServiceConnectionStatus,
PrivateEndpointConnectionProvisioningState,
Reason,
DeletionRecoveryLevel,
JsonWebKeyType,
JsonWebKeyOperation,
JsonWebKeyCurveName,
AccessPolicyUpdateKind,
)

__all__ = [
'AccessPolicyEntry',
'Attributes',
'CheckNameAvailabilityResult',
'DeletedVault',
'DeletedVaultProperties',
'IPRule',
'Key',
'KeyAttributes',
'KeyCreateParameters',
'KeyProperties',
'LogSpecification',
'NetworkRuleSet',
'Operation',
Expand Down Expand Up @@ -119,6 +139,7 @@
'DeletedVaultPaged',
'ResourcePaged',
'OperationPaged',
'KeyPaged',
'SkuName',
'KeyPermissions',
'SecretPermissions',
Expand All @@ -130,5 +151,9 @@
'PrivateEndpointServiceConnectionStatus',
'PrivateEndpointConnectionProvisioningState',
'Reason',
'DeletionRecoveryLevel',
'JsonWebKeyType',
'JsonWebKeyOperation',
'JsonWebKeyCurveName',
'AccessPolicyUpdateKind',
]
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class SkuName(str, Enum):

class KeyPermissions(str, Enum):

all = "all"
encrypt = "encrypt"
decrypt = "decrypt"
wrap_key = "wrapKey"
Expand All @@ -40,6 +41,7 @@ class KeyPermissions(str, Enum):

class SecretPermissions(str, Enum):

all = "all"
get = "get"
list = "list"
set = "set"
Expand All @@ -52,6 +54,7 @@ class SecretPermissions(str, Enum):

class CertificatePermissions(str, Enum):

all = "all"
get = "get"
list = "list"
delete = "delete"
Expand All @@ -72,6 +75,7 @@ class CertificatePermissions(str, Enum):

class StoragePermissions(str, Enum):

all = "all"
get = "get"
list = "list"
delete = "delete"
Expand Down Expand Up @@ -130,6 +134,41 @@ class Reason(str, Enum):
already_exists = "AlreadyExists"


class DeletionRecoveryLevel(str, Enum):

purgeable = "Purgeable"
recoverable_purgeable = "Recoverable+Purgeable"
recoverable = "Recoverable"
recoverable_protected_subscription = "Recoverable+ProtectedSubscription"


class JsonWebKeyType(str, Enum):

ec = "EC"
ec_hsm = "EC-HSM"
rsa = "RSA"
rsa_hsm = "RSA-HSM"


class JsonWebKeyOperation(str, Enum):

encrypt = "encrypt"
decrypt = "decrypt"
sign = "sign"
verify = "verify"
wrap_key = "wrapKey"
unwrap_key = "unwrapKey"
import_enum = "import"


class JsonWebKeyCurveName(str, Enum):

p_256 = "P-256"
p_384 = "P-384"
p_521 = "P-521"
p_256_k = "P-256K"


class AccessPolicyUpdateKind(str, Enum):

add = "add"
Expand Down
Loading