Skip to content
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
Empty file modified azure-mgmt-keyvault/azure/mgmt/keyvault/__init__.py
100755 → 100644
Empty file.
21 changes: 12 additions & 9 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/key_vault_management_client.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.vaults_operations import VaultsOperations
from .operations.operations import Operations
from . import models


Expand All @@ -25,9 +26,9 @@ class KeyVaultManagementClientConfiguration(AzureConfiguration):
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Gets subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""
Expand All @@ -39,14 +40,12 @@ def __init__(
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not isinstance(subscription_id, str):
raise TypeError("Parameter 'subscription_id' must be str.")
if not base_url:
base_url = 'https://management.azure.com'

super(KeyVaultManagementClientConfiguration, self).__init__(base_url)

self.add_user_agent('keyvaultmanagementclient/{}'.format(VERSION))
self.add_user_agent('azure-mgmt-keyvault/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
Expand All @@ -61,13 +60,15 @@ class KeyVaultManagementClient(object):

:ivar vaults: Vaults operations
:vartype vaults: azure.mgmt.keyvault.operations.VaultsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.keyvault.operations.Operations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Gets subscription credentials which uniquely
identify Microsoft Azure subscription. The subscription ID forms part of
the URI for every service call.
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""
Expand All @@ -85,3 +86,5 @@ def __init__(

self.vaults = VaultsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
26 changes: 26 additions & 0 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/models/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,66 @@
from .permissions import Permissions
from .access_policy_entry import AccessPolicyEntry
from .vault_properties import VaultProperties
from .vault_patch_properties import VaultPatchProperties
from .vault_access_policy_properties import VaultAccessPolicyProperties
from .deleted_vault_properties import DeletedVaultProperties
from .vault_create_or_update_parameters import VaultCreateOrUpdateParameters
from .vault_patch_parameters import VaultPatchParameters
from .vault_access_policy_parameters import VaultAccessPolicyParameters
from .vault import Vault
from .deleted_vault import DeletedVault
from .resource import Resource
from .vault_check_name_availability_parameters import VaultCheckNameAvailabilityParameters
from .check_name_availability_result import CheckNameAvailabilityResult
from .operation_display import OperationDisplay
from .log_specification import LogSpecification
from .service_specification import ServiceSpecification
from .operation import Operation
from .vault_paged import VaultPaged
from .deleted_vault_paged import DeletedVaultPaged
from .resource_paged import ResourcePaged
from .operation_paged import OperationPaged
from .key_vault_management_client_enums import (
SkuName,
KeyPermissions,
SecretPermissions,
CertificatePermissions,
StoragePermissions,
CreateMode,
Reason,
AccessPolicyUpdateKind,
)

__all__ = [
'Sku',
'Permissions',
'AccessPolicyEntry',
'VaultProperties',
'VaultPatchProperties',
'VaultAccessPolicyProperties',
'DeletedVaultProperties',
'VaultCreateOrUpdateParameters',
'VaultPatchParameters',
'VaultAccessPolicyParameters',
'Vault',
'DeletedVault',
'Resource',
'VaultCheckNameAvailabilityParameters',
'CheckNameAvailabilityResult',
'OperationDisplay',
'LogSpecification',
'ServiceSpecification',
'Operation',
'VaultPaged',
'DeletedVaultPaged',
'ResourcePaged',
'OperationPaged',
'SkuName',
'KeyPermissions',
'SecretPermissions',
'CertificatePermissions',
'StoragePermissions',
'CreateMode',
'Reason',
'AccessPolicyUpdateKind',
]
4 changes: 2 additions & 2 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/models/access_policy_entry.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ class AccessPolicyEntry(Model):
:type application_id: str
:param permissions: Permissions the identity has for keys, secrets and
certificates.
:type permissions: :class:`Permissions
<azure.mgmt.keyvault.models.Permissions>`
:type permissions: ~azure.mgmt.keyvault.models.Permissions
"""

_validation = {
Expand All @@ -46,6 +45,7 @@ class AccessPolicyEntry(Model):
}

def __init__(self, tenant_id, object_id, permissions, application_id=None):
super(AccessPolicyEntry, self).__init__()
self.tenant_id = tenant_id
self.object_id = object_id
self.application_id = application_id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CheckNameAvailabilityResult(Model):
"""The CheckNameAvailability operation response.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar name_available: A boolean value that indicates whether the name is
available for you to use. If true, the name is available. If false, the
name has already been taken or is invalid and cannot be used.
:vartype name_available: bool
:ivar reason: The reason that a vault name could not be used. The Reason
element is only returned if NameAvailable is false. Possible values
include: 'AccountNameInvalid', 'AlreadyExists'
:vartype reason: str or ~azure.mgmt.keyvault.models.Reason
:ivar message: An error message explaining the Reason value in more
detail.
:vartype message: str
"""

_validation = {
'name_available': {'readonly': True},
'reason': {'readonly': True},
'message': {'readonly': True},
}

_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'Reason'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self):
super(CheckNameAvailabilityResult, self).__init__()
self.name_available = None
self.reason = None
self.message = None
4 changes: 2 additions & 2 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class DeletedVault(Model):
:ivar type: The resource type of the key vault.
:vartype type: str
:param properties: Properties of the vault
:type properties: :class:`DeletedVaultProperties
<azure.mgmt.keyvault.models.DeletedVaultProperties>`
:type properties: ~azure.mgmt.keyvault.models.DeletedVaultProperties
"""

_validation = {
Expand All @@ -43,6 +42,7 @@ class DeletedVault(Model):
}

def __init__(self, properties=None):
super(DeletedVault, self).__init__()
self.id = None
self.name = None
self.type = None
Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_paged.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class DeletedVaultPaged(Paged):
"""
A paging container for iterating over a list of DeletedVault object
A paging container for iterating over a list of :class:`DeletedVault <azure.mgmt.keyvault.models.DeletedVault>` object
"""

_attribute_map = {
Expand Down
3 changes: 2 additions & 1 deletion azure-mgmt-keyvault/azure/mgmt/keyvault/models/deleted_vault_properties.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DeletedVaultProperties(Model):
:ivar scheduled_purge_date: The scheduled purged date.
:vartype scheduled_purge_date: datetime
:ivar tags: Tags of the original vault.
:vartype tags: dict
:vartype tags: dict[str, str]
"""

_validation = {
Expand All @@ -47,6 +47,7 @@ class DeletedVaultProperties(Model):
}

def __init__(self):
super(DeletedVaultProperties, self).__init__()
self.vault_id = None
self.location = None
self.deletion_date = None
Expand Down
17 changes: 17 additions & 0 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/models/key_vault_management_client_enums.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ class StoragePermissions(Enum):
set = "set"
update = "update"
regeneratekey = "regeneratekey"
recover = "recover"
purge = "purge"
backup = "backup"
restore = "restore"
setsas = "setsas"
listsas = "listsas"
getsas = "getsas"
Expand All @@ -86,3 +90,16 @@ class CreateMode(Enum):

recover = "recover"
default = "default"


class Reason(Enum):

account_name_invalid = "AccountNameInvalid"
already_exists = "AlreadyExists"


class AccessPolicyUpdateKind(Enum):

add = "add"
replace = "replace"
remove = "remove"
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class LogSpecification(Model):
"""Log specification of operation.

:param name: Name of log specification.
:type name: str
:param display_name: Display name of log specification.
:type display_name: str
:param blob_duration: Blob duration of specification.
:type blob_duration: str
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display_name': {'key': 'displayName', 'type': 'str'},
'blob_duration': {'key': 'blobDuration', 'type': 'str'},
}

def __init__(self, name=None, display_name=None, blob_duration=None):
super(LogSpecification, self).__init__()
self.name = name
self.display_name = display_name
self.blob_duration = blob_duration
42 changes: 42 additions & 0 deletions azure-mgmt-keyvault/azure/mgmt/keyvault/models/operation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class Operation(Model):
"""Key Vault REST API operation definition.

:param name: Operation name: {provider}/{resource}/{operation}
:type name: str
:param display: Display metadata associated with the operation.
:type display: ~azure.mgmt.keyvault.models.OperationDisplay
:param origin: The origin of operations.
:type origin: str
:param service_specification: One property of operation, include metric
specifications.
:type service_specification:
~azure.mgmt.keyvault.models.ServiceSpecification
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplay'},
'origin': {'key': 'origin', 'type': 'str'},
'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'},
}

def __init__(self, name=None, display=None, origin=None, service_specification=None):
super(Operation, self).__init__()
self.name = name
self.display = display
self.origin = origin
self.service_specification = service_specification
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class OperationDisplay(Model):
"""Display metadata associated with the operation.

:param provider: Service provider: Microsoft Key Vault.
:type provider: str
:param resource: Resource on which the operation is performed etc.
:type resource: str
:param operation: Type of operation: get, read, delete, etc.
:type operation: str
:param description: Decription of operation.
:type description: str
"""

_attribute_map = {
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'description': {'key': 'description', 'type': 'str'},
}

def __init__(self, provider=None, resource=None, operation=None, description=None):
super(OperationDisplay, self).__init__()
self.provider = provider
self.resource = resource
self.operation = operation
self.description = description
Loading