зеркало из
1
0
Форкнуть 0
Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
This commit is contained in:
Azure SDK Bot 2022-11-16 22:24:17 -05:00 коммит произвёл GitHub
Родитель d7426ceba5
Коммит a496105066
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
874 изменённых файлов: 200511 добавлений и 105171 удалений

Просмотреть файл

@ -1,5 +1,23 @@
# Release History
## 21.0.0 (2022-11-15)
### Features Added
- Model ManagementPolicyBaseBlob has a new parameter tier_to_cold
- Model ManagementPolicyBaseBlob has a new parameter tier_to_hot
- Model ManagementPolicySnapShot has a new parameter tier_to_cold
- Model ManagementPolicySnapShot has a new parameter tier_to_hot
- Model ManagementPolicyVersion has a new parameter tier_to_cold
- Model ManagementPolicyVersion has a new parameter tier_to_hot
### Breaking Changes
- Operation EncryptionScopesOperations.list has a new parameter filter
- Operation EncryptionScopesOperations.list has a new parameter include
- Operation EncryptionScopesOperations.list has a new parameter maxpagesize
- Operation StorageAccountsOperations.begin_failover has a new parameter failover_type
## 20.1.0 (2022-08-09)
**Features**

Просмотреть файл

@ -1,5 +1,6 @@
include _meta.json
recursive-include tests *.py *.json
recursive-include samples *.py *.md
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py

Просмотреть файл

@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"use": [
"@autorest/python@5.16.0",
"@autorest/modelerfour@4.19.3"
],
"commit": "1b3b9c1dd4d2c875997ea0b392dc71418fb1f28d",
"commit": "8bcf420c12d61a1639dd470d511e6210869f44b6",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/storage/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.2.1",
"@autorest/modelerfour@4.24.3"
],
"autorest_command": "autorest specification/storage/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/storage/resource-manager/readme.md"
}

Просмотреть файл

@ -14,3 +14,7 @@ try:
patch_sdk()
except ImportError:
pass
from ._version import VERSION
__version__ = VERSION

Просмотреть файл

