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] storage/resource-manager #3712

Merged
merged 5 commits into from
Nov 16, 2018
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
11 changes: 11 additions & 0 deletions azure-mgmt-storage/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
Release History
===============

3.1.0 (2018-11-15)
++++++++++++++++++

**Features**

- Model StorageAccount has a new parameter geo_replication_stats
- Model StorageAccount has a new parameter failover_in_progress
- Added operation StorageAccountsOperations.failover
- Added operation group BlobServicesOperations
- Operation StorageAccountsOperations.get_properties now support expand parameter

3.0.0 (2018-09-27)
++++++++++++++++++

Expand Down
3 changes: 3 additions & 0 deletions azure-mgmt-storage/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py

13 changes: 13 additions & 0 deletions azure-mgmt-storage/azure/mgmt/storage/storage_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,19 @@ def blob_containers(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 blob_services(self):
"""Instance depends on the API version:

* 2018-07-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2018_07_01.operations.BlobServicesOperations>`
"""
api_version = self._get_api_version('blob_services')
if api_version == '2018-07-01':
from .v2018_07_01.operations import BlobServicesOperations 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 management_policies(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from .identity_py3 import Identity
from .storage_account_create_parameters_py3 import StorageAccountCreateParameters
from .endpoints_py3 import Endpoints
from .geo_replication_stats_py3 import GeoReplicationStats
from .storage_account_py3 import StorageAccount
from .storage_account_key_py3 import StorageAccountKey
from .storage_account_list_keys_result_py3 import StorageAccountListKeysResult
Expand All @@ -55,6 +56,10 @@
from .legal_hold_py3 import LegalHold
from .list_container_item_py3 import ListContainerItem
from .list_container_items_py3 import ListContainerItems
from .cors_rule_py3 import CorsRule
from .cors_rules_py3 import CorsRules
from .delete_retention_policy_py3 import DeleteRetentionPolicy
from .blob_service_properties_py3 import BlobServiceProperties
from .storage_account_management_policies_py3 import StorageAccountManagementPolicies
from .management_policies_rules_set_parameter_py3 import ManagementPoliciesRulesSetParameter
except (SyntaxError, ImportError):
Expand All @@ -79,6 +84,7 @@
from .identity import Identity
from .storage_account_create_parameters import StorageAccountCreateParameters
from .endpoints import Endpoints
from .geo_replication_stats import GeoReplicationStats
from .storage_account import StorageAccount
from .storage_account_key import StorageAccountKey
from .storage_account_list_keys_result import StorageAccountListKeysResult
Expand All @@ -103,6 +109,10 @@
from .legal_hold import LegalHold
from .list_container_item import ListContainerItem
from .list_container_items import ListContainerItems
from .cors_rule import CorsRule
from .cors_rules import CorsRules
from .delete_retention_policy import DeleteRetentionPolicy
from .blob_service_properties import BlobServiceProperties
from .storage_account_management_policies import StorageAccountManagementPolicies
from .management_policies_rules_set_parameter import ManagementPoliciesRulesSetParameter
from .operation_paged import OperationPaged
Expand All @@ -121,6 +131,7 @@
Bypass,
DefaultAction,
AccessTier,
GeoReplicationStatus,
ProvisioningState,
AccountStatus,
KeyPermission,
Expand All @@ -136,6 +147,7 @@
LeaseDuration,
ImmutabilityPolicyState,
ImmutabilityPolicyUpdateType,
StorageAccountExpand,
)

__all__ = [
Expand All @@ -160,6 +172,7 @@
'Identity',
'StorageAccountCreateParameters',
'Endpoints',
'GeoReplicationStats',
'StorageAccount',
'StorageAccountKey',
'StorageAccountListKeysResult',
Expand All @@ -184,6 +197,10 @@
'LegalHold',
'ListContainerItem',
'ListContainerItems',
'CorsRule',
'CorsRules',
'DeleteRetentionPolicy',
'BlobServiceProperties',
'StorageAccountManagementPolicies',
'ManagementPoliciesRulesSetParameter',
'OperationPaged',
Expand All @@ -201,6 +218,7 @@
'Bypass',
'DefaultAction',
'AccessTier',
'GeoReplicationStatus',
'ProvisioningState',
'AccountStatus',
'KeyPermission',
Expand All @@ -216,4 +234,5 @@
'LeaseDuration',
'ImmutabilityPolicyState',
'ImmutabilityPolicyUpdateType',
'StorageAccountExpand',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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 .resource import Resource


class BlobServiceProperties(Resource):
"""The properties of a storage account’s Blob service.

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 cors: Specifies CORS rules for the Blob service. You can include up
to five CorsRule elements in the request. If no CorsRule elements are
included in the request body, all CORS rules will be deleted, and CORS
will be disabled for the Blob service.
:type cors: ~azure.mgmt.storage.v2018_07_01.models.CorsRules
:param default_service_version: DefaultServiceVersion indicates the
default version to use for requests to the Blob service if an incoming
request’s version is not specified. Possible values include version
2008-10-27 and all more recent versions.
:type default_service_version: str
:param delete_retention_policy: The blob service properties for soft
delete.
:type delete_retention_policy:
~azure.mgmt.storage.v2018_07_01.models.DeleteRetentionPolicy
"""

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

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'cors': {'key': 'properties.cors', 'type': 'CorsRules'},
'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'},
'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'},
}

