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-storage] [Linked to PR# 1045] Adding support for encryption key type #9382

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
SkuTier,
Kind,
Reason,
KeyType,
KeySource,
Action,
State,
Expand Down Expand Up @@ -302,6 +303,7 @@
'SkuTier',
'Kind',
'Reason',
'KeyType',
'KeySource',
'Action',
'State',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,11 @@ class EncryptionService(Model):
enabled. There might be some unencrypted blobs which were written after
this time, as it is just a rough estimate.
:vartype last_enabled_time: datetime
:param key_type: Encryption key type to be used for the encryption
service. 'Account' key type implies that an account-scoped encryption key
will be used. 'Service' key type implies that a default service key is
used. Possible values include: 'Service', 'Account'
:type key_type: str or ~azure.mgmt.storage.v2019_06_01.models.KeyType
"""

_validation = {
Expand All @@ -765,35 +770,29 @@ class EncryptionService(Model):
_attribute_map = {
'enabled': {'key': 'enabled', 'type': 'bool'},
'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'},
'key_type': {'key': 'keyType', 'type': 'str'},
}

def __init__(self, **kwargs):
super(EncryptionService, self).__init__(**kwargs)
self.enabled = kwargs.get('enabled', None)
self.last_enabled_time = None
self.key_type = kwargs.get('key_type', None)


class EncryptionServices(Model):
"""A list of services that support encryption.

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

:param blob: The encryption function of the blob storage service.
:type blob: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:param file: The encryption function of the file storage service.
:type file: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:ivar table: The encryption function of the table storage service.
:vartype table: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:ivar queue: The encryption function of the queue storage service.
:vartype queue: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:param table: The encryption function of the table storage service.
:type table: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:param queue: The encryption function of the queue storage service.
:type queue: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
"""

_validation = {
'table': {'readonly': True},
'queue': {'readonly': True},
}

_attribute_map = {
'blob': {'key': 'blob', 'type': 'EncryptionService'},
'file': {'key': 'file', 'type': 'EncryptionService'},
Expand All @@ -805,8 +804,8 @@ def __init__(self, **kwargs):
super(EncryptionServices, self).__init__(**kwargs)
self.blob = kwargs.get('blob', None)
self.file = kwargs.get('file', None)
self.table = None
self.queue = None
self.table = kwargs.get('table', None)
self.queue = kwargs.get('queue', None)


class Endpoints(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,11 @@ class EncryptionService(Model):
enabled. There might be some unencrypted blobs which were written after
this time, as it is just a rough estimate.
:vartype last_enabled_time: datetime
:param key_type: Encryption key type to be used for the encryption
service. 'Account' key type implies that an account-scoped encryption key
will be used. 'Service' key type implies that a default service key is
used. Possible values include: 'Service', 'Account'
:type key_type: str or ~azure.mgmt.storage.v2019_06_01.models.KeyType
"""

_validation = {
Expand All @@ -765,48 +770,42 @@ class EncryptionService(Model):
_attribute_map = {
'enabled': {'key': 'enabled', 'type': 'bool'},
'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'},
'key_type': {'key': 'keyType', 'type': 'str'},
}

def __init__(self, *, enabled: bool=None, **kwargs) -> None:
def __init__(self, *, enabled: bool=None, key_type=None, **kwargs) -> None:
super(EncryptionService, self).__init__(**kwargs)
self.enabled = enabled
self.last_enabled_time = None
self.key_type = key_type


class EncryptionServices(Model):
"""A list of services that support encryption.

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

:param blob: The encryption function of the blob storage service.
:type blob: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:param file: The encryption function of the file storage service.
:type file: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:ivar table: The encryption function of the table storage service.
:vartype table: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:ivar queue: The encryption function of the queue storage service.
:vartype queue: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:param table: The encryption function of the table storage service.
:type table: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
:param queue: The encryption function of the queue storage service.
:type queue: ~azure.mgmt.storage.v2019_06_01.models.EncryptionService
"""

_validation = {
'table': {'readonly': True},
'queue': {'readonly': True},
}

_attribute_map = {
'blob': {'key': 'blob', 'type': 'EncryptionService'},
'file': {'key': 'file', 'type': 'EncryptionService'},
'table': {'key': 'table', 'type': 'EncryptionService'},
'queue': {'key': 'queue', 'type': 'EncryptionService'},
}

def __init__(self, *, blob=None, file=None, **kwargs) -> None:
def __init__(self, *, blob=None, file=None, table=None, queue=None, **kwargs) -> None:
super(EncryptionServices, self).__init__(**kwargs)
self.blob = blob
self.file = file
self.table = None
self.queue = None
self.table = table
self.queue = queue


class Endpoints(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ class Reason(str, Enum):
already_exists = "AlreadyExists"


class KeyType(str, Enum):

service = "Service"
account = "Account"


class KeySource(str, Enum):

microsoft_storage = "Microsoft.Storage"
Expand Down