@ -8,7 +8,7 @@
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
@ -18,8 +18,6 @@ from ._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any
from azure.core.credentials import TokenCredential
class StorageManagementClientConfiguration(Configuration):
@ -28,16 +26,16 @@ class StorageManagementClientConfiguration(Configuration):
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
"""
def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
credential: "TokenCredential",
subscription_id: str,
**kwargs # type: Any
):
# type: (...) -> None

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -9,20 +9,17 @@
# regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
from msrest import Deserializer, Serializer
from typing import Any, Optional, TYPE_CHECKING
from azure.mgmt.core import ARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from ._configuration import StorageManagementClientConfiguration
from ._serialization import Deserializer, Serializer
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Optional
from azure.core.credentials import TokenCredential
class _SDKClient(object):
@ -43,9 +40,9 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
The api-version parameter sets the default API version if the operation
group is not described in the profile.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
@ -56,7 +53,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
DEFAULT_API_VERSION = '2022-05-01'
DEFAULT_API_VERSION = '2022-09-01'
_PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
@ -68,10 +65,10 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
credential: "TokenCredential",
subscription_id: str,
api_version=None, # type: Optional[str]
base_url="https://management.azure.com", # type: str
base_url: str = "https://management.azure.com",
profile=KnownProfiles.default, # type: KnownProfiles
**kwargs # type: Any
):
@ -109,6 +106,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :mod:`v2021_08_01.models<azure.mgmt.storage.v2021_08_01.models>`
* 2021-09-01: :mod:`v2021_09_01.models<azure.mgmt.storage.v2021_09_01.models>`
* 2022-05-01: :mod:`v2022_05_01.models<azure.mgmt.storage.v2022_05_01.models>`
* 2022-09-01: :mod:`v2022_09_01.models<azure.mgmt.storage.v2022_09_01.models>`
"""
if api_version == '2015-06-15':
from .v2015_06_15 import models
@ -167,6 +165,9 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
elif api_version == '2022-05-01':
from .v2022_05_01 import models
return models
elif api_version == '2022-09-01':
from .v2022_09_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))
@property
@ -187,6 +188,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2021_08_01.operations.BlobContainersOperations>`
* 2021-09-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2021_09_01.operations.BlobContainersOperations>`
* 2022-05-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2022_05_01.operations.BlobContainersOperations>`
* 2022-09-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2022_09_01.operations.BlobContainersOperations>`
"""
api_version = self._get_api_version('blob_containers')
if api_version == '2018-02-01':
@ -217,8 +219,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import BlobContainersOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import BlobContainersOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import BlobContainersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'blob_containers'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -234,6 +239,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2021_08_01.operations.BlobInventoryPoliciesOperations>`
* 2021-09-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2021_09_01.operations.BlobInventoryPoliciesOperations>`
* 2022-05-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2022_05_01.operations.BlobInventoryPoliciesOperations>`
* 2022-09-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2022_09_01.operations.BlobInventoryPoliciesOperations>`
"""
api_version = self._get_api_version('blob_inventory_policies')
if api_version == '2019-06-01':
@ -254,8 +260,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import BlobInventoryPoliciesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import BlobInventoryPoliciesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import BlobInventoryPoliciesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'blob_inventory_policies'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -274,6 +283,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2021_08_01.operations.BlobServicesOperations>`
* 2021-09-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2021_09_01.operations.BlobServicesOperations>`
* 2022-05-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2022_05_01.operations.BlobServicesOperations>`
* 2022-09-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2022_09_01.operations.BlobServicesOperations>`
"""
api_version = self._get_api_version('blob_services')
if api_version == '2018-07-01':
@ -300,8 +310,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import BlobServicesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import BlobServicesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import BlobServicesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'blob_services'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -316,6 +329,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2021_08_01.operations.DeletedAccountsOperations>`
* 2021-09-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2021_09_01.operations.DeletedAccountsOperations>`
* 2022-05-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2022_05_01.operations.DeletedAccountsOperations>`
* 2022-09-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2022_09_01.operations.DeletedAccountsOperations>`
"""
api_version = self._get_api_version('deleted_accounts')
if api_version == '2020-08-01-preview':
@ -334,8 +348,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import DeletedAccountsOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import DeletedAccountsOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import DeletedAccountsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'deleted_accounts'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -351,6 +368,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2021_08_01.operations.EncryptionScopesOperations>`
* 2021-09-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2021_09_01.operations.EncryptionScopesOperations>`
* 2022-05-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2022_05_01.operations.EncryptionScopesOperations>`
* 2022-09-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2022_09_01.operations.EncryptionScopesOperations>`
"""
api_version = self._get_api_version('encryption_scopes')
if api_version == '2019-06-01':
@ -371,8 +389,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import EncryptionScopesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import EncryptionScopesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import EncryptionScopesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'encryption_scopes'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -389,6 +410,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`FileServicesOperations<azure.mgmt.storage.v2021_08_01.operations.FileServicesOperations>`
* 2021-09-01: :class:`FileServicesOperations<azure.mgmt.storage.v2021_09_01.operations.FileServicesOperations>`
* 2022-05-01: :class:`FileServicesOperations<azure.mgmt.storage.v2022_05_01.operations.FileServicesOperations>`
* 2022-09-01: :class:`FileServicesOperations<azure.mgmt.storage.v2022_09_01.operations.FileServicesOperations>`
"""
api_version = self._get_api_version('file_services')
if api_version == '2019-04-01':
@ -411,8 +433,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import FileServicesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import FileServicesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import FileServicesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'file_services'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -429,6 +454,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`FileSharesOperations<azure.mgmt.storage.v2021_08_01.operations.FileSharesOperations>`
* 2021-09-01: :class:`FileSharesOperations<azure.mgmt.storage.v2021_09_01.operations.FileSharesOperations>`
* 2022-05-01: :class:`FileSharesOperations<azure.mgmt.storage.v2022_05_01.operations.FileSharesOperations>`
* 2022-09-01: :class:`FileSharesOperations<azure.mgmt.storage.v2022_09_01.operations.FileSharesOperations>`
"""
api_version = self._get_api_version('file_shares')
if api_version == '2019-04-01':
@ -451,8 +477,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import FileSharesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import FileSharesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import FileSharesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'file_shares'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -462,6 +491,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`LocalUsersOperations<azure.mgmt.storage.v2021_08_01.operations.LocalUsersOperations>`
* 2021-09-01: :class:`LocalUsersOperations<azure.mgmt.storage.v2021_09_01.operations.LocalUsersOperations>`
* 2022-05-01: :class:`LocalUsersOperations<azure.mgmt.storage.v2022_05_01.operations.LocalUsersOperations>`
* 2022-09-01: :class:`LocalUsersOperations<azure.mgmt.storage.v2022_09_01.operations.LocalUsersOperations>`
"""
api_version = self._get_api_version('local_users')
if api_version == '2021-08-01':
@ -470,8 +500,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import LocalUsersOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import LocalUsersOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import LocalUsersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'local_users'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -490,6 +523,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2021_08_01.operations.ManagementPoliciesOperations>`
* 2021-09-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2021_09_01.operations.ManagementPoliciesOperations>`
* 2022-05-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2022_05_01.operations.ManagementPoliciesOperations>`
* 2022-09-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2022_09_01.operations.ManagementPoliciesOperations>`
"""
api_version = self._get_api_version('management_policies')
if api_version == '2018-07-01':
@ -516,8 +550,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import ManagementPoliciesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import ManagementPoliciesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import ManagementPoliciesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'management_policies'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -533,6 +570,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2021_08_01.operations.ObjectReplicationPoliciesOperations>`
* 2021-09-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2021_09_01.operations.ObjectReplicationPoliciesOperations>`
* 2022-05-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2022_05_01.operations.ObjectReplicationPoliciesOperations>`
* 2022-09-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2022_09_01.operations.ObjectReplicationPoliciesOperations>`
"""
api_version = self._get_api_version('object_replication_policies')
if api_version == '2019-06-01':
@ -553,8 +591,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import ObjectReplicationPoliciesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import ObjectReplicationPoliciesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import ObjectReplicationPoliciesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'object_replication_policies'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -577,6 +618,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`Operations<azure.mgmt.storage.v2021_08_01.operations.Operations>`
* 2021-09-01: :class:`Operations<azure.mgmt.storage.v2021_09_01.operations.Operations>`
* 2022-05-01: :class:`Operations<azure.mgmt.storage.v2022_05_01.operations.Operations>`
* 2022-09-01: :class:`Operations<azure.mgmt.storage.v2022_09_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2017-06-01':
@ -611,8 +653,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import Operations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import Operations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -628,6 +673,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2021_08_01.operations.PrivateEndpointConnectionsOperations>`
* 2021-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2021_09_01.operations.PrivateEndpointConnectionsOperations>`
* 2022-05-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2022_05_01.operations.PrivateEndpointConnectionsOperations>`
* 2022-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2022_09_01.operations.PrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2019-06-01':
@ -648,8 +694,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import PrivateEndpointConnectionsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -665,6 +714,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2021_08_01.operations.PrivateLinkResourcesOperations>`
* 2021-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2021_09_01.operations.PrivateLinkResourcesOperations>`
* 2022-05-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2022_05_01.operations.PrivateLinkResourcesOperations>`
* 2022-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2022_09_01.operations.PrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2019-06-01':
@ -685,8 +735,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import PrivateLinkResourcesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -702,6 +755,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`QueueOperations<azure.mgmt.storage.v2021_08_01.operations.QueueOperations>`
* 2021-09-01: :class:`QueueOperations<azure.mgmt.storage.v2021_09_01.operations.QueueOperations>`
* 2022-05-01: :class:`QueueOperations<azure.mgmt.storage.v2022_05_01.operations.QueueOperations>`
* 2022-09-01: :class:`QueueOperations<azure.mgmt.storage.v2022_09_01.operations.QueueOperations>`
"""
api_version = self._get_api_version('queue')
if api_version == '2019-06-01':
@ -722,8 +776,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import QueueOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import QueueOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import QueueOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'queue'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -739,6 +796,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2021_08_01.operations.QueueServicesOperations>`
* 2021-09-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2021_09_01.operations.QueueServicesOperations>`
* 2022-05-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2022_05_01.operations.QueueServicesOperations>`
* 2022-09-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2022_09_01.operations.QueueServicesOperations>`
"""
api_version = self._get_api_version('queue_services')
if api_version == '2019-06-01':
@ -759,8 +817,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import QueueServicesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import QueueServicesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import QueueServicesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'queue_services'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -783,6 +844,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`SkusOperations<azure.mgmt.storage.v2021_08_01.operations.SkusOperations>`
* 2021-09-01: :class:`SkusOperations<azure.mgmt.storage.v2021_09_01.operations.SkusOperations>`
* 2022-05-01: :class:`SkusOperations<azure.mgmt.storage.v2022_05_01.operations.SkusOperations>`
* 2022-09-01: :class:`SkusOperations<azure.mgmt.storage.v2022_09_01.operations.SkusOperations>`
"""
api_version = self._get_api_version('skus')
if api_version == '2017-06-01':
@ -817,8 +879,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import SkusOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import SkusOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import SkusOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'skus'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -844,6 +909,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2021_08_01.operations.StorageAccountsOperations>`
* 2021-09-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2021_09_01.operations.StorageAccountsOperations>`
* 2022-05-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2022_05_01.operations.StorageAccountsOperations>`
* 2022-09-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2022_09_01.operations.StorageAccountsOperations>`
"""
api_version = self._get_api_version('storage_accounts')
if api_version == '2015-06-15':
@ -884,8 +950,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import StorageAccountsOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import StorageAccountsOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import StorageAccountsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'storage_accounts'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -901,6 +970,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`TableOperations<azure.mgmt.storage.v2021_08_01.operations.TableOperations>`
* 2021-09-01: :class:`TableOperations<azure.mgmt.storage.v2021_09_01.operations.TableOperations>`
* 2022-05-01: :class:`TableOperations<azure.mgmt.storage.v2022_05_01.operations.TableOperations>`
* 2022-09-01: :class:`TableOperations<azure.mgmt.storage.v2022_09_01.operations.TableOperations>`
"""
api_version = self._get_api_version('table')
if api_version == '2019-06-01':
@ -921,8 +991,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import TableOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import TableOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import TableOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'table'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -938,6 +1011,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`TableServicesOperations<azure.mgmt.storage.v2021_08_01.operations.TableServicesOperations>`
* 2021-09-01: :class:`TableServicesOperations<azure.mgmt.storage.v2021_09_01.operations.TableServicesOperations>`
* 2022-05-01: :class:`TableServicesOperations<azure.mgmt.storage.v2022_05_01.operations.TableServicesOperations>`
* 2022-09-01: :class:`TableServicesOperations<azure.mgmt.storage.v2022_09_01.operations.TableServicesOperations>`
"""
api_version = self._get_api_version('table_services')
if api_version == '2019-06-01':
@ -958,8 +1032,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import TableServicesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import TableServicesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import TableServicesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'table_services'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -988,6 +1065,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2018_02_01.operations import UsageOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'usage'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -1007,6 +1085,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`UsagesOperations<azure.mgmt.storage.v2021_08_01.operations.UsagesOperations>`
* 2021-09-01: :class:`UsagesOperations<azure.mgmt.storage.v2021_09_01.operations.UsagesOperations>`
* 2022-05-01: :class:`UsagesOperations<azure.mgmt.storage.v2022_05_01.operations.UsagesOperations>`
* 2022-09-01: :class:`UsagesOperations<azure.mgmt.storage.v2022_09_01.operations.UsagesOperations>`
"""
api_version = self._get_api_version('usages')
if api_version == '2018-03-01-preview':
@ -1035,8 +1114,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from .v2021_09_01.operations import UsagesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import UsagesOperations as OperationClass
elif api_version == '2022-09-01':
from .v2022_09_01.operations import UsagesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'usages'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
def close(self):

Просмотреть файл

@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------
VERSION = "20.1.0"
VERSION = "21.0.0"

Просмотреть файл

@ -26,9 +26,9 @@ class StorageManagementClientConfiguration(Configuration):
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
"""

Просмотреть файл

@ -11,17 +11,15 @@
from typing import Any, Optional, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.mgmt.core import AsyncARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from .._serialization import Deserializer, Serializer
from ._configuration import StorageManagementClientConfiguration
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
from azure.core.credentials_async import AsyncTokenCredential
class _SDKClient(object):
@ -42,9 +40,9 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
The api-version parameter sets the default API version if the operation
group is not described in the profile.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param api_version: API version to use if no profile is provided, or if missing in profile.
:type api_version: str
@ -55,7 +53,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
"""
DEFAULT_API_VERSION = '2022-05-01'
DEFAULT_API_VERSION = '2022-09-01'
_PROFILE_TAG = "azure.mgmt.storage.StorageManagementClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
@ -108,6 +106,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :mod:`v2021_08_01.models<azure.mgmt.storage.v2021_08_01.models>`
* 2021-09-01: :mod:`v2021_09_01.models<azure.mgmt.storage.v2021_09_01.models>`
* 2022-05-01: :mod:`v2022_05_01.models<azure.mgmt.storage.v2022_05_01.models>`
* 2022-09-01: :mod:`v2022_09_01.models<azure.mgmt.storage.v2022_09_01.models>`
"""
if api_version == '2015-06-15':
from ..v2015_06_15 import models
@ -166,6 +165,9 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
elif api_version == '2022-05-01':
from ..v2022_05_01 import models
return models
elif api_version == '2022-09-01':
from ..v2022_09_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))
@property
@ -186,6 +188,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2021_08_01.aio.operations.BlobContainersOperations>`
* 2021-09-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2021_09_01.aio.operations.BlobContainersOperations>`
* 2022-05-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2022_05_01.aio.operations.BlobContainersOperations>`
* 2022-09-01: :class:`BlobContainersOperations<azure.mgmt.storage.v2022_09_01.aio.operations.BlobContainersOperations>`
"""
api_version = self._get_api_version('blob_containers')
if api_version == '2018-02-01':
@ -216,8 +219,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import BlobContainersOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import BlobContainersOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import BlobContainersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'blob_containers'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -233,6 +239,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.BlobInventoryPoliciesOperations>`
* 2021-09-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.BlobInventoryPoliciesOperations>`
* 2022-05-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.BlobInventoryPoliciesOperations>`
* 2022-09-01: :class:`BlobInventoryPoliciesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.BlobInventoryPoliciesOperations>`
"""
api_version = self._get_api_version('blob_inventory_policies')
if api_version == '2019-06-01':
@ -253,8 +260,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import BlobInventoryPoliciesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import BlobInventoryPoliciesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import BlobInventoryPoliciesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'blob_inventory_policies'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -273,6 +283,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.BlobServicesOperations>`
* 2021-09-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.BlobServicesOperations>`
* 2022-05-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.BlobServicesOperations>`
* 2022-09-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.BlobServicesOperations>`
"""
api_version = self._get_api_version('blob_services')
if api_version == '2018-07-01':
@ -299,8 +310,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import BlobServicesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import BlobServicesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import BlobServicesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'blob_services'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -315,6 +329,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2021_08_01.aio.operations.DeletedAccountsOperations>`
* 2021-09-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2021_09_01.aio.operations.DeletedAccountsOperations>`
* 2022-05-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2022_05_01.aio.operations.DeletedAccountsOperations>`
* 2022-09-01: :class:`DeletedAccountsOperations<azure.mgmt.storage.v2022_09_01.aio.operations.DeletedAccountsOperations>`
"""
api_version = self._get_api_version('deleted_accounts')
if api_version == '2020-08-01-preview':
@ -333,8 +348,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import DeletedAccountsOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import DeletedAccountsOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import DeletedAccountsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'deleted_accounts'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -350,6 +368,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.EncryptionScopesOperations>`
* 2021-09-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.EncryptionScopesOperations>`
* 2022-05-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.EncryptionScopesOperations>`
* 2022-09-01: :class:`EncryptionScopesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.EncryptionScopesOperations>`
"""
api_version = self._get_api_version('encryption_scopes')
if api_version == '2019-06-01':
@ -370,8 +389,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import EncryptionScopesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import EncryptionScopesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import EncryptionScopesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'encryption_scopes'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -388,6 +410,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`FileServicesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.FileServicesOperations>`
* 2021-09-01: :class:`FileServicesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.FileServicesOperations>`
* 2022-05-01: :class:`FileServicesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.FileServicesOperations>`
* 2022-09-01: :class:`FileServicesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.FileServicesOperations>`
"""
api_version = self._get_api_version('file_services')
if api_version == '2019-04-01':
@ -410,8 +433,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import FileServicesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import FileServicesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import FileServicesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'file_services'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -428,6 +454,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`FileSharesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.FileSharesOperations>`
* 2021-09-01: :class:`FileSharesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.FileSharesOperations>`
* 2022-05-01: :class:`FileSharesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.FileSharesOperations>`
* 2022-09-01: :class:`FileSharesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.FileSharesOperations>`
"""
api_version = self._get_api_version('file_shares')
if api_version == '2019-04-01':
@ -450,8 +477,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import FileSharesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import FileSharesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import FileSharesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'file_shares'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -461,6 +491,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`LocalUsersOperations<azure.mgmt.storage.v2021_08_01.aio.operations.LocalUsersOperations>`
* 2021-09-01: :class:`LocalUsersOperations<azure.mgmt.storage.v2021_09_01.aio.operations.LocalUsersOperations>`
* 2022-05-01: :class:`LocalUsersOperations<azure.mgmt.storage.v2022_05_01.aio.operations.LocalUsersOperations>`
* 2022-09-01: :class:`LocalUsersOperations<azure.mgmt.storage.v2022_09_01.aio.operations.LocalUsersOperations>`
"""
api_version = self._get_api_version('local_users')
if api_version == '2021-08-01':
@ -469,8 +500,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import LocalUsersOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import LocalUsersOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import LocalUsersOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'local_users'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -489,6 +523,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.ManagementPoliciesOperations>`
* 2021-09-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.ManagementPoliciesOperations>`
* 2022-05-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.ManagementPoliciesOperations>`
* 2022-09-01: :class:`ManagementPoliciesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.ManagementPoliciesOperations>`
"""
api_version = self._get_api_version('management_policies')
if api_version == '2018-07-01':
@ -515,8 +550,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import ManagementPoliciesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import ManagementPoliciesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import ManagementPoliciesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'management_policies'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -532,6 +570,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.ObjectReplicationPoliciesOperations>`
* 2021-09-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.ObjectReplicationPoliciesOperations>`
* 2022-05-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.ObjectReplicationPoliciesOperations>`
* 2022-09-01: :class:`ObjectReplicationPoliciesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.ObjectReplicationPoliciesOperations>`
"""
api_version = self._get_api_version('object_replication_policies')
if api_version == '2019-06-01':
@ -552,8 +591,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import ObjectReplicationPoliciesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'object_replication_policies'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -576,6 +618,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`Operations<azure.mgmt.storage.v2021_08_01.aio.operations.Operations>`
* 2021-09-01: :class:`Operations<azure.mgmt.storage.v2021_09_01.aio.operations.Operations>`
* 2022-05-01: :class:`Operations<azure.mgmt.storage.v2022_05_01.aio.operations.Operations>`
* 2022-09-01: :class:`Operations<azure.mgmt.storage.v2022_09_01.aio.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2017-06-01':
@ -610,8 +653,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import Operations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import Operations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import Operations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'operations'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -627,6 +673,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2021_08_01.aio.operations.PrivateEndpointConnectionsOperations>`
* 2021-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2021_09_01.aio.operations.PrivateEndpointConnectionsOperations>`
* 2022-05-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2022_05_01.aio.operations.PrivateEndpointConnectionsOperations>`
* 2022-09-01: :class:`PrivateEndpointConnectionsOperations<azure.mgmt.storage.v2022_09_01.aio.operations.PrivateEndpointConnectionsOperations>`
"""
api_version = self._get_api_version('private_endpoint_connections')
if api_version == '2019-06-01':
@ -647,8 +694,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -664,6 +714,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.PrivateLinkResourcesOperations>`
* 2021-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.PrivateLinkResourcesOperations>`
* 2022-05-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.PrivateLinkResourcesOperations>`
* 2022-09-01: :class:`PrivateLinkResourcesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.PrivateLinkResourcesOperations>`
"""
api_version = self._get_api_version('private_link_resources')
if api_version == '2019-06-01':
@ -684,8 +735,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import PrivateLinkResourcesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import PrivateLinkResourcesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -701,6 +755,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`QueueOperations<azure.mgmt.storage.v2021_08_01.aio.operations.QueueOperations>`
* 2021-09-01: :class:`QueueOperations<azure.mgmt.storage.v2021_09_01.aio.operations.QueueOperations>`
* 2022-05-01: :class:`QueueOperations<azure.mgmt.storage.v2022_05_01.aio.operations.QueueOperations>`
* 2022-09-01: :class:`QueueOperations<azure.mgmt.storage.v2022_09_01.aio.operations.QueueOperations>`
"""
api_version = self._get_api_version('queue')
if api_version == '2019-06-01':
@ -721,8 +776,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import QueueOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import QueueOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import QueueOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'queue'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -738,6 +796,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.QueueServicesOperations>`
* 2021-09-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.QueueServicesOperations>`
* 2022-05-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.QueueServicesOperations>`
* 2022-09-01: :class:`QueueServicesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.QueueServicesOperations>`
"""
api_version = self._get_api_version('queue_services')
if api_version == '2019-06-01':
@ -758,8 +817,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import QueueServicesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import QueueServicesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import QueueServicesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'queue_services'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -782,6 +844,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`SkusOperations<azure.mgmt.storage.v2021_08_01.aio.operations.SkusOperations>`
* 2021-09-01: :class:`SkusOperations<azure.mgmt.storage.v2021_09_01.aio.operations.SkusOperations>`
* 2022-05-01: :class:`SkusOperations<azure.mgmt.storage.v2022_05_01.aio.operations.SkusOperations>`
* 2022-09-01: :class:`SkusOperations<azure.mgmt.storage.v2022_09_01.aio.operations.SkusOperations>`
"""
api_version = self._get_api_version('skus')
if api_version == '2017-06-01':
@ -816,8 +879,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import SkusOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import SkusOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import SkusOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'skus'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -843,6 +909,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2021_08_01.aio.operations.StorageAccountsOperations>`
* 2021-09-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2021_09_01.aio.operations.StorageAccountsOperations>`
* 2022-05-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2022_05_01.aio.operations.StorageAccountsOperations>`
* 2022-09-01: :class:`StorageAccountsOperations<azure.mgmt.storage.v2022_09_01.aio.operations.StorageAccountsOperations>`
"""
api_version = self._get_api_version('storage_accounts')
if api_version == '2015-06-15':
@ -883,8 +950,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import StorageAccountsOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import StorageAccountsOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import StorageAccountsOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'storage_accounts'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -900,6 +970,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`TableOperations<azure.mgmt.storage.v2021_08_01.aio.operations.TableOperations>`
* 2021-09-01: :class:`TableOperations<azure.mgmt.storage.v2021_09_01.aio.operations.TableOperations>`
* 2022-05-01: :class:`TableOperations<azure.mgmt.storage.v2022_05_01.aio.operations.TableOperations>`
* 2022-09-01: :class:`TableOperations<azure.mgmt.storage.v2022_09_01.aio.operations.TableOperations>`
"""
api_version = self._get_api_version('table')
if api_version == '2019-06-01':
@ -920,8 +991,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import TableOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import TableOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import TableOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'table'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -937,6 +1011,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`TableServicesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.TableServicesOperations>`
* 2021-09-01: :class:`TableServicesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.TableServicesOperations>`
* 2022-05-01: :class:`TableServicesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.TableServicesOperations>`
* 2022-09-01: :class:`TableServicesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.TableServicesOperations>`
"""
api_version = self._get_api_version('table_services')
if api_version == '2019-06-01':
@ -957,8 +1032,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import TableServicesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import TableServicesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import TableServicesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'table_services'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -987,6 +1065,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2018_02_01.aio.operations import UsageOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'usage'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@property
@ -1006,6 +1085,7 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
* 2021-08-01: :class:`UsagesOperations<azure.mgmt.storage.v2021_08_01.aio.operations.UsagesOperations>`
* 2021-09-01: :class:`UsagesOperations<azure.mgmt.storage.v2021_09_01.aio.operations.UsagesOperations>`
* 2022-05-01: :class:`UsagesOperations<azure.mgmt.storage.v2022_05_01.aio.operations.UsagesOperations>`
* 2022-09-01: :class:`UsagesOperations<azure.mgmt.storage.v2022_09_01.aio.operations.UsagesOperations>`
"""
api_version = self._get_api_version('usages')
if api_version == '2018-03-01-preview':
@ -1034,8 +1114,11 @@ class StorageManagementClient(MultiApiClientMixin, _SDKClient):
from ..v2021_09_01.aio.operations import UsagesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import UsagesOperations as OperationClass
elif api_version == '2022-09-01':
from ..v2022_09_01.aio.operations import UsagesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'usages'".format(api_version))
self._config.api_version = api_version
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
async def close(self):

Просмотреть файл

@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------
from .v2018_02_01.models import *
from .v2022_05_01.models import *
from .v2022_09_01.models import *

Просмотреть файл

@ -17,7 +17,10 @@ try:
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['StorageManagement']
__all__ = [
"StorageManagement",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
@ -14,6 +15,11 @@ from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLo
from ._version import VERSION
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
@ -25,24 +31,19 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription credentials which uniquely identify the Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2015-06-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageManagementConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
api_version = kwargs.pop("api_version", "2015-06-15") # type: Literal["2015-06-15"]
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -52,23 +53,24 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-storage/{}".format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs # type: Any
self, **kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

Просмотреть файл

@ -10,20 +10,20 @@
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"signature": "credential: \"TokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"signature": "subscription_id: str,",
"description": "Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.",
"docstring_type": "str",
"required": true
}
@ -31,13 +31,13 @@
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"description": "Subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.",
"docstring_type": "str",
"required": true
}
@ -54,7 +54,7 @@
"required": false
},
"base_url": {
"signature": "base_url=\"https://management.azure.com\", # type: str",
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false
@ -100,4 +100,4 @@
"storage_accounts": "StorageAccountsOperations",
"usage": "UsageOperations"
}
}
}

Просмотреть файл

@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass

Просмотреть файл

@ -9,12 +9,11 @@
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from . import models
from .._serialization import Deserializer, Serializer
from ._configuration import StorageManagementConfiguration
from .operations import StorageAccountsOperations, UsageOperations
@ -22,17 +21,18 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class StorageManagement:
class StorageManagement: # pylint: disable=client-accepts-api-version-keyword
"""The Azure Storage Management API.
:ivar storage_accounts: StorageAccountsOperations operations
:vartype storage_accounts: azure.mgmt.storage.v2015_06_15.operations.StorageAccountsOperations
:ivar usage: UsageOperations operations
:vartype usage: azure.mgmt.storage.v2015_06_15.operations.UsageOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Subscription credentials which uniquely identify the Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
@ -60,16 +60,9 @@ class StorageManagement:
self.storage_accounts = StorageAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -78,7 +71,7 @@ class StorageManagement:
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest

