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

[AutoPR azure-mgmt-storage] [SRP] Add blob service property for container soft delete #479

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
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,19 @@ def blob_services(self):
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 encryption_scopes(self):
"""Instance depends on the API version:

* 2019-06-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2019_06_01.operations.EncryptionScopesOperations>`
"""
api_version = self._get_api_version('encryption_scopes')
if api_version == '2019-06-01':
from .v2019_06_01.operations import EncryptionScopesOperations 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 file_services(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .operations import ManagementPoliciesOperations
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from .operations import EncryptionScopesOperations
from .operations import BlobServicesOperations
from .operations import BlobContainersOperations
from .operations import FileServicesOperations
Expand Down Expand Up @@ -47,6 +48,8 @@ class StorageManagementClient(SDKClient):
:vartype private_endpoint_connections: azure.mgmt.storage.v2019_06_01.operations.PrivateEndpointConnectionsOperations
:ivar private_link_resources: PrivateLinkResources operations
:vartype private_link_resources: azure.mgmt.storage.v2019_06_01.operations.PrivateLinkResourcesOperations
:ivar encryption_scopes: EncryptionScopes operations
:vartype encryption_scopes: azure.mgmt.storage.v2019_06_01.operations.EncryptionScopesOperations
:ivar blob_services: BlobServices operations
:vartype blob_services: azure.mgmt.storage.v2019_06_01.operations.BlobServicesOperations
:ivar blob_containers: BlobContainers operations
Expand Down Expand Up @@ -89,6 +92,8 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.private_link_resources = PrivateLinkResourcesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.encryption_scopes = EncryptionScopesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.blob_services = BlobServicesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.blob_containers = BlobContainersOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
from ._models_py3 import DeleteRetentionPolicy
from ._models_py3 import Dimension
from ._models_py3 import Encryption
from ._models_py3 import EncryptionScope
from ._models_py3 import EncryptionScopeKeyVaultProperties
from ._models_py3 import EncryptionService
from ._models_py3 import EncryptionServices
from ._models_py3 import Endpoints
Expand Down Expand Up @@ -112,6 +114,8 @@
from ._models import DeleteRetentionPolicy
from ._models import Dimension
from ._models import Encryption
from ._models import EncryptionScope
from ._models import EncryptionScopeKeyVaultProperties
from ._models import EncryptionService
from ._models import EncryptionServices
from ._models import Endpoints
Expand Down Expand Up @@ -176,6 +180,7 @@
from ._models import UsageName
from ._models import VirtualNetworkRule
from ._paged_models import BlobServicePropertiesPaged
from ._paged_models import EncryptionScopePaged
from ._paged_models import FileShareItemPaged
from ._paged_models import ListContainerItemPaged
from ._paged_models import OperationPaged
Expand Down Expand Up @@ -211,6 +216,8 @@
Permissions,
HttpProtocol,
SignedResource,
EncryptionScopeSource,
EncryptionScopeState,
PublicAccess,
LeaseStatus,
LeaseState,
Expand Down Expand Up @@ -241,6 +248,8 @@
'DeleteRetentionPolicy',
'Dimension',
'Encryption',
'EncryptionScope',
'EncryptionScopeKeyVaultProperties',
'EncryptionService',
'EncryptionServices',
'Endpoints',
Expand Down Expand Up @@ -308,6 +317,7 @@
'SkuInformationPaged',
'StorageAccountPaged',
'UsagePaged',
'EncryptionScopePaged',
'BlobServicePropertiesPaged',
'ListContainerItemPaged',
'FileShareItemPaged',
Expand Down Expand Up @@ -339,6 +349,8 @@
'Permissions',
'HttpProtocol',
'SignedResource',
'EncryptionScopeSource',
'EncryptionScopeState',
'PublicAccess',
'LeaseStatus',
'LeaseState',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,15 +467,21 @@ class BlobServiceProperties(Resource):
delete.
:type delete_retention_policy:
~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy
:param automatic_snapshot_policy_enabled: Automatic Snapshot is enabled if
set to true.
:param is_versioning_enabled: Versioning is enabled if set to true.
:type is_versioning_enabled: bool
:param automatic_snapshot_policy_enabled: Deprecated in favor of
isVersioningEnabled property.
:type automatic_snapshot_policy_enabled: bool
:param change_feed: The blob service properties for change feed events.
:type change_feed: ~azure.mgmt.storage.v2019_06_01.models.ChangeFeed
:param restore_policy: The blob service properties for blob restore
policy.
:type restore_policy:
~azure.mgmt.storage.v2019_06_01.models.RestorePolicyProperties
:param container_delete_retention_policy: The blob service properties for
container soft delete.
:type container_delete_retention_policy:
~azure.mgmt.storage.v2019_06_01.models.DeleteRetentionPolicy
:ivar sku: Sku name and tier.
:vartype sku: ~azure.mgmt.storage.v2019_06_01.models.Sku
"""
Expand All @@ -494,9 +500,11 @@ class BlobServiceProperties(Resource):
'cors': {'key': 'properties.cors', 'type': 'CorsRules'},
'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'},
'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'},
'is_versioning_enabled': {'key': 'properties.isVersioningEnabled', 'type': 'bool'},
'automatic_snapshot_policy_enabled': {'key': 'properties.automaticSnapshotPolicyEnabled', 'type': 'bool'},
'change_feed': {'key': 'properties.changeFeed', 'type': 'ChangeFeed'},
'restore_policy': {'key': 'properties.restorePolicy', 'type': 'RestorePolicyProperties'},
'container_delete_retention_policy': {'key': 'properties.containerDeleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'},
'sku': {'key': 'sku', 'type': 'Sku'},
}

Expand All @@ -505,9 +513,11 @@ def __init__(self, **kwargs):
self.cors = kwargs.get('cors', None)
self.default_service_version = kwargs.get('default_service_version', None)
self.delete_retention_policy = kwargs.get('delete_retention_policy', None)
self.is_versioning_enabled = kwargs.get('is_versioning_enabled', None)
self.automatic_snapshot_policy_enabled = kwargs.get('automatic_snapshot_policy_enabled', None)
self.change_feed = kwargs.get('change_feed', None)
self.restore_policy = kwargs.get('restore_policy', None)
self.container_delete_retention_policy = kwargs.get('container_delete_retention_policy', None)
self.sku = None


Expand Down Expand Up @@ -847,6 +857,91 @@ def __init__(self, **kwargs):
self.key_vault_properties = kwargs.get('key_vault_properties', None)


class EncryptionScope(Resource):
"""The Encryption Scope resource.

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

:ivar id: Fully qualified resource Id for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:vartype type: str
:param source: The provider for the encryption scope. Possible values
(case-insensitive): Microsoft.Storage, Microsoft.KeyVault. Possible
values include: 'Microsoft.Storage', 'Microsoft.KeyVault'
:type source: str or
~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeSource
:param state: The state of the encryption scope. Possible values
(case-insensitive): Enabled, Disabled. Possible values include:
'Enabled', 'Disabled'
:type state: str or
~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeState
:ivar creation_time: Gets the creation date and time of the encryption
scope in UTC.
:vartype creation_time: datetime
:ivar last_modified_time: Gets the last modification date and time of the
encryption scope in UTC.
:vartype last_modified_time: datetime
:param key_vault_properties: The key vault properties for the encryption
scope. This is a required field if encryption scope 'source' attribute is
set to 'Microsoft.KeyVault'.
:type key_vault_properties:
~azure.mgmt.storage.v2019_06_01.models.EncryptionScopeKeyVaultProperties
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'creation_time': {'readonly': True},
'last_modified_time': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'source': {'key': 'properties.source', 'type': 'str'},
'state': {'key': 'properties.state', 'type': 'str'},
'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'},
'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'},
'key_vault_properties': {'key': 'properties.keyVaultProperties', 'type': 'EncryptionScopeKeyVaultProperties'},
}

