Skip to content

Commit ade0c7d

Browse files
AutorestCIlmazuel
authored andcommitted
[AutoPR] storage/resource-manager (#3712)
* [AutoPR storage/resource-manager] Support for SRP BlobServiceProperties API (#3684) * Generated from c2b7a3b94ad0e66549b8fd915196892eeabfe349 Support for SRP BlobServiceProperties API * Packaging update of azure-mgmt-storage * Generated from 5f13feda58d8622708a190403ba2d4745a12ed61 Address CR comments; fix java section in readme.md * Generated from 1f26996e492bf786c2acd06e0a4e46159c52df70 (#3792) Adds storage account quick failover API * [AutoPR storage/resource-manager] Adds Geo Replication Stats in Azure Storage Account's properties (#3789) * Generated from 6363da5bf9a13499463df8ff5e443801d064ab84 Adds Geo Replication Stats in Azure Storage Account's properties * Generated from 126237ac76d98075599b17e0032c37e0af486e8b Merge branch 'master' into adds_geo_replication_stats * 3.1.0
1 parent 1472405 commit ade0c7d

22 files changed

+863
-2
lines changed

azure-mgmt-storage/HISTORY.rst

+11
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
Release History
44
===============
55

6+
3.1.0 (2018-11-15)
7+
++++++++++++++++++
8+
9+
**Features**
10+
11+
- Model StorageAccount has a new parameter geo_replication_stats
12+
- Model StorageAccount has a new parameter failover_in_progress
13+
- Added operation StorageAccountsOperations.failover
14+
- Added operation group BlobServicesOperations
15+
- Operation StorageAccountsOperations.get_properties now support expand parameter
16+
617
3.0.0 (2018-09-27)
718
++++++++++++++++++
819

azure-mgmt-storage/MANIFEST.in

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
include *.rst
2+
include azure/__init__.py
3+
include azure/mgmt/__init__.py
4+

azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py

+13
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,19 @@ def blob_containers(self):
162162
raise NotImplementedError("APIVersion {} is not available".format(api_version))
163163
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
164164

165+
@property
166+
def blob_services(self):
167+
"""Instance depends on the API version:
168+
169+
* 2018-07-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2018_07_01.operations.BlobServicesOperations>`
170+
"""
171+
api_version = self._get_api_version('blob_services')
172+
if api_version == '2018-07-01':
173+
from .v2018_07_01.operations import BlobServicesOperations as OperationClass
174+
else:
175+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
176+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
177+
165178
@property
166179
def management_policies(self):
167180
"""Instance depends on the API version:

azure-mgmt-storage/azure/mgmt/storage/v2018_07_01/models/__init__.py

+19
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from .identity_py3 import Identity
3232
from .storage_account_create_parameters_py3 import StorageAccountCreateParameters
3333
from .endpoints_py3 import Endpoints
34+
from .geo_replication_stats_py3 import GeoReplicationStats
3435
from .storage_account_py3 import StorageAccount
3536
from .storage_account_key_py3 import StorageAccountKey
3637
from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult
@@ -55,6 +56,10 @@
5556
from .legal_hold_py3 import LegalHold
5657
from .list_container_item_py3 import ListContainerItem
5758
from .list_container_items_py3 import ListContainerItems
59+
from .cors_rule_py3 import CorsRule
60+
from .cors_rules_py3 import CorsRules
61+
from .delete_retention_policy_py3 import DeleteRetentionPolicy
62+
from .blob_service_properties_py3 import BlobServiceProperties
5863
from .storage_account_management_policies_py3 import StorageAccountManagementPolicies
5964
from .management_policies_rules_set_parameter_py3 import ManagementPoliciesRulesSetParameter
6065
except (SyntaxError, ImportError):
@@ -79,6 +84,7 @@
7984
from .identity import Identity
8085
from .storage_account_create_parameters import StorageAccountCreateParameters
8186
from .endpoints import Endpoints
87+
from .geo_replication_stats import GeoReplicationStats
8288
from .storage_account import StorageAccount
8389
from .storage_account_key import StorageAccountKey
8490
from .storage_account_list_keys_result import StorageAccountListKeysResult
@@ -103,6 +109,10 @@
103109
from .legal_hold import LegalHold
104110
from .list_container_item import ListContainerItem
105111
from .list_container_items import ListContainerItems
112+
from .cors_rule import CorsRule
113+
from .cors_rules import CorsRules
114+
from .delete_retention_policy import DeleteRetentionPolicy
115+
from .blob_service_properties import BlobServiceProperties
106116
from .storage_account_management_policies import StorageAccountManagementPolicies
107117
from .management_policies_rules_set_parameter import ManagementPoliciesRulesSetParameter
108118
from .operation_paged import OperationPaged
@@ -121,6 +131,7 @@
121131
Bypass,
122132
DefaultAction,
123133
AccessTier,
134+
GeoReplicationStatus,
124135
ProvisioningState,
125136
AccountStatus,
126137
KeyPermission,
@@ -136,6 +147,7 @@
136147
LeaseDuration,
137148
ImmutabilityPolicyState,
138149
ImmutabilityPolicyUpdateType,
150+
StorageAccountExpand,
139151
)
140152

141153
__all__ = [
@@ -160,6 +172,7 @@
160172
'Identity',
161173
'StorageAccountCreateParameters',
162174
'Endpoints',
175+
'GeoReplicationStats',
163176
'StorageAccount',
164177
'StorageAccountKey',
165178
'StorageAccountListKeysResult',
@@ -184,6 +197,10 @@
184197
'LegalHold',
185198
'ListContainerItem',
186199
'ListContainerItems',
200+
'CorsRule',
201+
'CorsRules',
202+
'DeleteRetentionPolicy',
203+
'BlobServiceProperties',
187204
'StorageAccountManagementPolicies',
188205
'ManagementPoliciesRulesSetParameter',
189206
'OperationPaged',
@@ -201,6 +218,7 @@
201218
'Bypass',
202219
'DefaultAction',
203220
'AccessTier',
221+
'GeoReplicationStatus',
204222
'ProvisioningState',
205223
'AccountStatus',
206224
'KeyPermission',
@@ -216,4 +234,5 @@
216234
'LeaseDuration',
217235
'ImmutabilityPolicyState',
218236
'ImmutabilityPolicyUpdateType',
237+
'StorageAccountExpand',
219238
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from .resource import Resource
13+
14+
15+
class BlobServiceProperties(Resource):
16+
"""The properties of a storage account’s Blob service.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:ivar id: Fully qualified resource Id for the resource. Ex -
22+
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
23+
:vartype id: str
24+
:ivar name: The name of the resource
25+
:vartype name: str
26+
:ivar type: The type of the resource. Ex-
27+
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
28+
:vartype type: str
29+
:param cors: Specifies CORS rules for the Blob service. You can include up
30+
to five CorsRule elements in the request. If no CorsRule elements are
31+
included in the request body, all CORS rules will be deleted, and CORS
32+
will be disabled for the Blob service.
33+
:type cors: ~azure.mgmt.storage.v2018_07_01.models.CorsRules
34+
:param default_service_version: DefaultServiceVersion indicates the
35+
default version to use for requests to the Blob service if an incoming
36+
request’s version is not specified. Possible values include version
37+
2008-10-27 and all more recent versions.
38+
:type default_service_version: str
39+
:param delete_retention_policy: The blob service properties for soft
40+
delete.
41+
:type delete_retention_policy:
42+
~azure.mgmt.storage.v2018_07_01.models.DeleteRetentionPolicy
43+
"""
44+
45+
_validation = {
46+
'id': {'readonly': True},
47+
'name': {'readonly': True},
48+
'type': {'readonly': True},
49+
}
50+
51+
_attribute_map = {
52+
'id': {'key': 'id', 'type': 'str'},
53+
'name': {'key': 'name', 'type': 'str'},
54+
'type': {'key': 'type', 'type': 'str'},
55+
'cors': {'key': 'properties.cors', 'type': 'CorsRules'},
56+
'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'},
57+
'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'},
58+
}
59+
60+
def __init__(self, **kwargs):
61+
super(BlobServiceProperties, self).__init__(**kwargs)
62+
self.cors = kwargs.get('cors', None)
63+
self.default_service_version = kwargs.get('default_service_version', None)
64+
self.delete_retention_policy = kwargs.get('delete_retention_policy', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from .resource_py3 import Resource
13+
14+
15+
class BlobServiceProperties(Resource):
16+
"""The properties of a storage account’s Blob service.
17+
18+
Variables are only populated by the server, and will be ignored when
19+
sending a request.
20+
21+
:ivar id: Fully qualified resource Id for the resource. Ex -
22+
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
23+
:vartype id: str
24+
:ivar name: The name of the resource
25+
:vartype name: str
26+
:ivar type: The type of the resource. Ex-
27+
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
28+
:vartype type: str
29+
:param cors: Specifies CORS rules for the Blob service. You can include up
30+
to five CorsRule elements in the request. If no CorsRule elements are
31+
included in the request body, all CORS rules will be deleted, and CORS
32+
will be disabled for the Blob service.
33+
:type cors: ~azure.mgmt.storage.v2018_07_01.models.CorsRules
34+
:param default_service_version: DefaultServiceVersion indicates the
35+
default version to use for requests to the Blob service if an incoming
36+
request’s version is not specified. Possible values include version
37+
2008-10-27 and all more recent versions.
38+
:type default_service_version: str
39+
:param delete_retention_policy: The blob service properties for soft
40+
delete.
41+
:type delete_retention_policy:
42+
~azure.mgmt.storage.v2018_07_01.models.DeleteRetentionPolicy
43+
"""
44+
45+
_validation = {
46+
'id': {'readonly': True},
47+
'name': {'readonly': True},
48+
'type': {'readonly': True},
49+
}
50+
51+
_attribute_map = {
52+
'id': {'key': 'id', 'type': 'str'},
53+
'name': {'key': 'name', 'type': 'str'},
54+
'type': {'key': 'type', 'type': 'str'},
55+
'cors': {'key': 'properties.cors', 'type': 'CorsRules'},
56+
'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'},
57+
'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'},
58+
}
59+
60+
def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, **kwargs) -> None:
61+
super(BlobServiceProperties, self).__init__(**kwargs)
62+
self.cors = cors
63+
self.default_service_version = default_service_version
64+
self.delete_retention_policy = delete_retention_policy
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class CorsRule(Model):
16+
"""Specifies a CORS rule for the Blob service.
17+
18+
All required parameters must be populated in order to send to Azure.
19+
20+
:param allowed_origins: Required. Required if CorsRule element is present.
21+
A list of origin domains that will be allowed via CORS, or "*" to allow
22+
all domains
23+
:type allowed_origins: list[str]
24+
:param allowed_methods: Required. Required if CorsRule element is present.
25+
A list of HTTP methods that are allowed to be executed by the origin.
26+
:type allowed_methods: list[str]
27+
:param max_age_in_seconds: Required. Required if CorsRule element is
28+
present. The number of seconds that the client/browser should cache a
29+
preflight response.
30+
:type max_age_in_seconds: int
31+
:param exposed_headers: Required. Required if CorsRule element is present.
32+
A list of response headers to expose to CORS clients.
33+
:type exposed_headers: list[str]
34+
:param allowed_headers: Required. Required if CorsRule element is present.
35+
A list of headers allowed to be part of the cross-origin request.
36+
:type allowed_headers: list[str]
37+
"""
38+
39+
_validation = {
40+
'allowed_origins': {'required': True},
41+
'allowed_methods': {'required': True},
42+
'max_age_in_seconds': {'required': True},
43+
'exposed_headers': {'required': True},
44+
'allowed_headers': {'required': True},
45+
}
46+
47+
_attribute_map = {
48+
'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'},
49+
'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'},
50+
'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'},
51+
'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'},
52+
'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'},
53+
}
54+
55+
def __init__(self, **kwargs):
56+
super(CorsRule, self).__init__(**kwargs)
57+
self.allowed_origins = kwargs.get('allowed_origins', None)
58+
self.allowed_methods = kwargs.get('allowed_methods', None)
59+
self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None)
60+
self.exposed_headers = kwargs.get('exposed_headers', None)
61+
self.allowed_headers = kwargs.get('allowed_headers', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.serialization import Model
13+
14+
15+
class CorsRule(Model):
16+
"""Specifies a CORS rule for the Blob service.
17+
18+
All required parameters must be populated in order to send to Azure.
19+
20+
:param allowed_origins: Required. Required if CorsRule element is present.
21+
A list of origin domains that will be allowed via CORS, or "*" to allow
22+
all domains
23+
:type allowed_origins: list[str]
24+
:param allowed_methods: Required. Required if CorsRule element is present.
25+
A list of HTTP methods that are allowed to be executed by the origin.
26+
:type allowed_methods: list[str]
27+
:param max_age_in_seconds: Required. Required if CorsRule element is
28+
present. The number of seconds that the client/browser should cache a
29+
preflight response.
30+
:type max_age_in_seconds: int
31+
:param exposed_headers: Required. Required if CorsRule element is present.
32+
A list of response headers to expose to CORS clients.
33+
:type exposed_headers: list[str]
34+
:param allowed_headers: Required. Required if CorsRule element is present.
35+
A list of headers allowed to be part of the cross-origin request.
36+
:type allowed_headers: list[str]
37+
"""
38+
39+
_validation = {
40+
'allowed_origins': {'required': True},
41+
'allowed_methods': {'required': True},
42+
'max_age_in_seconds': {'required': True},
43+
'exposed_headers': {'required': True},
44+
'allowed_headers': {'required': True},
45+
}
46+
47+
_attribute_map = {
48+
'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'},
49+
'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'},
50+
'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'},
51+
'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'},
52+
'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'},
53+
}
54+
55+
def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None:
56+
super(CorsRule, self).__init__(**kwargs)
57+
self.allowed_origins = allowed_origins
58+
self.allowed_methods = allowed_methods
59+
self.max_age_in_seconds = max_age_in_seconds
60+
self.exposed_headers = exposed_headers
61+
self.allowed_headers = allowed_headers

0 commit comments

Comments
 (0)