Просмотреть файл

@ -7,6 +7,7 @@
from azure.core.pipeline.transport import HttpRequest
def _convert_request(request, files=None):
data = request.content if not files else None
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
@ -14,6 +15,7 @@ def _convert_request(request, files=None):
request.set_formdata_body(files)
return request
def _format_url_section(template, **kwargs):
components = template.split("/")
while components:
@ -21,7 +23,5 @@ def _format_url_section(template, **kwargs):
return template.format(**kwargs)
except KeyError as key:
formatted_components = template.split("/")
components = [
c for c in formatted_components if "{}".format(key.args[0]) not in c
]
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
template = "/".join(components)

Просмотреть файл

@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
VERSION = "20.1.0"
VERSION = "21.0.0"

Просмотреть файл

@ -14,7 +14,10 @@ try:
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['StorageManagement']
__all__ = [
"StorageManagement",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
@ -14,6 +15,11 @@ from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuth
from .._version import VERSION
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
@ -25,24 +31,19 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Subscription credentials which uniquely identify the Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2015-06-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageManagementConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2015-06-15") # type: str
api_version = kwargs.pop("api_version", "2015-06-15") # type: Literal["2015-06-15"]
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -52,22 +53,21 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-storage/{}".format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs: Any
) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

Просмотреть файл

@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass

Просмотреть файл