def __init__(self, **kwargs):
super(EncryptionScope, self).__init__(**kwargs)
self.source = kwargs.get('source', None)
self.state = kwargs.get('state', None)
self.creation_time = None
self.last_modified_time = None
self.key_vault_properties = kwargs.get('key_vault_properties', None)


class EncryptionScopeKeyVaultProperties(Model):
"""The key vault properties for the encryption scope. This is a required field
if encryption scope 'source' attribute is set to 'Microsoft.KeyVault'.

:param key_uri: The object identifier for a key vault key object. When
applied, the encryption scope will use the key referenced by the
identifier to enable customer-managed key support on this encryption
scope.
:type key_uri: str
"""

_attribute_map = {
'key_uri': {'key': 'keyUri', 'type': 'str'},
}

def __init__(self, **kwargs):
super(EncryptionScopeKeyVaultProperties, self).__init__(**kwargs)
self.key_uri = kwargs.get('key_uri', None)


class EncryptionService(Model):
"""A service that allows server-side encryption to be used.

Expand Down Expand Up @@ -1279,8 +1374,6 @@ class ImmutabilityPolicy(AzureEntityResource):
Variables are only populated by the server, and will be ignored when
sending a request.

All required parameters must be populated in order to send to Azure.

:ivar id: Fully qualified resource Id for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
Expand All @@ -1291,23 +1384,28 @@ class ImmutabilityPolicy(AzureEntityResource):
:vartype type: str
:ivar etag: Resource Etag.
:vartype etag: str
:param immutability_period_since_creation_in_days: Required. The
immutability period for the blobs in the container since the policy
creation, in days.
:param immutability_period_since_creation_in_days: The immutability period
for the blobs in the container since the policy creation, in days.
:type immutability_period_since_creation_in_days: int
:ivar state: The ImmutabilityPolicy state of a blob container, possible
values include: Locked and Unlocked. Possible values include: 'Locked',
'Unlocked'
:vartype state: str or
~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState
:param allow_protected_append_writes: This property can only be changed
for unlocked time-based retention policies. When enabled, new blocks can
be written to an append blob while maintaining immutability protection and
compliance. Only new blocks can be added and any existing blocks cannot be
modified or deleted. This property cannot be changed with
ExtendImmutabilityPolicy API
:type allow_protected_append_writes: bool
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'etag': {'readonly': True},
'immutability_period_since_creation_in_days': {'required': True},
'state': {'readonly': True},
}

Expand All @@ -1318,12 +1416,14 @@ class ImmutabilityPolicy(AzureEntityResource):
'etag': {'key': 'etag', 'type': 'str'},
'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'},
'state': {'key': 'properties.state', 'type': 'str'},
'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'},
}

def __init__(self, **kwargs):
super(ImmutabilityPolicy, self).__init__(**kwargs)
self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None)
self.state = None
self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None)


class ImmutabilityPolicyProperties(Model):
Expand All @@ -1332,17 +1432,21 @@ class ImmutabilityPolicyProperties(Model):
Variables are only populated by the server, and will be ignored when
sending a request.

All required parameters must be populated in order to send to Azure.

:param immutability_period_since_creation_in_days: Required. The
immutability period for the blobs in the container since the policy
creation, in days.
:param immutability_period_since_creation_in_days: The immutability period
for the blobs in the container since the policy creation, in days.
:type immutability_period_since_creation_in_days: int
:ivar state: The ImmutabilityPolicy state of a blob container, possible
values include: Locked and Unlocked. Possible values include: 'Locked',
'Unlocked'
:vartype state: str or
~azure.mgmt.storage.v2019_06_01.models.ImmutabilityPolicyState
:param allow_protected_append_writes: This property can only be changed
for unlocked time-based retention policies. When enabled, new blocks can
be written to an append blob while maintaining immutability protection and
compliance. Only new blocks can be added and any existing blocks cannot be
modified or deleted. This property cannot be changed with
ExtendImmutabilityPolicy API
:type allow_protected_append_writes: bool
:ivar etag: ImmutabilityPolicy Etag.
:vartype etag: str
:ivar update_history: The ImmutabilityPolicy update history of the blob
Expand All @@ -1352,7 +1456,6 @@ class ImmutabilityPolicyProperties(Model):
"""

_validation = {
'immutability_period_since_creation_in_days': {'required': True},
'state': {'readonly': True},
'etag': {'readonly': True},
'update_history': {'readonly': True},
Expand All @@ -1361,6 +1464,7 @@ class ImmutabilityPolicyProperties(Model):
_attribute_map = {
'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'},
'state': {'key': 'properties.state', 'type': 'str'},
'allow_protected_append_writes': {'key': 'properties.allowProtectedAppendWrites', 'type': 'bool'},
'etag': {'key': 'etag', 'type': 'str'},
'update_history': {'key': 'updateHistory', 'type': '[UpdateHistoryProperty]'},
}
Expand All @@ -1369,6 +1473,7 @@ def __init__(self, **kwargs):
super(ImmutabilityPolicyProperties, self).__init__(**kwargs)
self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None)
self.state = None
self.allow_protected_append_writes = kwargs.get('allow_protected_append_writes', None)
self.etag = None
self.update_history = None

Expand Down
Loading