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] update storage python.md for track2 #10853

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 @@ -237,6 +237,19 @@ def management_policies(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 object_replication_policies(self):
"""Instance depends on the API version:

* 2019-06-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2019_06_01.operations.ObjectReplicationPoliciesOperations>`
"""
api_version = self._get_api_version('object_replication_policies')
if api_version == '2019-06-01':
from .v2019_06_01.operations import ObjectReplicationPoliciesOperations 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:
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 ObjectReplicationPoliciesOperations
from .operations import EncryptionScopesOperations
from .operations import BlobServicesOperations
from .operations import BlobContainersOperations
Expand Down Expand Up @@ -48,6 +49,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 object_replication_policies: ObjectReplicationPolicies operations
:vartype object_replication_policies: azure.mgmt.storage.v2019_06_01.operations.ObjectReplicationPoliciesOperations
:ivar encryption_scopes: EncryptionScopes operations
:vartype encryption_scopes: azure.mgmt.storage.v2019_06_01.operations.EncryptionScopesOperations
:ivar blob_services: BlobServices operations
Expand Down Expand Up @@ -92,6 +95,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.object_replication_policies = ObjectReplicationPoliciesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.encryption_scopes = EncryptionScopesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.blob_services = BlobServicesOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
from ._models_py3 import ManagementPolicySnapShot
from ._models_py3 import MetricSpecification
from ._models_py3 import NetworkRuleSet
from ._models_py3 import ObjectReplicationPolicy
from ._models_py3 import ObjectReplicationPolicyFilter
from ._models_py3 import ObjectReplicationPolicyRule
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import PrivateEndpoint
Expand Down Expand Up @@ -147,6 +150,9 @@
from ._models import ManagementPolicySnapShot
from ._models import MetricSpecification
from ._models import NetworkRuleSet
from ._models import ObjectReplicationPolicy
from ._models import ObjectReplicationPolicyFilter
from ._models import ObjectReplicationPolicyRule
from ._models import Operation
from ._models import OperationDisplay
from ._models import PrivateEndpoint
Expand Down Expand Up @@ -183,6 +189,7 @@
from ._paged_models import EncryptionScopePaged
from ._paged_models import FileShareItemPaged
from ._paged_models import ListContainerItemPaged
from ._paged_models import ObjectReplicationPolicyPaged
from ._paged_models import OperationPaged
from ._paged_models import SkuInformationPaged
from ._paged_models import StorageAccountPaged
Expand Down Expand Up @@ -281,6 +288,9 @@
'ManagementPolicySnapShot',
'MetricSpecification',
'NetworkRuleSet',
'ObjectReplicationPolicy',
'ObjectReplicationPolicyFilter',
'ObjectReplicationPolicyRule',
'Operation',
'OperationDisplay',
'PrivateEndpoint',
Expand Down Expand Up @@ -317,6 +327,7 @@
'SkuInformationPaged',
'StorageAccountPaged',
'UsagePaged',
'ObjectReplicationPolicyPaged',
'EncryptionScopePaged',
'BlobServicePropertiesPaged',
'ListContainerItemPaged',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,11 @@ class BlobRestoreRange(Model):

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

:param start_range: Required. Blob start range. Empty means account start.
:param start_range: Required. Blob start range. This is inclusive. Empty
means account start.
:type start_range: str
:param end_range: Required. Blob end range. Empty means account end.
:param end_range: Required. Blob end range. This is exclusive. Empty means
account end.
:type end_range: str
"""

Expand Down Expand Up @@ -2191,6 +2193,130 @@ def __init__(self, **kwargs):
self.default_action = kwargs.get('default_action', "Allow")


class ObjectReplicationPolicy(Resource):
"""The replication policy between two storage accounts. Multiple rules can be
defined in one policy.

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
: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
:ivar policy_id: A unique id for object replication policy.
:vartype policy_id: str
:ivar enabled_time: Indicates when the policy is enabled on the source
account.
:vartype enabled_time: datetime
:param source_account: Required. Required. Source account name.
:type source_account: str
:param destination_account: Required. Required. Destination account name.
:type destination_account: str
:param rules: The storage account object replication rules.
:type rules:
list[~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicyRule]
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'policy_id': {'readonly': True},
'enabled_time': {'readonly': True},
'source_account': {'required': True},
'destination_account': {'required': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'policy_id': {'key': 'properties.policyId', 'type': 'str'},
'enabled_time': {'key': 'properties.enabledTime', 'type': 'iso-8601'},
'source_account': {'key': 'properties.sourceAccount', 'type': 'str'},
'destination_account': {'key': 'properties.destinationAccount', 'type': 'str'},
'rules': {'key': 'properties.rules', 'type': '[ObjectReplicationPolicyRule]'},
}

def __init__(self, **kwargs):
super(ObjectReplicationPolicy, self).__init__(**kwargs)
self.policy_id = None
self.enabled_time = None
self.source_account = kwargs.get('source_account', None)
self.destination_account = kwargs.get('destination_account', None)
self.rules = kwargs.get('rules', None)


class ObjectReplicationPolicyFilter(Model):
"""Filters limit replication to a subset of blobs within the storage account.
A logical OR is performed on values in the filter. If multiple filters are
defined, a logical AND is performed on all filters.

:param prefix_match: Optional. Filters the results to replicate only blobs
whose names begin with the specified prefix.
:type prefix_match: list[str]
:param min_creation_time: Blobs created after the time will be replicated
to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'.
Example: 2020-02-19T16:05:00Z
:type min_creation_time: str
"""

_attribute_map = {
'prefix_match': {'key': 'prefixMatch', 'type': '[str]'},
'min_creation_time': {'key': 'minCreationTime', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ObjectReplicationPolicyFilter, self).__init__(**kwargs)
self.prefix_match = kwargs.get('prefix_match', None)
self.min_creation_time = kwargs.get('min_creation_time', None)


class ObjectReplicationPolicyRule(Model):
"""The replication policy rule between two containers.

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

:param rule_id: Rule Id is auto-generated for each new rule on destination
account. It is required for put policy on source account.
:type rule_id: str
:param source_container: Required. Required. Source container name.
:type source_container: str
:param destination_container: Required. Required. Destination container
name.
:type destination_container: str
:param filters: Optional. An object that defines the filter set.
:type filters:
~azure.mgmt.storage.v2019_06_01.models.ObjectReplicationPolicyFilter
"""

_validation = {
'source_container': {'required': True},
'destination_container': {'required': True},
}

_attribute_map = {
'rule_id': {'key': 'ruleId', 'type': 'str'},
'source_container': {'key': 'sourceContainer', 'type': 'str'},
'destination_container': {'key': 'destinationContainer', 'type': 'str'},
'filters': {'key': 'filters', 'type': 'ObjectReplicationPolicyFilter'},
}

def __init__(self, **kwargs):
super(ObjectReplicationPolicyRule, self).__init__(**kwargs)
self.rule_id = kwargs.get('rule_id', None)
self.source_container = kwargs.get('source_container', None)
self.destination_container = kwargs.get('destination_container', None)
self.filters = kwargs.get('filters', None)


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

Expand Down Expand Up @@ -2455,29 +2581,38 @@ def __init__(self, **kwargs):
class RestorePolicyProperties(Model):
"""The blob service properties for blob restore policy.

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 enabled: Required. Blob restore is enabled if set to true.
:type enabled: bool
:param days: how long this blob can be restored. It should be great than
zero and less than DeleteRetentionPolicy.days.
:type days: int
:ivar last_enabled_time: Returns the date and time the restore policy was
last enabled.
:vartype last_enabled_time: datetime
"""

_validation = {
'enabled': {'required': True},
'days': {'maximum': 365, 'minimum': 1},
'last_enabled_time': {'readonly': True},
}

_attribute_map = {
'enabled': {'key': 'enabled', 'type': 'bool'},
'days': {'key': 'days', 'type': 'int'},
'last_enabled_time': {'key': 'lastEnabledTime', 'type': 'iso-8601'},
}

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


class Restriction(Model):
Expand Down
Loading