@ -9,12 +9,11 @@
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from .. import models
from ..._serialization import Deserializer, Serializer
from ._configuration import StorageManagementConfiguration
from .operations import StorageAccountsOperations, UsageOperations
@ -22,7 +21,8 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class StorageManagement:
class StorageManagement: # pylint: disable=client-accepts-api-version-keyword
"""The Azure Storage Management API.
:ivar storage_accounts: StorageAccountsOperations operations
@ -30,10 +30,10 @@ class StorageManagement:
azure.mgmt.storage.v2015_06_15.aio.operations.StorageAccountsOperations
:ivar usage: UsageOperations operations
:vartype usage: azure.mgmt.storage.v2015_06_15.aio.operations.UsageOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Subscription credentials which uniquely identify the Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call.
subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
@ -61,16 +61,9 @@ class StorageManagement:
self.storage_accounts = StorageAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> Awaitable[AsyncHttpResponse]:
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -79,7 +72,7 @@ class StorageManagement:
>>> response = await client._send_request(request)
<AsyncHttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest

Просмотреть файл

@ -12,9 +12,10 @@ from ._usage_operations import UsageOperations
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'StorageAccountsOperations',
'UsageOperations',
"StorageAccountsOperations",
"UsageOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,10 +6,19 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
@ -20,9 +29,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
from ..._vendor import _convert_request
from ...operations._usage_operations import build_list_request
T = TypeVar('T')
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class UsageOperations:
"""
.. warning::
@ -42,37 +57,36 @@ class UsageOperations:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list(
self,
**kwargs: Any
) -> AsyncIterable[_models.UsageListResult]:
def list(self, **kwargs: Any) -> AsyncIterable["_models.Usage"]:
"""Lists the current usage count and the limit for the resources under the subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either UsageListResult or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2015_06_15.models.UsageListResult]
:raises: ~azure.core.exceptions.HttpResponseError
:return: An iterator like instance of either Usage or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2015_06_15.models.Usage]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2015-06-15")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.UsageListResult]
api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop('error_map', {}) or {})
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
@ -80,13 +94,17 @@ class UsageOperations:
request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
@ -103,10 +121,8 @@ class UsageOperations:
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
@ -116,8 +132,6 @@ class UsageOperations:
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore

Просмотреть файл

@ -21,37 +21,35 @@ from ._models_py3 import Usage
from ._models_py3 import UsageListResult
from ._models_py3 import UsageName
from ._storage_management_enums import (
AccountStatus,
AccountType,
ProvisioningState,
Reason,
UsageUnit,
)
from ._storage_management_enums import AccountStatus
from ._storage_management_enums import AccountType
from ._storage_management_enums import ProvisioningState
from ._storage_management_enums import Reason
from ._storage_management_enums import UsageUnit
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'CheckNameAvailabilityResult',
'CustomDomain',
'Endpoints',
'Resource',
'StorageAccount',
'StorageAccountCheckNameAvailabilityParameters',
'StorageAccountCreateParameters',
'StorageAccountKeys',
'StorageAccountListResult',
'StorageAccountRegenerateKeyParameters',
'StorageAccountUpdateParameters',
'Usage',
'UsageListResult',
'UsageName',
'AccountStatus',
'AccountType',
'ProvisioningState',
'Reason',
'UsageUnit',
"CheckNameAvailabilityResult",
"CustomDomain",
"Endpoints",
"Resource",
"StorageAccount",
"StorageAccountCheckNameAvailabilityParameters",
"StorageAccountCreateParameters",
"StorageAccountKeys",
"StorageAccountListResult",
"StorageAccountRegenerateKeyParameters",
"StorageAccountUpdateParameters",
"Usage",
"UsageListResult",
"UsageName",
"AccountStatus",
"AccountType",
"ProvisioningState",
"Reason",
"UsageUnit",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Просмотреть файл

@ -1,4 +1,5 @@
# coding=utf-8
# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
@ -9,14 +10,14 @@
import datetime
from typing import Dict, List, Optional, TYPE_CHECKING, Union
import msrest.serialization
from ... import _serialization
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
import __init__ as _models
from .. import models as _models
class CheckNameAvailabilityResult(msrest.serialization.Model):
class CheckNameAvailabilityResult(_serialization.Model):
"""The CheckNameAvailability operation response.
:ivar name_available: Boolean value that indicates whether the name is available for you to
@ -24,7 +25,7 @@ class CheckNameAvailabilityResult(msrest.serialization.Model):
and cannot be used.
:vartype name_available: bool
:ivar reason: The reason that a storage account name could not be used. The Reason element is
only returned if NameAvailable is false. Known values are: "AccountNameInvalid",
only returned if NameAvailable is false. Known values are: "AccountNameInvalid" and
"AlreadyExists".
:vartype reason: str or ~azure.mgmt.storage.v2015_06_15.models.Reason
:ivar message: The error message explaining the Reason value in more detail.
@ -32,9 +33,9 @@ class CheckNameAvailabilityResult(msrest.serialization.Model):
"""
_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
"name_available": {"key": "nameAvailable", "type": "bool"},
"reason": {"key": "reason", "type": "str"},
"message": {"key": "message", "type": "str"},
}
def __init__(
@ -51,24 +52,24 @@ class CheckNameAvailabilityResult(msrest.serialization.Model):
and cannot be used.
:paramtype name_available: bool
:keyword reason: The reason that a storage account name could not be used. The Reason element
is only returned if NameAvailable is false. Known values are: "AccountNameInvalid",
is only returned if NameAvailable is false. Known values are: "AccountNameInvalid" and
"AlreadyExists".
:paramtype reason: str or ~azure.mgmt.storage.v2015_06_15.models.Reason
:keyword message: The error message explaining the Reason value in more detail.
:paramtype message: str
"""
super(CheckNameAvailabilityResult, self).__init__(**kwargs)
super().__init__(**kwargs)
self.name_available = name_available
self.reason = reason
self.message = message
class CustomDomain(msrest.serialization.Model):
class CustomDomain(_serialization.Model):
"""The custom domain assigned to this storage account. This can be set via Update.
All required parameters must be populated in order to send to Azure.
:ivar name: Required. The custom domain name. Name is the CNAME source.
:ivar name: The custom domain name. Name is the CNAME source. Required.
:vartype name: str
:ivar use_sub_domain_name: Indicates whether indirect CName validation is enabled. Default
value is false. This should only be set on updates.
@ -76,34 +77,28 @@ class CustomDomain(msrest.serialization.Model):
"""
_validation = {
'name': {'required': True},
"name": {"required": True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'use_sub_domain_name': {'key': 'useSubDomainName', 'type': 'bool'},
"name": {"key": "name", "type": "str"},
"use_sub_domain_name": {"key": "useSubDomainName", "type": "bool"},
}
def __init__(
self,
*,
name: str,
use_sub_domain_name: Optional[bool] = None,
**kwargs
):
def __init__(self, *, name: str, use_sub_domain_name: Optional[bool] = None, **kwargs):
"""
:keyword name: Required. The custom domain name. Name is the CNAME source.
:keyword name: The custom domain name. Name is the CNAME source. Required.
:paramtype name: str
:keyword use_sub_domain_name: Indicates whether indirect CName validation is enabled. Default
value is false. This should only be set on updates.
:paramtype use_sub_domain_name: bool
"""
super(CustomDomain, self).__init__(**kwargs)
super().__init__(**kwargs)
self.name = name
self.use_sub_domain_name = use_sub_domain_name
class Endpoints(msrest.serialization.Model):
class Endpoints(_serialization.Model):
"""The URIs that are used to perform a retrieval of a public blob, queue or table object.
:ivar blob: The blob endpoint.
@ -117,10 +112,10 @@ class Endpoints(msrest.serialization.Model):
"""
_attribute_map = {
'blob': {'key': 'blob', 'type': 'str'},
'queue': {'key': 'queue', 'type': 'str'},
'table': {'key': 'table', 'type': 'str'},
'file': {'key': 'file', 'type': 'str'},
"blob": {"key": "blob", "type": "str"},
"queue": {"key": "queue", "type": "str"},
"table": {"key": "table", "type": "str"},
"file": {"key": "file", "type": "str"},
}
def __init__(
@ -142,14 +137,14 @@ class Endpoints(msrest.serialization.Model):
:keyword file: The file endpoint.
:paramtype file: str
"""
super(Endpoints, self).__init__(**kwargs)
super().__init__(**kwargs)
self.blob = blob
self.queue = queue
self.table = table
self.file = file
class Resource(msrest.serialization.Model):
class Resource(_serialization.Model):
"""Describes a storage resource.
Variables are only populated by the server, and will be ignored when sending a request.
@ -162,38 +157,32 @@ class Resource(msrest.serialization.Model):
:vartype type: str
:ivar location: Resource location.
:vartype location: str
:ivar tags: A set of tags. Resource tags.
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
"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'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"location": {"key": "location", "type": "str"},
"tags": {"key": "tags", "type": "{str}"},
}
def __init__(
self,
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
**kwargs
):
def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs):
"""
:keyword location: Resource location.
:paramtype location: str
:keyword tags: A set of tags. Resource tags.
:keyword tags: Resource tags.
:paramtype tags: dict[str, str]
"""
super(Resource, self).__init__(**kwargs)
super().__init__(**kwargs)
self.id = None
self.name = None
self.type = None
@ -201,7 +190,7 @@ class Resource(msrest.serialization.Model):
self.tags = tags
class StorageAccount(Resource):
class StorageAccount(Resource): # pylint: disable=too-many-instance-attributes
"""The storage account.
Variables are only populated by the server, and will be ignored when sending a request.
@ -214,13 +203,13 @@ class StorageAccount(Resource):
:vartype type: str
:ivar location: Resource location.
:vartype location: str
:ivar tags: A set of tags. Resource tags.
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar provisioning_state: The status of the storage account at the time the operation was
called. Known values are: "Creating", "ResolvingDNS", "Succeeded".
called. Known values are: "Creating", "ResolvingDNS", and "Succeeded".
:vartype provisioning_state: str or ~azure.mgmt.storage.v2015_06_15.models.ProvisioningState
:ivar account_type: The type of the storage account. Known values are: "Standard_LRS",
"Standard_ZRS", "Standard_GRS", "Standard_RAGRS", "Premium_LRS".
"Standard_ZRS", "Standard_GRS", "Standard_RAGRS", and "Premium_LRS".
:vartype account_type: str or ~azure.mgmt.storage.v2015_06_15.models.AccountType
:ivar primary_endpoints: The URLs that are used to perform a retrieval of a public blob, queue,
or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob endpoint.
@ -228,7 +217,7 @@ class StorageAccount(Resource):
:ivar primary_location: The location of the primary data center for the storage account.
:vartype primary_location: str
:ivar status_of_primary: The status indicating whether the primary location of the storage
account is available or unavailable. Known values are: "Available", "Unavailable".
account is available or unavailable. Known values are: "Available" and "Unavailable".
:vartype status_of_primary: str or ~azure.mgmt.storage.v2015_06_15.models.AccountStatus
:ivar last_geo_failover_time: The timestamp of the most recent instance of a failover to the
secondary location. Only the most recent timestamp is retained. This element is not returned if
@ -240,7 +229,7 @@ class StorageAccount(Resource):
:vartype secondary_location: str
:ivar status_of_secondary: The status indicating whether the secondary location of the storage
account is available or unavailable. Only available if the SKU name is Standard_GRS or
Standard_RAGRS. Known values are: "Available", "Unavailable".
Standard_RAGRS. Known values are: "Available" and "Unavailable".
:vartype status_of_secondary: str or ~azure.mgmt.storage.v2015_06_15.models.AccountStatus
:ivar creation_time: The creation date and time of the storage account in UTC.
:vartype creation_time: ~datetime.datetime
@ -253,28 +242,28 @@ class StorageAccount(Resource):
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
"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'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'account_type': {'key': 'properties.accountType', 'type': 'str'},
'primary_endpoints': {'key': 'properties.primaryEndpoints', 'type': 'Endpoints'},
'primary_location': {'key': 'properties.primaryLocation', 'type': 'str'},
'status_of_primary': {'key': 'properties.statusOfPrimary', 'type': 'str'},
'last_geo_failover_time': {'key': 'properties.lastGeoFailoverTime', 'type': 'iso-8601'},
'secondary_location': {'key': 'properties.secondaryLocation', 'type': 'str'},
'status_of_secondary': {'key': 'properties.statusOfSecondary', 'type': 'str'},
'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'},
'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'},
'secondary_endpoints': {'key': 'properties.secondaryEndpoints', 'type': 'Endpoints'},
"id": {"key": "id", "type": "str"},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"location": {"key": "location", "type": "str"},
"tags": {"key": "tags", "type": "{str}"},
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
"account_type": {"key": "properties.accountType", "type": "str"},
"primary_endpoints": {"key": "properties.primaryEndpoints", "type": "Endpoints"},
"primary_location": {"key": "properties.primaryLocation", "type": "str"},
"status_of_primary": {"key": "properties.statusOfPrimary", "type": "str"},
"last_geo_failover_time": {"key": "properties.lastGeoFailoverTime", "type": "iso-8601"},
"secondary_location": {"key": "properties.secondaryLocation", "type": "str"},
"status_of_secondary": {"key": "properties.statusOfSecondary", "type": "str"},
"creation_time": {"key": "properties.creationTime", "type": "iso-8601"},
"custom_domain": {"key": "properties.customDomain", "type": "CustomDomain"},
"secondary_endpoints": {"key": "properties.secondaryEndpoints", "type": "Endpoints"},
}
def __init__(
@ -298,13 +287,13 @@ class StorageAccount(Resource):
"""
:keyword location: Resource location.
:paramtype location: str
:keyword tags: A set of tags. Resource tags.
:keyword tags: Resource tags.
:paramtype tags: dict[str, str]
:keyword provisioning_state: The status of the storage account at the time the operation was
called. Known values are: "Creating", "ResolvingDNS", "Succeeded".
called. Known values are: "Creating", "ResolvingDNS", and "Succeeded".
:paramtype provisioning_state: str or ~azure.mgmt.storage.v2015_06_15.models.ProvisioningState
:keyword account_type: The type of the storage account. Known values are: "Standard_LRS",
"Standard_ZRS", "Standard_GRS", "Standard_RAGRS", "Premium_LRS".
"Standard_ZRS", "Standard_GRS", "Standard_RAGRS", and "Premium_LRS".
:paramtype account_type: str or ~azure.mgmt.storage.v2015_06_15.models.AccountType
:keyword primary_endpoints: The URLs that are used to perform a retrieval of a public blob,
queue, or table object. Note that Standard_ZRS and Premium_LRS accounts only return the blob
@ -313,7 +302,7 @@ class StorageAccount(Resource):
:keyword primary_location: The location of the primary data center for the storage account.
:paramtype primary_location: str
:keyword status_of_primary: The status indicating whether the primary location of the storage
account is available or unavailable. Known values are: "Available", "Unavailable".
account is available or unavailable. Known values are: "Available" and "Unavailable".
:paramtype status_of_primary: str or ~azure.mgmt.storage.v2015_06_15.models.AccountStatus
:keyword last_geo_failover_time: The timestamp of the most recent instance of a failover to the
secondary location. Only the most recent timestamp is retained. This element is not returned if
@ -325,7 +314,7 @@ class StorageAccount(Resource):
:paramtype secondary_location: str
:keyword status_of_secondary: The status indicating whether the secondary location of the
storage account is available or unavailable. Only available if the SKU name is Standard_GRS or
Standard_RAGRS. Known values are: "Available", "Unavailable".
Standard_RAGRS. Known values are: "Available" and "Unavailable".
:paramtype status_of_secondary: str or ~azure.mgmt.storage.v2015_06_15.models.AccountStatus
:keyword creation_time: The creation date and time of the storage account in UTC.
:paramtype creation_time: ~datetime.datetime
@ -336,7 +325,7 @@ class StorageAccount(Resource):
the SKU name is Standard_RAGRS.
:paramtype secondary_endpoints: ~azure.mgmt.storage.v2015_06_15.models.Endpoints
"""
super(StorageAccount, self).__init__(location=location, tags=tags, **kwargs)
super().__init__(location=location, tags=tags, **kwargs)
self.provisioning_state = provisioning_state
self.account_type = account_type
self.primary_endpoints = primary_endpoints
@ -350,7 +339,7 @@ class StorageAccount(Resource):
self.secondary_endpoints = secondary_endpoints
class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model):
class StorageAccountCheckNameAvailabilityParameters(_serialization.Model):
"""The parameters used to check the availability of the storage account name.
All required parameters must be populated in order to send to Azure.
@ -362,61 +351,55 @@ class StorageAccountCheckNameAvailabilityParameters(msrest.serialization.Model):
"""
_validation = {
'name': {'required': True},
"name": {"required": True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
}
def __init__(
self,
*,
name: str,
type: Optional[str] = "Microsoft.Storage/storageAccounts",
**kwargs
):
def __init__(self, *, name: str, type: str = "Microsoft.Storage/storageAccounts", **kwargs):
"""
:keyword name: Required.
:paramtype name: str
:keyword type:
:paramtype type: str
"""
super(StorageAccountCheckNameAvailabilityParameters, self).__init__(**kwargs)
super().__init__(**kwargs)
self.name = name
self.type = type
class StorageAccountCreateParameters(msrest.serialization.Model):
class StorageAccountCreateParameters(_serialization.Model):
"""The parameters to provide for the account.
All required parameters must be populated in order to send to Azure.
:ivar location: Required. The location of the resource. This will be one of the supported and
registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a
resource cannot be changed once it is created, but if an identical geo region is specified on
update, the request will succeed.
:ivar location: The location of the resource. This will be one of the supported and registered
Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource
cannot be changed once it is created, but if an identical geo region is specified on update,
the request will succeed. Required.
:vartype location: str
:ivar tags: A set of tags. A list of key value pairs that describe the resource. These tags can
be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags
can be provided for a resource. Each tag must have a key with a length no greater than 128
characters and a value with a length no greater than 256 characters.
:ivar tags: A list of key value pairs that describe the resource. These tags can be used for
viewing and grouping this resource (across resource groups). A maximum of 15 tags can be
provided for a resource. Each tag must have a key with a length no greater than 128 characters
and a value with a length no greater than 256 characters.
:vartype tags: dict[str, str]
:ivar account_type: The sku name. Required for account creation; optional for update. Note that
in older versions, sku name was called accountType. Known values are: "Standard_LRS",
"Standard_ZRS", "Standard_GRS", "Standard_RAGRS", "Premium_LRS".
"Standard_ZRS", "Standard_GRS", "Standard_RAGRS", and "Premium_LRS".
:vartype account_type: str or ~azure.mgmt.storage.v2015_06_15.models.AccountType
"""
_validation = {
'location': {'required': True},
"location": {"required": True},
}
_attribute_map = {
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'account_type': {'key': 'properties.accountType', 'type': 'str'},
"location": {"key": "location", "type": "str"},
"tags": {"key": "tags", "type": "{str}"},
"account_type": {"key": "properties.accountType", "type": "str"},
}
def __init__(
@ -428,28 +411,28 @@ class StorageAccountCreateParameters(msrest.serialization.Model):
**kwargs
):
"""
:keyword location: Required. The location of the resource. This will be one of the supported
and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region
of a resource cannot be changed once it is created, but if an identical geo region is specified
on update, the request will succeed.
:keyword location: The location of the resource. This will be one of the supported and
registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a
resource cannot be changed once it is created, but if an identical geo region is specified on
update, the request will succeed. Required.
:paramtype location: str
:keyword tags: A set of tags. A list of key value pairs that describe the resource. These tags
can be used for viewing and grouping this resource (across resource groups). A maximum of 15
tags can be provided for a resource. Each tag must have a key with a length no greater than 128
characters and a value with a length no greater than 256 characters.
:keyword tags: A list of key value pairs that describe the resource. These tags can be used for
viewing and grouping this resource (across resource groups). A maximum of 15 tags can be
provided for a resource. Each tag must have a key with a length no greater than 128 characters
and a value with a length no greater than 256 characters.
:paramtype tags: dict[str, str]
:keyword account_type: The sku name. Required for account creation; optional for update. Note
that in older versions, sku name was called accountType. Known values are: "Standard_LRS",
"Standard_ZRS", "Standard_GRS", "Standard_RAGRS", "Premium_LRS".
"Standard_ZRS", "Standard_GRS", "Standard_RAGRS", and "Premium_LRS".
:paramtype account_type: str or ~azure.mgmt.storage.v2015_06_15.models.AccountType
"""
super(StorageAccountCreateParameters, self).__init__(**kwargs)
super().__init__(**kwargs)
self.location = location
self.tags = tags
self.account_type = account_type
class StorageAccountKeys(msrest.serialization.Model):
class StorageAccountKeys(_serialization.Model):
"""The access keys for the storage account.
:ivar key1: The value of key 1.
@ -459,29 +442,23 @@ class StorageAccountKeys(msrest.serialization.Model):
"""
_attribute_map = {
'key1': {'key': 'key1', 'type': 'str'},
'key2': {'key': 'key2', 'type': 'str'},
"key1": {"key": "key1", "type": "str"},
"key2": {"key": "key2", "type": "str"},
}
def __init__(
self,
*,
key1: Optional[str] = None,
key2: Optional[str] = None,
**kwargs
):
def __init__(self, *, key1: Optional[str] = None, key2: Optional[str] = None, **kwargs):
"""
:keyword key1: The value of key 1.
:paramtype key1: str
:keyword key2: The value of key 2.
:paramtype key2: str
"""
super(StorageAccountKeys, self).__init__(**kwargs)
super().__init__(**kwargs)
self.key1 = key1
self.key2 = key2
class StorageAccountListResult(msrest.serialization.Model):
class StorageAccountListResult(_serialization.Model):
"""The list storage accounts operation response.
:ivar value: The list of storage accounts and their properties.
@ -489,24 +466,19 @@ class StorageAccountListResult(msrest.serialization.Model):
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[StorageAccount]'},
"value": {"key": "value", "type": "[StorageAccount]"},
}
def __init__(
self,
*,
value: Optional[List["_models.StorageAccount"]] = None,
**kwargs
):
def __init__(self, *, value: Optional[List["_models.StorageAccount"]] = None, **kwargs):
"""
:keyword value: The list of storage accounts and their properties.
:paramtype value: list[~azure.mgmt.storage.v2015_06_15.models.StorageAccount]
"""
super(StorageAccountListResult, self).__init__(**kwargs)
super().__init__(**kwargs)
self.value = value
class StorageAccountRegenerateKeyParameters(msrest.serialization.Model):
class StorageAccountRegenerateKeyParameters(_serialization.Model):
"""The parameters used to regenerate the storage account key.
All required parameters must be populated in order to send to Azure.
@ -516,36 +488,31 @@ class StorageAccountRegenerateKeyParameters(msrest.serialization.Model):
"""
_validation = {
'key_name': {'required': True},
"key_name": {"required": True},
}
_attribute_map = {
'key_name': {'key': 'keyName', 'type': 'str'},
"key_name": {"key": "keyName", "type": "str"},
}
def __init__(
self,
*,
key_name: str,
**kwargs
):
def __init__(self, *, key_name: str, **kwargs):
"""
:keyword key_name: Required.
:paramtype key_name: str
"""
super(StorageAccountRegenerateKeyParameters, self).__init__(**kwargs)
super().__init__(**kwargs)
self.key_name = key_name
class StorageAccountUpdateParameters(msrest.serialization.Model):
class StorageAccountUpdateParameters(_serialization.Model):
"""The parameters to update on the account.
:ivar tags: A set of tags. Resource tags.
:ivar tags: Resource tags.
:vartype tags: dict[str, str]
:ivar account_type: The account type. Note that StandardZRS and PremiumLRS accounts cannot be
changed to other account types, and other account types cannot be changed to StandardZRS or
PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS", "Standard_RAGRS",
"Premium_LRS".
and "Premium_LRS".
:vartype account_type: str or ~azure.mgmt.storage.v2015_06_15.models.AccountType
:ivar custom_domain: User domain assigned to the storage account. Name is the CNAME source.
Only one custom domain is supported per storage account at this time. To clear the existing
@ -554,9 +521,9 @@ class StorageAccountUpdateParameters(msrest.serialization.Model):
"""
_attribute_map = {
'tags': {'key': 'tags', 'type': '{str}'},
'account_type': {'key': 'properties.accountType', 'type': 'str'},
'custom_domain': {'key': 'properties.customDomain', 'type': 'CustomDomain'},
"tags": {"key": "tags", "type": "{str}"},
"account_type": {"key": "properties.accountType", "type": "str"},
"custom_domain": {"key": "properties.customDomain", "type": "CustomDomain"},
}
def __init__(
@ -568,54 +535,54 @@ class StorageAccountUpdateParameters(msrest.serialization.Model):
**kwargs
):
"""
:keyword tags: A set of tags. Resource tags.
:keyword tags: Resource tags.
:paramtype tags: dict[str, str]
:keyword account_type: The account type. Note that StandardZRS and PremiumLRS accounts cannot
be changed to other account types, and other account types cannot be changed to StandardZRS or
PremiumLRS. Known values are: "Standard_LRS", "Standard_ZRS", "Standard_GRS", "Standard_RAGRS",
"Premium_LRS".
and "Premium_LRS".
:paramtype account_type: str or ~azure.mgmt.storage.v2015_06_15.models.AccountType
:keyword custom_domain: User domain assigned to the storage account. Name is the CNAME source.
Only one custom domain is supported per storage account at this time. To clear the existing
custom domain, use an empty string for the custom domain name property.
:paramtype custom_domain: ~azure.mgmt.storage.v2015_06_15.models.CustomDomain
"""
super(StorageAccountUpdateParameters, self).__init__(**kwargs)
super().__init__(**kwargs)
self.tags = tags
self.account_type = account_type
self.custom_domain = custom_domain
class Usage(msrest.serialization.Model):
class Usage(_serialization.Model):
"""Describes Storage Resource Usage.
All required parameters must be populated in order to send to Azure.
:ivar unit: Required. The unit of measurement. Known values are: "Count", "Bytes", "Seconds",
"Percent", "CountsPerSecond", "BytesPerSecond".
:ivar unit: The unit of measurement. Required. Known values are: "Count", "Bytes", "Seconds",
"Percent", "CountsPerSecond", and "BytesPerSecond".
:vartype unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit
:ivar current_value: Required. The current count of the allocated resources in the
subscription.
:ivar current_value: The current count of the allocated resources in the subscription.
Required.
:vartype current_value: int
:ivar limit: Required. The maximum count of the resources that can be allocated in the
subscription.
:ivar limit: The maximum count of the resources that can be allocated in the subscription.
Required.
:vartype limit: int
:ivar name: Required. The name of the type of usage.
:ivar name: The name of the type of usage. Required.
:vartype name: ~azure.mgmt.storage.v2015_06_15.models.UsageName
"""
_validation = {
'unit': {'required': True},
'current_value': {'required': True},
'limit': {'required': True},
'name': {'required': True},
"unit": {"required": True},
"current_value": {"required": True},
"limit": {"required": True},
"name": {"required": True},
}
_attribute_map = {
'unit': {'key': 'unit', 'type': 'str'},
'current_value': {'key': 'currentValue', 'type': 'int'},
'limit': {'key': 'limit', 'type': 'int'},
'name': {'key': 'name', 'type': 'UsageName'},
"unit": {"key": "unit", "type": "str"},
"current_value": {"key": "currentValue", "type": "int"},
"limit": {"key": "limit", "type": "int"},
"name": {"key": "name", "type": "UsageName"},
}
def __init__(
@ -628,26 +595,26 @@ class Usage(msrest.serialization.Model):
**kwargs
):
"""
:keyword unit: Required. The unit of measurement. Known values are: "Count", "Bytes",
"Seconds", "Percent", "CountsPerSecond", "BytesPerSecond".
:keyword unit: The unit of measurement. Required. Known values are: "Count", "Bytes",
"Seconds", "Percent", "CountsPerSecond", and "BytesPerSecond".
:paramtype unit: str or ~azure.mgmt.storage.v2015_06_15.models.UsageUnit
:keyword current_value: Required. The current count of the allocated resources in the
subscription.
:keyword current_value: The current count of the allocated resources in the subscription.
Required.
:paramtype current_value: int
:keyword limit: Required. The maximum count of the resources that can be allocated in the
subscription.
:keyword limit: The maximum count of the resources that can be allocated in the subscription.
Required.
:paramtype limit: int
:keyword name: Required. The name of the type of usage.
:keyword name: The name of the type of usage. Required.
:paramtype name: ~azure.mgmt.storage.v2015_06_15.models.UsageName
"""
super(Usage, self).__init__(**kwargs)
super().__init__(**kwargs)
self.unit = unit
self.current_value = current_value
self.limit = limit
self.name = name
class UsageListResult(msrest.serialization.Model):
class UsageListResult(_serialization.Model):
"""The List Usages operation response.
:ivar value: The list Storage Resource Usages.
@ -655,24 +622,19 @@ class UsageListResult(msrest.serialization.Model):
"""
_attribute_map = {
'value': {'key': 'value', 'type': '[Usage]'},
"value": {"key": "value", "type": "[Usage]"},
}
def __init__(
self,
*,
value: Optional[List["_models.Usage"]] = None,
**kwargs
):
def __init__(self, *, value: Optional[List["_models.Usage"]] = None, **kwargs):
"""
:keyword value: The list Storage Resource Usages.
:paramtype value: list[~azure.mgmt.storage.v2015_06_15.models.Usage]
"""
super(UsageListResult, self).__init__(**kwargs)
super().__init__(**kwargs)
self.value = value
class UsageName(msrest.serialization.Model):
class UsageName(_serialization.Model):
"""The Usage Names.
:ivar value: A string describing the resource name.
@ -682,23 +644,17 @@ class UsageName(msrest.serialization.Model):
"""
_attribute_map = {
'value': {'key': 'value', 'type': 'str'},
'localized_value': {'key': 'localizedValue', 'type': 'str'},
"value": {"key": "value", "type": "str"},
"localized_value": {"key": "localizedValue", "type": "str"},
}
def __init__(
self,
*,
value: Optional[str] = None,
localized_value: Optional[str] = None,
**kwargs
):
def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs):
"""
:keyword value: A string describing the resource name.
:paramtype value: str
:keyword localized_value: A localized string describing the resource name.
:paramtype localized_value: str
"""
super(UsageName, self).__init__(**kwargs)
super().__init__(**kwargs)
self.value = value
self.localized_value = localized_value

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Просмотреть файл