def __init__(self, **kwargs):
super(BlobServiceProperties, self).__init__(**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)
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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 .resource_py3 import Resource


class BlobServiceProperties(Resource):
"""The properties of a storage account’s Blob service.

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 cors: Specifies CORS rules for the Blob service. You can include up
to five CorsRule elements in the request. If no CorsRule elements are
included in the request body, all CORS rules will be deleted, and CORS
will be disabled for the Blob service.
:type cors: ~azure.mgmt.storage.v2018_07_01.models.CorsRules
:param default_service_version: DefaultServiceVersion indicates the
default version to use for requests to the Blob service if an incoming
request’s version is not specified. Possible values include version
2008-10-27 and all more recent versions.
:type default_service_version: str
:param delete_retention_policy: The blob service properties for soft
delete.
:type delete_retention_policy:
~azure.mgmt.storage.v2018_07_01.models.DeleteRetentionPolicy
"""

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

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'cors': {'key': 'properties.cors', 'type': 'CorsRules'},
'default_service_version': {'key': 'properties.defaultServiceVersion', 'type': 'str'},
'delete_retention_policy': {'key': 'properties.deleteRetentionPolicy', 'type': 'DeleteRetentionPolicy'},
}

def __init__(self, *, cors=None, default_service_version: str=None, delete_retention_policy=None, **kwargs) -> None:
super(BlobServiceProperties, self).__init__(**kwargs)
self.cors = cors
self.default_service_version = default_service_version
self.delete_retention_policy = delete_retention_policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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 CorsRule(Model):
"""Specifies a CORS rule for the Blob service.

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

:param allowed_origins: Required. Required if CorsRule element is present.
A list of origin domains that will be allowed via CORS, or "*" to allow
all domains
:type allowed_origins: list[str]
:param allowed_methods: Required. Required if CorsRule element is present.
A list of HTTP methods that are allowed to be executed by the origin.
:type allowed_methods: list[str]
:param max_age_in_seconds: Required. Required if CorsRule element is
present. The number of seconds that the client/browser should cache a
preflight response.
:type max_age_in_seconds: int
:param exposed_headers: Required. Required if CorsRule element is present.
A list of response headers to expose to CORS clients.
:type exposed_headers: list[str]
:param allowed_headers: Required. Required if CorsRule element is present.
A list of headers allowed to be part of the cross-origin request.
:type allowed_headers: list[str]
"""

_validation = {
'allowed_origins': {'required': True},
'allowed_methods': {'required': True},
'max_age_in_seconds': {'required': True},
'exposed_headers': {'required': True},
'allowed_headers': {'required': True},
}

_attribute_map = {
'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'},
'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'},
'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'},
'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'},
'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(CorsRule, self).__init__(**kwargs)
self.allowed_origins = kwargs.get('allowed_origins', None)
self.allowed_methods = kwargs.get('allowed_methods', None)
self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None)
self.exposed_headers = kwargs.get('exposed_headers', None)
self.allowed_headers = kwargs.get('allowed_headers', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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 CorsRule(Model):
"""Specifies a CORS rule for the Blob service.

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

:param allowed_origins: Required. Required if CorsRule element is present.
A list of origin domains that will be allowed via CORS, or "*" to allow
all domains
:type allowed_origins: list[str]
:param allowed_methods: Required. Required if CorsRule element is present.
A list of HTTP methods that are allowed to be executed by the origin.
:type allowed_methods: list[str]
:param max_age_in_seconds: Required. Required if CorsRule element is
present. The number of seconds that the client/browser should cache a
preflight response.
:type max_age_in_seconds: int
:param exposed_headers: Required. Required if CorsRule element is present.
A list of response headers to expose to CORS clients.
:type exposed_headers: list[str]
:param allowed_headers: Required. Required if CorsRule element is present.
A list of headers allowed to be part of the cross-origin request.
:type allowed_headers: list[str]
"""

_validation = {
'allowed_origins': {'required': True},
'allowed_methods': {'required': True},
'max_age_in_seconds': {'required': True},
'exposed_headers': {'required': True},
'allowed_headers': {'required': True},
}

_attribute_map = {
'allowed_origins': {'key': 'allowedOrigins', 'type': '[str]'},
'allowed_methods': {'key': 'allowedMethods', 'type': '[str]'},
'max_age_in_seconds': {'key': 'maxAgeInSeconds', 'type': 'int'},
'exposed_headers': {'key': 'exposedHeaders', 'type': '[str]'},
'allowed_headers': {'key': 'allowedHeaders', 'type': '[str]'},
}

def __init__(self, *, allowed_origins, allowed_methods, max_age_in_seconds: int, exposed_headers, allowed_headers, **kwargs) -> None:
super(CorsRule, self).__init__(**kwargs)
self.allowed_origins = allowed_origins
self.allowed_methods = allowed_methods
self.max_age_in_seconds = max_age_in_seconds
self.exposed_headers = exposed_headers
self.allowed_headers = allowed_headers
Loading