@ -18,6 +18,7 @@ class AccountStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
AVAILABLE = "Available"
UNAVAILABLE = "Unavailable"
class AccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The sku name. Required for account creation; optional for update. Note that in older versions,
sku name was called accountType.
@ -29,14 +30,15 @@ class AccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
STANDARD_RAGRS = "Standard_RAGRS"
PREMIUM_LRS = "Premium_LRS"
class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The status of the storage account at the time the operation was called.
"""
"""The status of the storage account at the time the operation was called."""
CREATING = "Creating"
RESOLVING_DNS = "ResolvingDNS"
SUCCEEDED = "Succeeded"
class Reason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The reason that a storage account name could not be used. The Reason element is only returned
if NameAvailable is false.
@ -45,9 +47,9 @@ class Reason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
ACCOUNT_NAME_INVALID = "AccountNameInvalid"
ALREADY_EXISTS = "AlreadyExists"
class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The unit of measurement.
"""
"""The unit of measurement."""
COUNT = "Count"
BYTES = "Bytes"

Просмотреть файл

@ -12,9 +12,10 @@ from ._usage_operations import UsageOperations
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'StorageAccountsOperations',
'UsageOperations',
"StorageAccountsOperations",
"UsageOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,11 +6,18 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
@ -20,44 +27,43 @@ from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
def build_list_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2015-06-15")) # type: str
accept = _headers.pop('Accept', "application/json, text/json")
api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"]
accept = _headers.pop("Accept", "application/json, text/json")
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
_headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
return HttpRequest(
method="GET",
url=_url,
params=_params,
headers=_headers,
**kwargs
)
class UsageOperations:
"""
@ -78,36 +84,36 @@ class UsageOperations:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list(
self,
**kwargs: Any
) -> Iterable[_models.UsageListResult]:
def list(self, **kwargs: Any) -> Iterable["_models.Usage"]:
"""Lists the current usage count and the limit for the resources under the subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either UsageListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2015_06_15.models.UsageListResult]
:raises: ~azure.core.exceptions.HttpResponseError
:return: An iterator like instance of either Usage or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2015_06_15.models.Usage]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2015-06-15")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.UsageListResult]
api_version = kwargs.pop("api_version", _params.pop("api-version", "2015-06-15")) # type: Literal["2015-06-15"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop('error_map', {}) or {})
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
@ -115,13 +121,17 @@ class UsageOperations:
request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
@ -138,10 +148,8 @@ class UsageOperations:
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
@ -151,8 +159,6 @@ class UsageOperations:
return pipeline_response
return ItemPaged(get_next, extract_data)
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore

Просмотреть файл

@ -17,7 +17,10 @@ try:
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['StorageManagementClient']
__all__ = [
"StorageManagementClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
@ -14,6 +15,11 @@ from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLo
from ._version import VERSION
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
@ -25,24 +31,19 @@ class StorageManagementClientConfiguration(Configuration): # pylint: disable=to
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2016-01-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2016-01-01") # type: str
api_version = kwargs.pop("api_version", "2016-01-01") # type: Literal["2016-01-01"]
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -52,23 +53,24 @@ class StorageManagementClientConfiguration(Configuration): # pylint: disable=to
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-storage/{}".format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs # type: Any
self, **kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

Просмотреть файл

@ -10,20 +10,20 @@
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementClientConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"signature": "credential: \"TokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"signature": "subscription_id: str,",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.",
"docstring_type": "str",
"required": true
}
@ -31,13 +31,13 @@
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.",
"docstring_type": "str",
"required": true
}
@ -54,7 +54,7 @@
"required": false
},
"base_url": {
"signature": "base_url=\"https://management.azure.com\", # type: str",
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false
@ -100,4 +100,4 @@
"storage_accounts": "StorageAccountsOperations",
"usage": "UsageOperations"
}
}
}

Просмотреть файл

@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass

Просмотреть файл

@ -9,12 +9,11 @@
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from . import models
from .._serialization import Deserializer, Serializer
from ._configuration import StorageManagementClientConfiguration
from .operations import StorageAccountsOperations, UsageOperations
@ -22,17 +21,18 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class StorageManagementClient:
class StorageManagementClient: # pylint: disable=client-accepts-api-version-keyword
"""The Storage Management Client.
:ivar storage_accounts: StorageAccountsOperations operations
:vartype storage_accounts: azure.mgmt.storage.v2016_01_01.operations.StorageAccountsOperations
:ivar usage: UsageOperations operations
:vartype usage: azure.mgmt.storage.v2016_01_01.operations.UsageOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
@ -50,7 +50,9 @@ class StorageManagementClient:
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = StorageManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._config = StorageManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
@ -60,16 +62,9 @@ class StorageManagementClient:
self.storage_accounts = StorageAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -78,7 +73,7 @@ class StorageManagementClient:
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest

Просмотреть файл

@ -7,6 +7,7 @@
from azure.core.pipeline.transport import HttpRequest
def _convert_request(request, files=None):
data = request.content if not files else None
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
@ -14,6 +15,7 @@ def _convert_request(request, files=None):
request.set_formdata_body(files)
return request
def _format_url_section(template, **kwargs):
components = template.split("/")
while components:
@ -21,7 +23,5 @@ def _format_url_section(template, **kwargs):
return template.format(**kwargs)
except KeyError as key:
formatted_components = template.split("/")
components = [
c for c in formatted_components if "{}".format(key.args[0]) not in c
]
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
template = "/".join(components)

Просмотреть файл

@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
VERSION = "20.1.0"
VERSION = "21.0.0"

Просмотреть файл

@ -14,7 +14,10 @@ try:
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['StorageManagementClient']
__all__ = [
"StorageManagementClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
@ -14,6 +15,11 @@ from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuth
from .._version import VERSION
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
@ -25,24 +31,19 @@ class StorageManagementClientConfiguration(Configuration): # pylint: disable=to
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2016-01-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2016-01-01") # type: str
api_version = kwargs.pop("api_version", "2016-01-01") # type: Literal["2016-01-01"]
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -52,22 +53,21 @@ class StorageManagementClientConfiguration(Configuration): # pylint: disable=to
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-storage/{}".format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs: Any
) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

Просмотреть файл

@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass

Просмотреть файл

@ -9,12 +9,11 @@
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from .. import models
from ..._serialization import Deserializer, Serializer
from ._configuration import StorageManagementClientConfiguration
from .operations import StorageAccountsOperations, UsageOperations
@ -22,7 +21,8 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class StorageManagementClient:
class StorageManagementClient: # pylint: disable=client-accepts-api-version-keyword
"""The Storage Management Client.
:ivar storage_accounts: StorageAccountsOperations operations
@ -30,10 +30,10 @@ class StorageManagementClient:
azure.mgmt.storage.v2016_01_01.aio.operations.StorageAccountsOperations
:ivar usage: UsageOperations operations
:vartype usage: azure.mgmt.storage.v2016_01_01.aio.operations.UsageOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
@ -51,7 +51,9 @@ class StorageManagementClient:
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = StorageManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._config = StorageManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
@ -61,16 +63,9 @@ class StorageManagementClient:
self.storage_accounts = StorageAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> Awaitable[AsyncHttpResponse]:
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -79,7 +74,7 @@ class StorageManagementClient:
>>> response = await client._send_request(request)
<AsyncHttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest

Просмотреть файл

@ -12,9 +12,10 @@ from ._usage_operations import UsageOperations
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'StorageAccountsOperations',
'UsageOperations',
"StorageAccountsOperations",
"UsageOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,10 +6,19 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
@ -20,9 +29,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
from ..._vendor import _convert_request
from ...operations._usage_operations import build_list_request
T = TypeVar('T')
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class UsageOperations:
"""
.. warning::
@ -42,37 +57,36 @@ class UsageOperations:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list(
self,
**kwargs: Any
) -> AsyncIterable[_models.UsageListResult]:
def list(self, **kwargs: Any) -> AsyncIterable["_models.Usage"]:
"""Gets the current usage count and the limit for the resources under the subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either UsageListResult or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_01_01.models.UsageListResult]
:raises: ~azure.core.exceptions.HttpResponseError
:return: An iterator like instance of either Usage or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_01_01.models.Usage]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2016-01-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.UsageListResult]
api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-01-01")) # type: Literal["2016-01-01"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop('error_map', {}) or {})
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
@ -80,13 +94,17 @@ class UsageOperations:
request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
@ -103,10 +121,8 @@ class UsageOperations:
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
@ -116,8 +132,6 @@ class UsageOperations:
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore

Просмотреть файл

@ -26,50 +26,52 @@ from ._models_py3 import Usage
from ._models_py3 import UsageListResult
from ._models_py3 import UsageName
from ._storage_management_client_enums import (
AccessTier,
AccountStatus,
KeyPermission,
Kind,
ProvisioningState,
Reason,
SkuName,
SkuTier,
UsageUnit,
)
from ._storage_management_client_enums import AccessTier
from ._storage_management_client_enums import AccountStatus
from ._storage_management_client_enums import EncryptionKeySource
from ._storage_management_client_enums import KeyPermission
from ._storage_management_client_enums import Kind
from ._storage_management_client_enums import ProvisioningState
from ._storage_management_client_enums import Reason
from ._storage_management_client_enums import SkuName
from ._storage_management_client_enums import SkuTier
from ._storage_management_client_enums import StorageAccountCheckNameAvailabilityParametersType
from ._storage_management_client_enums import UsageUnit
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'CheckNameAvailabilityResult',
'CustomDomain',
'Encryption',
'EncryptionService',
'EncryptionServices',
'Endpoints',
'Resource',
'Sku',
'StorageAccount',
'StorageAccountCheckNameAvailabilityParameters',
'StorageAccountCreateParameters',
'StorageAccountKey',
'StorageAccountListKeysResult',
'StorageAccountListResult',
'StorageAccountRegenerateKeyParameters',
'StorageAccountUpdateParameters',
'Usage',
'UsageListResult',
'UsageName',
'AccessTier',
'AccountStatus',
'KeyPermission',
'Kind',
'ProvisioningState',
'Reason',
'SkuName',
'SkuTier',
'UsageUnit',
"CheckNameAvailabilityResult",
"CustomDomain",
"Encryption",
"EncryptionService",
"EncryptionServices",
"Endpoints",
"Resource",
"Sku",
"StorageAccount",
"StorageAccountCheckNameAvailabilityParameters",
"StorageAccountCreateParameters",
"StorageAccountKey",
"StorageAccountListKeysResult",
"StorageAccountListResult",
"StorageAccountRegenerateKeyParameters",
"StorageAccountUpdateParameters",
"Usage",
"UsageListResult",
"UsageName",
"AccessTier",
"AccountStatus",
"EncryptionKeySource",
"KeyPermission",
"Kind",
"ProvisioningState",
"Reason",
"SkuName",
"SkuTier",
"StorageAccountCheckNameAvailabilityParametersType",
"UsageUnit",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Просмотреть файл

@ -11,12 +11,12 @@ from azure.core import CaseInsensitiveEnumMeta
class AccessTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Required for storage accounts where kind = BlobStorage. The access tier used for billing.
"""
"""Required for storage accounts where kind = BlobStorage. The access tier used for billing."""
HOT = "Hot"
COOL = "Cool"
class AccountStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the status indicating whether the primary location of the storage account is available or
unavailable.
@ -25,28 +25,35 @@ class AccountStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
AVAILABLE = "Available"
UNAVAILABLE = "Unavailable"
class EncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage."""
MICROSOFT_STORAGE = "Microsoft.Storage"
class KeyPermission(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Permissions for the key -- read-only or full permissions.
"""
"""Permissions for the key -- read-only or full permissions."""
READ = "READ"
FULL = "FULL"
class Kind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Required. Indicates the type of storage account.
"""
"""Required. Indicates the type of storage account."""
STORAGE = "Storage"
BLOB_STORAGE = "BlobStorage"
class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the status of the storage account at the time the operation was called.
"""
"""Gets the status of the storage account at the time the operation was called."""
CREATING = "Creating"
RESOLVING_DNS = "ResolvingDNS"
SUCCEEDED = "Succeeded"
class Reason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the reason that a storage account name could not be used. The Reason element is only
returned if NameAvailable is false.
@ -55,6 +62,7 @@ class Reason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
ACCOUNT_NAME_INVALID = "AccountNameInvalid"
ALREADY_EXISTS = "AlreadyExists"
class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets or sets the sku name. Required for account creation; optional for update. Note that in
older versions, sku name was called accountType.
@ -66,16 +74,22 @@ class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
STANDARD_ZRS = "Standard_ZRS"
PREMIUM_LRS = "Premium_LRS"
class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the sku tier. This is based on the SKU name.
"""
"""Gets the sku tier. This is based on the SKU name."""
STANDARD = "Standard"
PREMIUM = "Premium"
class StorageAccountCheckNameAvailabilityParametersType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""StorageAccountCheckNameAvailabilityParametersType."""
MICROSOFT_STORAGE_STORAGE_ACCOUNTS = "Microsoft.Storage/storageAccounts"
class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the unit of measurement.
"""
"""Gets the unit of measurement."""
COUNT = "Count"
BYTES = "Bytes"

Просмотреть файл

@ -12,9 +12,10 @@ from ._usage_operations import UsageOperations
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'StorageAccountsOperations',
'UsageOperations',
"StorageAccountsOperations",
"UsageOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,11 +6,18 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
@ -20,44 +27,43 @@ from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
def build_list_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2016-01-01")) # type: str
accept = _headers.pop('Accept', "application/json, text/json")
api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-01-01")) # type: Literal["2016-01-01"]
accept = _headers.pop("Accept", "application/json, text/json")
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
_headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
return HttpRequest(
method="GET",
url=_url,
params=_params,
headers=_headers,
**kwargs
)
class UsageOperations:
"""
@ -78,36 +84,36 @@ class UsageOperations:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list(
self,
**kwargs: Any
) -> Iterable[_models.UsageListResult]:
def list(self, **kwargs: Any) -> Iterable["_models.Usage"]:
"""Gets the current usage count and the limit for the resources under the subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either UsageListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_01_01.models.UsageListResult]
:raises: ~azure.core.exceptions.HttpResponseError
:return: An iterator like instance of either Usage or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_01_01.models.Usage]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2016-01-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.UsageListResult]
api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-01-01")) # type: Literal["2016-01-01"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop('error_map', {}) or {})
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
@ -115,13 +121,17 @@ class UsageOperations:
request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
@ -138,10 +148,8 @@ class UsageOperations:
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
@ -151,8 +159,6 @@ class UsageOperations:
return pipeline_response
return ItemPaged(get_next, extract_data)
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore

Просмотреть файл

@ -17,7 +17,10 @@ try:
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['StorageManagement']
__all__ = [
"StorageManagement",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
@ -14,6 +15,11 @@ from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLo
from ._version import VERSION
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
@ -25,24 +31,19 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2016-12-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageManagementConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2016-12-01") # type: str
api_version = kwargs.pop("api_version", "2016-12-01") # type: Literal["2016-12-01"]
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -52,23 +53,24 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-storage/{}".format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs # type: Any
self, **kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

Просмотреть файл

@ -10,20 +10,20 @@
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"signature": "credential: \"TokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"signature": "subscription_id: str,",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.",
"docstring_type": "str",
"required": true
}
@ -31,13 +31,13 @@
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.",
"docstring_type": "str",
"required": true
}
@ -54,7 +54,7 @@
"required": false
},
"base_url": {
"signature": "base_url=\"https://management.azure.com\", # type: str",
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false
@ -100,4 +100,4 @@
"storage_accounts": "StorageAccountsOperations",
"usage": "UsageOperations"
}
}
}

Просмотреть файл

@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass

Просмотреть файл

@ -9,12 +9,11 @@
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from . import models
from .._serialization import Deserializer, Serializer
from ._configuration import StorageManagementConfiguration
from .operations import StorageAccountsOperations, UsageOperations
@ -22,17 +21,18 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class StorageManagement:
class StorageManagement: # pylint: disable=client-accepts-api-version-keyword
"""The Azure Storage Management API.
:ivar storage_accounts: StorageAccountsOperations operations
:vartype storage_accounts: azure.mgmt.storage.v2016_12_01.operations.StorageAccountsOperations
:ivar usage: UsageOperations operations
:vartype usage: azure.mgmt.storage.v2016_12_01.operations.UsageOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
@ -60,16 +60,9 @@ class StorageManagement:
self.storage_accounts = StorageAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -78,7 +71,7 @@ class StorageManagement:
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest

Просмотреть файл

@ -7,6 +7,7 @@
from azure.core.pipeline.transport import HttpRequest
def _convert_request(request, files=None):
data = request.content if not files else None
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
@ -14,6 +15,7 @@ def _convert_request(request, files=None):
request.set_formdata_body(files)
return request
def _format_url_section(template, **kwargs):
components = template.split("/")
while components:
@ -21,7 +23,5 @@ def _format_url_section(template, **kwargs):
return template.format(**kwargs)
except KeyError as key:
formatted_components = template.split("/")
components = [
c for c in formatted_components if "{}".format(key.args[0]) not in c
]
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
template = "/".join(components)

Просмотреть файл

@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
VERSION = "20.1.0"
VERSION = "21.0.0"

Просмотреть файл

@ -14,7 +14,10 @@ try:
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['StorageManagement']
__all__ = [
"StorageManagement",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
@ -14,6 +15,11 @@ from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuth
from .._version import VERSION
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
@ -25,24 +31,19 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2016-12-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageManagementConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2016-12-01") # type: str
api_version = kwargs.pop("api_version", "2016-12-01") # type: Literal["2016-12-01"]
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -52,22 +53,21 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-storage/{}".format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs: Any
) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

Просмотреть файл

@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass

Просмотреть файл

@ -9,12 +9,11 @@
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from .. import models
from ..._serialization import Deserializer, Serializer
from ._configuration import StorageManagementConfiguration
from .operations import StorageAccountsOperations, UsageOperations
@ -22,7 +21,8 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class StorageManagement:
class StorageManagement: # pylint: disable=client-accepts-api-version-keyword
"""The Azure Storage Management API.
:ivar storage_accounts: StorageAccountsOperations operations
@ -30,10 +30,10 @@ class StorageManagement:
azure.mgmt.storage.v2016_12_01.aio.operations.StorageAccountsOperations
:ivar usage: UsageOperations operations
:vartype usage: azure.mgmt.storage.v2016_12_01.aio.operations.UsageOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
@ -61,16 +61,9 @@ class StorageManagement:
self.storage_accounts = StorageAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> Awaitable[AsyncHttpResponse]:
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -79,7 +72,7 @@ class StorageManagement:
>>> response = await client._send_request(request)
<AsyncHttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest

Просмотреть файл

@ -12,9 +12,10 @@ from ._usage_operations import UsageOperations
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'StorageAccountsOperations',
'UsageOperations',
"StorageAccountsOperations",
"UsageOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,10 +6,19 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
@ -20,9 +29,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
from ..._vendor import _convert_request
from ...operations._usage_operations import build_list_request
T = TypeVar('T')
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class UsageOperations:
"""
.. warning::
@ -42,37 +57,36 @@ class UsageOperations:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list(
self,
**kwargs: Any
) -> AsyncIterable[_models.UsageListResult]:
def list(self, **kwargs: Any) -> AsyncIterable["_models.Usage"]:
"""Gets the current usage count and the limit for the resources under the subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either UsageListResult or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_12_01.models.UsageListResult]
:raises: ~azure.core.exceptions.HttpResponseError
:return: An iterator like instance of either Usage or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2016_12_01.models.Usage]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2016-12-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.UsageListResult]
api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) # type: Literal["2016-12-01"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop('error_map', {}) or {})
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
@ -80,13 +94,17 @@ class UsageOperations:
request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
@ -103,10 +121,8 @@ class UsageOperations:
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
@ -116,8 +132,6 @@ class UsageOperations:
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore

Просмотреть файл

@ -30,66 +30,68 @@ from ._models_py3 import Usage
from ._models_py3 import UsageListResult
from ._models_py3 import UsageName
from ._storage_management_enums import (
AccessTier,
AccountSasParametersSignedPermission,
AccountSasParametersSignedResourceTypes,
AccountSasParametersSignedServices,
AccountStatus,
HttpProtocol,
KeyPermission,
Kind,
Permissions,
ProvisioningState,
Reason,
SignedResource,
SkuName,
SkuTier,
UsageUnit,
)
from ._storage_management_enums import AccessTier
from ._storage_management_enums import AccountSasParametersSignedPermission
from ._storage_management_enums import AccountSasParametersSignedResourceTypes
from ._storage_management_enums import AccountSasParametersSignedServices
from ._storage_management_enums import AccountStatus
from ._storage_management_enums import EncryptionKeySource
from ._storage_management_enums import HttpProtocol
from ._storage_management_enums import KeyPermission
from ._storage_management_enums import Kind
from ._storage_management_enums import Permissions
from ._storage_management_enums import ProvisioningState
from ._storage_management_enums import Reason
from ._storage_management_enums import SignedResource
from ._storage_management_enums import SkuName
from ._storage_management_enums import SkuTier
from ._storage_management_enums import StorageAccountCheckNameAvailabilityParametersType
from ._storage_management_enums import UsageUnit
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'AccountSasParameters',
'CheckNameAvailabilityResult',
'CustomDomain',
'Encryption',
'EncryptionService',
'EncryptionServices',
'Endpoints',
'ListAccountSasResponse',
'ListServiceSasResponse',
'Resource',
'ServiceSasParameters',
'Sku',
'StorageAccount',
'StorageAccountCheckNameAvailabilityParameters',
'StorageAccountCreateParameters',
'StorageAccountKey',
'StorageAccountListKeysResult',
'StorageAccountListResult',
'StorageAccountRegenerateKeyParameters',
'StorageAccountUpdateParameters',
'Usage',
'UsageListResult',
'UsageName',
'AccessTier',
'AccountSasParametersSignedPermission',
'AccountSasParametersSignedResourceTypes',
'AccountSasParametersSignedServices',
'AccountStatus',
'HttpProtocol',
'KeyPermission',
'Kind',
'Permissions',
'ProvisioningState',
'Reason',
'SignedResource',
'SkuName',
'SkuTier',
'UsageUnit',
"AccountSasParameters",
"CheckNameAvailabilityResult",
"CustomDomain",
"Encryption",
"EncryptionService",
"EncryptionServices",
"Endpoints",
"ListAccountSasResponse",
"ListServiceSasResponse",
"Resource",
"ServiceSasParameters",
"Sku",
"StorageAccount",
"StorageAccountCheckNameAvailabilityParameters",
"StorageAccountCreateParameters",
"StorageAccountKey",
"StorageAccountListKeysResult",
"StorageAccountListResult",
"StorageAccountRegenerateKeyParameters",
"StorageAccountUpdateParameters",
"Usage",
"UsageListResult",
"UsageName",
"AccessTier",
"AccountSasParametersSignedPermission",
"AccountSasParametersSignedResourceTypes",
"AccountSasParametersSignedServices",
"AccountStatus",
"EncryptionKeySource",
"HttpProtocol",
"KeyPermission",
"Kind",
"Permissions",
"ProvisioningState",
"Reason",
"SignedResource",
"SkuName",
"SkuTier",
"StorageAccountCheckNameAvailabilityParametersType",
"UsageUnit",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Просмотреть файл

@ -11,12 +11,12 @@ from azure.core import CaseInsensitiveEnumMeta
class AccessTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Required for storage accounts where kind = BlobStorage. The access tier used for billing.
"""
"""Required for storage accounts where kind = BlobStorage. The access tier used for billing."""
HOT = "Hot"
COOL = "Cool"
class AccountSasParametersSignedPermission(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The signed permissions for the account SAS. Possible values include: Read (r), Write (w),
Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p).
@ -31,6 +31,7 @@ class AccountSasParametersSignedPermission(str, Enum, metaclass=CaseInsensitiveE
U = "u"
P = "p"
class AccountSasParametersSignedResourceTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The signed resource types that are accessible with the account SAS. Service (s): Access to
service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to
@ -41,6 +42,7 @@ class AccountSasParametersSignedResourceTypes(str, Enum, metaclass=CaseInsensiti
C = "c"
O = "o"
class AccountSasParametersSignedServices(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The signed services accessible with the account SAS. Possible values include: Blob (b), Queue
(q), Table (t), File (f).
@ -51,6 +53,7 @@ class AccountSasParametersSignedServices(str, Enum, metaclass=CaseInsensitiveEnu
T = "t"
F = "f"
class AccountStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the status indicating whether the primary location of the storage account is available or
unavailable.
@ -59,27 +62,34 @@ class AccountStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta):
AVAILABLE = "available"
UNAVAILABLE = "unavailable"
class EncryptionKeySource(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage."""
MICROSOFT_STORAGE = "Microsoft.Storage"
class HttpProtocol(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The protocol permitted for a request made with the account SAS.
"""
"""The protocol permitted for a request made with the account SAS."""
HTTPS_HTTP = "https,http"
HTTPS = "https"
class KeyPermission(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Permissions for the key -- read-only or full permissions.
"""
"""Permissions for the key -- read-only or full permissions."""
READ = "Read"
FULL = "Full"
class Kind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Required. Indicates the type of storage account.
"""
"""Required. Indicates the type of storage account."""
STORAGE = "Storage"
BLOB_STORAGE = "BlobStorage"
class Permissions(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The signed permissions for the service SAS. Possible values include: Read (r), Write (w),
Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p).
@ -94,14 +104,15 @@ class Permissions(str, Enum, metaclass=CaseInsensitiveEnumMeta):
U = "u"
P = "p"
class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the status of the storage account at the time the operation was called.
"""
"""Gets the status of the storage account at the time the operation was called."""
CREATING = "Creating"
RESOLVING_DNS = "ResolvingDNS"
SUCCEEDED = "Succeeded"
class Reason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the reason that a storage account name could not be used. The Reason element is only
returned if NameAvailable is false.
@ -110,6 +121,7 @@ class Reason(str, Enum, metaclass=CaseInsensitiveEnumMeta):
ACCOUNT_NAME_INVALID = "AccountNameInvalid"
ALREADY_EXISTS = "AlreadyExists"
class SignedResource(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The signed services accessible with the service SAS. Possible values include: Blob (b),
Container (c), File (f), Share (s).
@ -120,6 +132,7 @@ class SignedResource(str, Enum, metaclass=CaseInsensitiveEnumMeta):
F = "f"
S = "s"
class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets or sets the sku name. Required for account creation; optional for update. Note that in
older versions, sku name was called accountType.
@ -131,16 +144,22 @@ class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
STANDARD_ZRS = "Standard_ZRS"
PREMIUM_LRS = "Premium_LRS"
class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the sku tier. This is based on the SKU name.
"""
"""Gets the sku tier. This is based on the SKU name."""
STANDARD = "Standard"
PREMIUM = "Premium"
class StorageAccountCheckNameAvailabilityParametersType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""StorageAccountCheckNameAvailabilityParametersType."""
MICROSOFT_STORAGE_STORAGE_ACCOUNTS = "Microsoft.Storage/storageAccounts"
class UsageUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Gets the unit of measurement.
"""
"""Gets the unit of measurement."""
COUNT = "Count"
BYTES = "Bytes"

Просмотреть файл

@ -12,9 +12,10 @@ from ._usage_operations import UsageOperations
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'StorageAccountsOperations',
'UsageOperations',
"StorageAccountsOperations",
"UsageOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,11 +6,18 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
@ -20,44 +27,43 @@ from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat
from .. import models as _models
from ..._serialization import Serializer
from .._vendor import _convert_request, _format_url_section
T = TypeVar('T')
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
def build_list_request(
subscription_id: str,
**kwargs: Any
) -> HttpRequest:
def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2016-12-01")) # type: str
accept = _headers.pop('Accept', "application/json, text/json")
api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) # type: Literal["2016-12-01"]
accept = _headers.pop("Accept", "application/json, text/json")
# Construct URL
_url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages")
path_format_arguments = {
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'),
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
}
_url = _format_url_section(_url, **path_format_arguments)
# Construct parameters
_params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str')
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
# Construct headers
_headers['Accept'] = _SERIALIZER.header("accept", accept, 'str')
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
return HttpRequest(
method="GET",
url=_url,
params=_params,
headers=_headers,
**kwargs
)
class UsageOperations:
"""
@ -78,36 +84,36 @@ class UsageOperations:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list(
self,
**kwargs: Any
) -> Iterable[_models.UsageListResult]:
def list(self, **kwargs: Any) -> Iterable["_models.Usage"]:
"""Gets the current usage count and the limit for the resources under the subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either UsageListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_12_01.models.UsageListResult]
:raises: ~azure.core.exceptions.HttpResponseError
:return: An iterator like instance of either Usage or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.storage.v2016_12_01.models.Usage]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2016-12-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.UsageListResult]
api_version = kwargs.pop("api_version", _params.pop("api-version", "2016-12-01")) # type: Literal["2016-12-01"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop('error_map', {}) or {})
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
@ -115,13 +121,17 @@ class UsageOperations:
request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
@ -138,10 +148,8 @@ class UsageOperations:
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
@ -151,8 +159,6 @@ class UsageOperations:
return pipeline_response
return ItemPaged(get_next, extract_data)
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore

Просмотреть файл

@ -17,7 +17,10 @@ try:
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['StorageManagement']
__all__ = [
"StorageManagement",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
@ -14,6 +15,11 @@ from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLo
from ._version import VERSION
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
@ -25,24 +31,19 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2017-06-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageManagementConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2017-06-01") # type: str
api_version = kwargs.pop("api_version", "2017-06-01") # type: Literal["2017-06-01"]
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -52,23 +53,24 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-storage/{}".format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs # type: Any
self, **kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

Просмотреть файл

@ -10,20 +10,20 @@
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"StorageManagementConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"signature": "credential: \"TokenCredential\",",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"signature": "subscription_id: str,",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.",
"docstring_type": "str",
"required": true
}
@ -31,13 +31,13 @@
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"description": "Credential needed for the client to connect to Azure. Required.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"description": "Gets subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. Required.",
"docstring_type": "str",
"required": true
}
@ -54,7 +54,7 @@
"required": false
},
"base_url": {
"signature": "base_url=\"https://management.azure.com\", # type: str",
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false
@ -102,4 +102,4 @@
"storage_accounts": "StorageAccountsOperations",
"usage": "UsageOperations"
}
}
}

Просмотреть файл

@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass

Просмотреть файл

@ -9,12 +9,11 @@
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from . import models
from .._serialization import Deserializer, Serializer
from ._configuration import StorageManagementConfiguration
from .operations import Operations, SkusOperations, StorageAccountsOperations, UsageOperations
@ -22,7 +21,8 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
class StorageManagement:
class StorageManagement: # pylint: disable=client-accepts-api-version-keyword
"""The Azure Storage Management API.
:ivar operations: Operations operations
@ -33,10 +33,10 @@ class StorageManagement:
:vartype storage_accounts: azure.mgmt.storage.v2017_06_01.operations.StorageAccountsOperations
:ivar usage: UsageOperations operations
:vartype usage: azure.mgmt.storage.v2017_06_01.operations.UsageOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
@ -61,25 +61,14 @@ class StorageManagement:
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize
)
self.skus = SkusOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize)
self.storage_accounts = StorageAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -88,7 +77,7 @@ class StorageManagement:
>>> response = client._send_request(request)
<HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest

Просмотреть файл

@ -7,6 +7,7 @@
from azure.core.pipeline.transport import HttpRequest
def _convert_request(request, files=None):
data = request.content if not files else None
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
@ -14,6 +15,7 @@ def _convert_request(request, files=None):
request.set_formdata_body(files)
return request
def _format_url_section(template, **kwargs):
components = template.split("/")
while components:
@ -21,7 +23,5 @@ def _format_url_section(template, **kwargs):
return template.format(**kwargs)
except KeyError as key:
formatted_components = template.split("/")
components = [
c for c in formatted_components if "{}".format(key.args[0]) not in c
]
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
template = "/".join(components)

Просмотреть файл

@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
VERSION = "20.1.0"
VERSION = "21.0.0"

Просмотреть файл

@ -14,7 +14,10 @@ try:
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['StorageManagement']
__all__ = [
"StorageManagement",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()

Просмотреть файл

@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
@ -14,6 +15,11 @@ from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuth
from .._version import VERSION
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
@ -25,24 +31,19 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2017-06-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(StorageManagementConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2017-06-01") # type: str
api_version = kwargs.pop("api_version", "2017-06-01") # type: Literal["2017-06-01"]
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
@ -52,22 +53,21 @@ class StorageManagementConfiguration(Configuration): # pylint: disable=too-many
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-storage/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-storage/{}".format(VERSION))
self._configure(**kwargs)
def _configure(
self,
**kwargs: Any
) -> None:
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)

Просмотреть файл

@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass

Просмотреть файл

@ -9,12 +9,11 @@
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from .. import models
from ..._serialization import Deserializer, Serializer
from ._configuration import StorageManagementConfiguration
from .operations import Operations, SkusOperations, StorageAccountsOperations, UsageOperations
@ -22,7 +21,8 @@ if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
class StorageManagement:
class StorageManagement: # pylint: disable=client-accepts-api-version-keyword
"""The Azure Storage Management API.
:ivar operations: Operations operations
@ -34,10 +34,10 @@ class StorageManagement:
azure.mgmt.storage.v2017_06_01.aio.operations.StorageAccountsOperations
:ivar usage: UsageOperations operations
:vartype usage: azure.mgmt.storage.v2017_06_01.aio.operations.UsageOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
Azure subscription. The subscription ID forms part of the URI for every service call.
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
@ -62,25 +62,14 @@ class StorageManagement:
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize
)
self.skus = SkusOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize)
self.storage_accounts = StorageAccountsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.usage = UsageOperations(self._client, self._config, self._serialize, self._deserialize)
def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> Awaitable[AsyncHttpResponse]:
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
>>> from azure.core.rest import HttpRequest
@ -89,7 +78,7 @@ class StorageManagement:
>>> response = await client._send_request(request)
<AsyncHttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest

Просмотреть файл

@ -14,11 +14,12 @@ from ._usage_operations import UsageOperations
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'Operations',
'SkusOperations',
'StorageAccountsOperations',
'UsageOperations',
"Operations",
"SkusOperations",
"StorageAccountsOperations",
"UsageOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Просмотреть файл

@ -6,10 +6,19 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
@ -20,9 +29,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
from ..._vendor import _convert_request
from ...operations._operations import build_list_request
T = TypeVar('T')
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class Operations:
"""
.. warning::
@ -42,36 +57,36 @@ class Operations:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list(
self,
**kwargs: Any
) -> AsyncIterable[_models.OperationListResult]:
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
"""Lists all of the available Storage Rest API operations.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationListResult or the result of cls(response)
:return: An iterator like instance of either Operation or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.OperationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.Operation]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2017-06-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult]
api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01")) # type: Literal["2017-06-01"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop('error_map', {}) or {})
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
api_version=api_version,
template_url=self.list.metadata['url'],
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
@ -79,12 +94,17 @@ class Operations:
request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
@ -101,10 +121,8 @@ class Operations:
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
@ -114,8 +132,6 @@ class Operations:
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/providers/Microsoft.Storage/operations"} # type: ignore
list.metadata = {"url": "/providers/Microsoft.Storage/operations"} # type: ignore

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Просмотреть файл

@ -6,10 +6,19 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
@ -20,9 +29,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
from ..._vendor import _convert_request
from ...operations._skus_operations import build_list_request
T = TypeVar('T')
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class SkusOperations:
"""
.. warning::
@ -42,38 +57,36 @@ class SkusOperations:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list(
self,
**kwargs: Any
) -> AsyncIterable[_models.StorageSkuListResult]:
def list(self, **kwargs: Any) -> AsyncIterable["_models.Sku"]:
"""Lists the available SKUs supported by Microsoft.Storage for given subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either StorageSkuListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.StorageSkuListResult]
:raises: ~azure.core.exceptions.HttpResponseError
:return: An iterator like instance of either Sku or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.Sku]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2017-06-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.StorageSkuListResult]
api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01")) # type: Literal["2017-06-01"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.StorageSkuListResult]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop('error_map', {}) or {})
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
@ -81,13 +94,17 @@ class SkusOperations:
request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
@ -104,10 +121,8 @@ class SkusOperations:
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
@ -117,8 +132,6 @@ class SkusOperations:
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus"} # type: ignore
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus"} # type: ignore

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -6,10 +6,19 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
@ -20,9 +29,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat
from ... import models as _models
from ..._vendor import _convert_request
from ...operations._usage_operations import build_list_request
T = TypeVar('T')
if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
class UsageOperations:
"""
.. warning::
@ -42,37 +57,36 @@ class UsageOperations:
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
@distributed_trace
def list(
self,
**kwargs: Any
) -> AsyncIterable[_models.UsageListResult]:
def list(self, **kwargs: Any) -> AsyncIterable["_models.Usage"]:
"""Gets the current usage count and the limit for the resources under the subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either UsageListResult or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.UsageListResult]
:raises: ~azure.core.exceptions.HttpResponseError
:return: An iterator like instance of either Usage or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.storage.v2017_06_01.models.Usage]
:raises ~azure.core.exceptions.HttpResponseError:
"""
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version = kwargs.pop('api_version', _params.pop('api-version', "2017-06-01")) # type: str
cls = kwargs.pop('cls', None) # type: ClsType[_models.UsageListResult]
api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-06-01")) # type: Literal["2017-06-01"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.UsageListResult]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop('error_map', {}) or {})
error_map.update(kwargs.pop("error_map", {}) or {})
def prepare_request(next_link=None):
if not next_link:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=self.list.metadata['url'],
template_url=self.list.metadata["url"],
headers=_headers,
params=_params,
)
@ -80,13 +94,17 @@ class UsageOperations:
request.url = self._client.format_url(request.url) # type: ignore
else:
request = build_list_request(
subscription_id=self._config.subscription_id,
api_version=api_version,
template_url=next_link,
headers=_headers,
params=_params,
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
@ -103,10 +121,8 @@ class UsageOperations:
async def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access
request,
stream=False,
**kwargs
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
request, stream=False, **kwargs
)
response = pipeline_response.http_response
@ -116,8 +132,6 @@ class UsageOperations:
return pipeline_response
return AsyncItemPaged(get_next, extract_data)
return AsyncItemPaged(
get_next, extract_data
)
list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore
list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"} # type: ignore

Просмотреть файл

@ -44,88 +44,86 @@ from ._models_py3 import UsageListResult
from ._models_py3 import UsageName
from ._models_py3 import VirtualNetworkRule
from ._storage_management_enums import (
AccessTier,
AccountStatus,
Bypass,
DefaultAction,
HttpProtocol,
KeyPermission,
KeySource,
Kind,
Permissions,
ProvisioningState,
Reason,
ReasonCode,
Services,
SignedResource,
SignedResourceTypes,
SkuName,
SkuTier,
State,
UsageUnit,
)
from ._storage_management_enums import AccessTier
from ._storage_management_enums import AccountStatus
from ._storage_management_enums import Bypass
from ._storage_management_enums import DefaultAction
from ._storage_management_enums import HttpProtocol
from ._storage_management_enums import KeyPermission
from ._storage_management_enums import KeySource
from ._storage_management_enums import Kind
from ._storage_management_enums import Permissions
from ._storage_management_enums import ProvisioningState
from ._storage_management_enums import Reason
from ._storage_management_enums import ReasonCode
from ._storage_management_enums import Services
from ._storage_management_enums import SignedResource
from ._storage_management_enums import SignedResourceTypes
from ._storage_management_enums import SkuName
from ._storage_management_enums import SkuTier
from ._storage_management_enums import State
from ._storage_management_enums import UsageUnit
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import patch_sdk as _patch_sdk
__all__ = [
'AccountSasParameters',
'CheckNameAvailabilityResult',
'CustomDomain',
'Dimension',
'Encryption',
'EncryptionService',
'EncryptionServices',
'Endpoints',
'IPRule',
'Identity',
'KeyVaultProperties',
'ListAccountSasResponse',
'ListServiceSasResponse',
'MetricSpecification',
'NetworkRuleSet',
'Operation',
'OperationDisplay',
'OperationListResult',
'Resource',
'Restriction',
'SKUCapability',
'ServiceSasParameters',
'ServiceSpecification',
'Sku',
'StorageAccount',
'StorageAccountCheckNameAvailabilityParameters',
'StorageAccountCreateParameters',
'StorageAccountKey',
'StorageAccountListKeysResult',
'StorageAccountListResult',
'StorageAccountRegenerateKeyParameters',
'StorageAccountUpdateParameters',
'StorageSkuListResult',
'Usage',
'UsageListResult',
'UsageName',
'VirtualNetworkRule',
'AccessTier',
'AccountStatus',
'Bypass',
'DefaultAction',
'HttpProtocol',
'KeyPermission',
'KeySource',
'Kind',
'Permissions',
'ProvisioningState',
'Reason',
'ReasonCode',
'Services',
'SignedResource',
'SignedResourceTypes',
'SkuName',
'SkuTier',
'State',
'UsageUnit',
"AccountSasParameters",
"CheckNameAvailabilityResult",
"CustomDomain",
"Dimension",
"Encryption",
"EncryptionService",
"EncryptionServices",
"Endpoints",
"IPRule",
"Identity",
"KeyVaultProperties",
"ListAccountSasResponse",
"ListServiceSasResponse",
"MetricSpecification",
"NetworkRuleSet",
"Operation",
"OperationDisplay",
"OperationListResult",
"Resource",
"Restriction",
"SKUCapability",
"ServiceSasParameters",
"ServiceSpecification",
"Sku",
"StorageAccount",
"StorageAccountCheckNameAvailabilityParameters",
"StorageAccountCreateParameters",
"StorageAccountKey",
"StorageAccountListKeysResult",
"StorageAccountListResult",
"StorageAccountRegenerateKeyParameters",
"StorageAccountUpdateParameters",
"StorageSkuListResult",
"Usage",
"UsageListResult",
"UsageName",
"VirtualNetworkRule",
"AccessTier",
"AccountStatus",
"Bypass",
"DefaultAction",
"HttpProtocol",
"KeyPermission",
"KeySource",
"Kind",
"Permissions",
"ProvisioningState",
"Reason",
"ReasonCode",
"Services",
"SignedResource",
"SignedResourceTypes",
"SkuName",
"SkuTier",
"State",
"UsageUnit",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
_patch_sdk()

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -10,6 +10,7 @@ from typing import List
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
def patch_sdk():
"""Do not remove from this file.

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше