diff --git a/.docsettings.yml b/.docsettings.yml index 5cf58fbf5a30..da3d63534ca8 100644 --- a/.docsettings.yml +++ b/.docsettings.yml @@ -48,6 +48,9 @@ known_content_issues: - ['sdk/loganalytics/azure-loganalytics/README.rst', '#4554'] - ['sdk/servicefabric/azure-servicefabric/README.rst', '#4554'] - ['sdk/core/azure-servicemanagement-legacy/README.rst', '#4554'] + - ['sdk/storage/azure-storage-file/swagger/README.md', '#4554'] + - ['sdk/storage/azure-storage-queue/swagger/README.md', '#4554'] + - ['sdk/storage/azure-storage-blob/swagger/README.md', '#4554'] # nspckg and common. - ['sdk/cognitiveservices/azure-cognitiveservices-nspkg/README.rst', 'nspkg and common'] diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/__init__.py index 575c68f7bfeb..f5c8f4a954df 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/__init__.py @@ -8,11 +8,9 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -from ._configuration import AzureBlobStorageConfiguration from ._azure_blob_storage import AzureBlobStorage -__all__ = ['AzureBlobStorage', 'AzureBlobStorageConfiguration'] +__all__ = ['AzureBlobStorage'] from .version import VERSION diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py index 33950da5cc96..957dda1ec750 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_azure_blob_storage.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core import PipelineClient from msrest import Serializer, Deserializer @@ -17,6 +16,7 @@ from azure.core.exceptions import map_error from .operations import ServiceOperations from .operations import ContainerOperations +from .operations import DirectoryOperations from .operations import BlobOperations from .operations import PageBlobOperations from .operations import AppendBlobOperations @@ -29,31 +29,33 @@ class AzureBlobStorage(object): :ivar service: Service operations - :vartype service: blob.operations.ServiceOperations + :vartype service: azure.storage.blob.operations.ServiceOperations :ivar container: Container operations - :vartype container: blob.operations.ContainerOperations + :vartype container: azure.storage.blob.operations.ContainerOperations + :ivar directory: Directory operations + :vartype directory: azure.storage.blob.operations.DirectoryOperations :ivar blob: Blob operations - :vartype blob: blob.operations.BlobOperations + :vartype blob: azure.storage.blob.operations.BlobOperations :ivar page_blob: PageBlob operations - :vartype page_blob: blob.operations.PageBlobOperations + :vartype page_blob: azure.storage.blob.operations.PageBlobOperations :ivar append_blob: AppendBlob operations - :vartype append_blob: blob.operations.AppendBlobOperations + :vartype append_blob: azure.storage.blob.operations.AppendBlobOperations :ivar block_blob: BlockBlob operations - :vartype block_blob: blob.operations.BlockBlobOperations + :vartype block_blob: azure.storage.blob.operations.BlockBlobOperations :param url: The URL of the service account, container, or blob that is the targe of the desired operation. :type url: str """ - def __init__(self, url, config=None, **kwargs): + def __init__(self, url, **kwargs): base_url = '{url}' - self._config = config or AzureBlobStorageConfiguration(url, **kwargs) + self._config = AzureBlobStorageConfiguration(url, **kwargs) self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-03-28' + self.api_version = '2019-02-02' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -61,6 +63,8 @@ def __init__(self, url, config=None, **kwargs): self._client, self._config, self._serialize, self._deserialize) self.container = ContainerOperations( self._client, self._config, self._serialize, self._deserialize) + self.directory = DirectoryOperations( + self._client, self._config, self._serialize, self._deserialize) self.blob = BlobOperations( self._client, self._config, self._serialize, self._deserialize) self.page_blob = PageBlobOperations( diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py index 7e5e64dde51c..54cb99064747 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py @@ -8,9 +8,8 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -from azure.core.configuration import Configuration, ConnectionConfiguration +from azure.core.configuration import Configuration from azure.core.pipeline import policies from .version import VERSION @@ -37,18 +36,17 @@ def __init__(self, url, **kwargs): super(AzureBlobStorageConfiguration, self).__init__(**kwargs) self._configure(**kwargs) - self.user_agent_policy.add_user_agent('azureblobstorage/{}'.format(VERSION)) + self.user_agent_policy.add_user_agent('azsdk-python-azureblobstorage/{}'.format(VERSION)) self.generate_client_request_id = True - self.accept_language = None self.url = url - self.version = "2018-03-28" + self.version = "2019-02-02" def _configure(self, **kwargs): - self.connection = ConnectionConfiguration(**kwargs) - self.user_agent_policy = policies.UserAgentPolicy(**kwargs) - self.headers_policy = policies.HeadersPolicy(**kwargs) - self.proxy_policy = policies.ProxyPolicy(**kwargs) - self.logging_policy = policies.NetworkTraceLoggingPolicy(**kwargs) - self.retry_policy = policies.RetryPolicy(**kwargs) - self.redirect_policy = policies.RedirectPolicy(**kwargs) + 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.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) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/__init__.py index 5d4f9c0da7f4..009c96594356 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/__init__.py @@ -8,8 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from ._azure_blob_storage_async import AzureBlobStorage -from ._configuration_async import AzureBlobStorageConfiguration -__all__ = ['AzureBlobStorage', 'AzureBlobStorageConfiguration'] +__all__ = ['AzureBlobStorage'] diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage_async.py index 9dad8c3a2598..a1ad1db44225 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_azure_blob_storage_async.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core import AsyncPipelineClient from msrest import Serializer, Deserializer @@ -17,6 +16,7 @@ from azure.core.exceptions import map_error from .operations_async import ServiceOperations from .operations_async import ContainerOperations +from .operations_async import DirectoryOperations from .operations_async import BlobOperations from .operations_async import PageBlobOperations from .operations_async import AppendBlobOperations @@ -29,17 +29,19 @@ class AzureBlobStorage(object): :ivar service: Service operations - :vartype service: blob.aio.operations_async.ServiceOperations + :vartype service: azure.storage.blob.aio.operations_async.ServiceOperations :ivar container: Container operations - :vartype container: blob.aio.operations_async.ContainerOperations + :vartype container: azure.storage.blob.aio.operations_async.ContainerOperations + :ivar directory: Directory operations + :vartype directory: azure.storage.blob.aio.operations_async.DirectoryOperations :ivar blob: Blob operations - :vartype blob: blob.aio.operations_async.BlobOperations + :vartype blob: azure.storage.blob.aio.operations_async.BlobOperations :ivar page_blob: PageBlob operations - :vartype page_blob: blob.aio.operations_async.PageBlobOperations + :vartype page_blob: azure.storage.blob.aio.operations_async.PageBlobOperations :ivar append_blob: AppendBlob operations - :vartype append_blob: blob.aio.operations_async.AppendBlobOperations + :vartype append_blob: azure.storage.blob.aio.operations_async.AppendBlobOperations :ivar block_blob: BlockBlob operations - :vartype block_blob: blob.aio.operations_async.BlockBlobOperations + :vartype block_blob: azure.storage.blob.aio.operations_async.BlockBlobOperations :param url: The URL of the service account, container, or blob that is the targe of the desired operation. @@ -47,14 +49,14 @@ class AzureBlobStorage(object): """ def __init__( - self, url, config=None, **kwargs): + self, url, **kwargs): base_url = '{url}' - self._config = config or AzureBlobStorageConfiguration(url, **kwargs) + self._config = AzureBlobStorageConfiguration(url, **kwargs) self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-03-28' + self.api_version = '2019-02-02' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -62,6 +64,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.container = ContainerOperations( self._client, self._config, self._serialize, self._deserialize) + self.directory = DirectoryOperations( + self._client, self._config, self._serialize, self._deserialize) self.blob = BlobOperations( self._client, self._config, self._serialize, self._deserialize) self.page_blob = PageBlobOperations( diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration_async.py index a02df908a779..8f9f8b4a397e 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/_configuration_async.py @@ -8,9 +8,8 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -from azure.core.configuration import Configuration, ConnectionConfiguration +from azure.core.configuration import Configuration from azure.core.pipeline import policies from ..version import VERSION @@ -37,18 +36,18 @@ def __init__(self, url, **kwargs): super(AzureBlobStorageConfiguration, self).__init__(**kwargs) self._configure(**kwargs) - self.user_agent_policy.add_user_agent('azureblobstorage/{}'.format(VERSION)) + self.user_agent_policy.add_user_agent('azsdk-python-azureblobstorage/{}'.format(VERSION)) self.generate_client_request_id = True self.accept_language = None self.url = url - self.version = "2018-03-28" + self.version = "2019-02-02" def _configure(self, **kwargs): - self.connection = ConnectionConfiguration(**kwargs) - self.user_agent_policy = policies.UserAgentPolicy(**kwargs) - self.headers_policy = policies.HeadersPolicy(**kwargs) - self.proxy_policy = policies.ProxyPolicy(**kwargs) - self.logging_policy = policies.NetworkTraceLoggingPolicy(**kwargs) - self.retry_policy = policies.AsyncRetryPolicy(**kwargs) - self.redirect_policy = policies.AsyncRedirectPolicy(**kwargs) + 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.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) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/__init__.py index cd53ea194e0b..dec05192c81f 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/__init__.py @@ -8,10 +8,10 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from ._service_operations_async import ServiceOperations from ._container_operations_async import ContainerOperations +from ._directory_operations_async import DirectoryOperations from ._blob_operations_async import BlobOperations from ._page_blob_operations_async import PageBlobOperations from ._append_blob_operations_async import AppendBlobOperations @@ -20,6 +20,7 @@ __all__ = [ 'ServiceOperations', 'ContainerOperations', + 'DirectoryOperations', 'BlobOperations', 'PageBlobOperations', 'AppendBlobOperations', diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_append_blob_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_append_blob_operations_async.py index f58b121794d8..7532c9a6b862 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_append_blob_operations_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_append_blob_operations_async.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -40,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self.x_ms_blob_type = "AppendBlob" self.comp = "appendblock" - async def create(self, content_length, timeout=None, metadata=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def create(self, content_length, timeout=None, metadata=None, tags=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Create Append Blob operation creates a new append blob. :param content_length: The length of the request. @@ -60,25 +59,50 @@ async def create(self, content_length, timeout=None, metadata=None, request_id=N C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_content_type = None @@ -102,6 +126,9 @@ async def create(self, content_length, timeout=None, metadata=None, request_id=N lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -126,12 +153,22 @@ async def create(self, content_length, timeout=None, metadata=None, request_id=N query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -173,16 +210,20 @@ async def create(self, content_length, timeout=None, metadata=None, request_id=N 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) create.metadata = {'url': '/{containerName}/{blob}'} - async def append_block(self, body, content_length, timeout=None, transactional_content_md5=None, request_id=None, lease_access_conditions=None, append_position_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def append_block(self, body, content_length, timeout=None, transactional_content_md5=None, transactional_content_crc64=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, append_position_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append @@ -200,27 +241,50 @@ async def append_block(self, body, content_length, timeout=None, transactional_c :param transactional_content_md5: Specify the transactional md5 for the body, to be validated by the service. :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param append_position_access_conditions: Additional parameters for the operation :type append_position_access_conditions: - ~blob.models.AppendPositionAccessConditions + ~azure.storage.blob.models.AppendPositionAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -232,6 +296,9 @@ async def append_block(self, body, content_length, timeout=None, transactional_c append_position = None if append_position_access_conditions is not None: append_position = append_position_access_conditions.append_position + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -256,14 +323,24 @@ async def append_block(self, body, content_length, timeout=None, transactional_c query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("self.comp", self.comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/octet-stream' + header_parameters['Content-Type'] = 'application/xml; charset=utf-8' header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if transactional_content_md5 is not None: header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -298,12 +375,182 @@ async def append_block(self, body, content_length, timeout=None, transactional_c 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-blob-append-offset': self._deserialize('str', response.headers.get('x-ms-blob-append-offset')), 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), + 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) append_block.metadata = {'url': '/{containerName}/{blob}'} + + async def append_block_from_url(self, source_url, content_length, source_range=None, source_content_md5=None, source_contentcrc64=None, timeout=None, transactional_content_md5=None, request_id=None, lease_access_conditions=None, append_position_access_conditions=None, modified_access_conditions=None, source_modified_access_conditions=None, *, cls=None, **kwargs): + """The Append Block operation commits a new block of data to the end of an + existing append blob where the contents are read from a source url. The + Append Block operation is permitted only if the blob was created with + x-ms-blob-type set to AppendBlob. Append Block is supported only on + version 2015-02-21 version or later. + + :param source_url: Specify a URL to the copy source. + :type source_url: str + :param content_length: The length of the request. + :type content_length: long + :param source_range: Bytes of source data in the specified range. + :type source_range: str + :param source_content_md5: Specify the md5 calculated for the range of + bytes that must be read from the copy source. + :type source_content_md5: bytearray + :param source_contentcrc64: Specify the crc64 calculated for the range + of bytes that must be read from the copy source. + :type source_contentcrc64: bytearray + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param transactional_content_md5: Specify the transactional md5 for + the body, to be validated by the service. + :type transactional_content_md5: bytearray + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param append_position_access_conditions: Additional parameters for + the operation + :type append_position_access_conditions: + ~azure.storage.blob.models.AppendPositionAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + max_size = None + if append_position_access_conditions is not None: + max_size = append_position_access_conditions.max_size + append_position = None + if append_position_access_conditions is not None: + append_position = append_position_access_conditions.append_position + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + + # Construct URL + url = self.append_block_from_url.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['comp'] = self._serialize.query("self.comp", self.comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-copy-source'] = self._serialize.header("source_url", source_url, 'str') + if source_range is not None: + header_parameters['x-ms-source-range'] = self._serialize.header("source_range", source_range, 'str') + if source_content_md5 is not None: + header_parameters['x-ms-source-content-md5'] = self._serialize.header("source_content_md5", source_content_md5, 'bytearray') + if source_contentcrc64 is not None: + header_parameters['x-ms-source-content-crc64'] = self._serialize.header("source_contentcrc64", source_contentcrc64, 'bytearray') + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + if transactional_content_md5 is not None: + header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if max_size is not None: + header_parameters['x-ms-blob-condition-maxsize'] = self._serialize.header("max_size", max_size, 'long') + if append_position is not None: + header_parameters['x-ms-blob-condition-appendpos'] = self._serialize.header("append_position", append_position, 'long') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-blob-append-offset': self._deserialize('str', response.headers.get('x-ms-blob-append-offset')), + 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + append_block_from_url.metadata = {'url': '/{containerName}/{blob}'} diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_blob_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_blob_operations_async.py index ee2e6c3dfe05..a32f76753eff 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_blob_operations_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_blob_operations_async.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -24,6 +23,7 @@ class BlobOperations: :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar x_ms_requires_sync: . Constant value: "true". :ivar x_ms_copy_action: . Constant value: "abort". :ivar restype: . Constant value: "account". """ @@ -37,13 +37,14 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + self.x_ms_requires_sync = "true" self.x_ms_copy_action = "abort" self.restype = "account" - async def download(self, snapshot=None, timeout=None, range=None, range_get_content_md5=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def download(self, snapshot=None, version_id=None, timeout=None, range=None, range_get_content_md5=None, range_get_content_crc64=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to - read a snapshot. + read a snapshot or verison. :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more @@ -51,6 +52,9 @@ async def download(self, snapshot=None, timeout=None, range=None, range_get_cont href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -63,23 +67,43 @@ async def download(self, snapshot=None, timeout=None, range=None, range_get_cont with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. :type range_get_content_md5: bool + :param range_get_content_crc64: When set to true and specified + together with the Range, the service returns the CRC64 hash for the + range, as long as the range is less than or equal to 4 MB in size. + :type range_get_content_crc64: bool + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: object or the result of cls(response) :rtype: Generator :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -109,16 +133,26 @@ async def download(self, snapshot=None, timeout=None, range=None, range_get_cont query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' if range is not None: header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') if range_get_content_md5 is not None: header_parameters['x-ms-range-get-content-md5'] = self._serialize.header("range_get_content_md5", range_get_content_md5, 'bool') + if range_get_content_crc64 is not None: + header_parameters['x-ms-range-get-content-crc64'] = self._serialize.header("range_get_content_crc64", range_get_content_crc64, 'bool') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -170,13 +204,18 @@ async def download(self, snapshot=None, timeout=None, range=None, range_get_cont 'x-ms-lease-duration': self._deserialize(models.LeaseDurationType, response.headers.get('x-ms-lease-duration')), 'x-ms-lease-state': self._deserialize(models.LeaseStateType, response.headers.get('x-ms-lease-state')), 'x-ms-lease-status': self._deserialize(models.LeaseStatusType, response.headers.get('x-ms-lease-status')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-blob-content-md5': self._deserialize('bytearray', response.headers.get('x-ms-blob-content-md5')), + 'x-ms-tag-count': self._deserialize('int', response.headers.get('x-ms-tag-count')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } if response.status_code == 206: @@ -204,13 +243,18 @@ async def download(self, snapshot=None, timeout=None, range=None, range_get_cont 'x-ms-lease-duration': self._deserialize(models.LeaseDurationType, response.headers.get('x-ms-lease-duration')), 'x-ms-lease-state': self._deserialize(models.LeaseStateType, response.headers.get('x-ms-lease-state')), 'x-ms-lease-status': self._deserialize(models.LeaseStatusType, response.headers.get('x-ms-lease-status')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-blob-content-md5': self._deserialize('bytearray', response.headers.get('x-ms-blob-content-md5')), + 'x-ms-tag-count': self._deserialize('int', response.headers.get('x-ms-tag-count')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } @@ -220,41 +264,58 @@ async def download(self, snapshot=None, timeout=None, range=None, range_get_cont return deserialized download.metadata = {'url': '/{containerName}/{blob}'} - async def get_properties(self, comp=None, snapshot=None, timeout=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def get_properties(self, snapshot=None, version_id=None, timeout=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob. - :param comp: Possible values include: 'metadata' - :type comp: str :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -282,12 +343,18 @@ async def get_properties(self, comp=None, snapshot=None, timeout=None, request_i # Construct parameters query_parameters = {} - if comp is not None: - query_parameters['comp'] = self._serialize.query("comp", comp, 'str') if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') # Construct headers header_parameters = {} @@ -340,22 +407,26 @@ async def get_properties(self, comp=None, snapshot=None, timeout=None, request_i 'Content-Language': self._deserialize('str', response.headers.get('Content-Language')), 'Cache-Control': self._deserialize('str', response.headers.get('Cache-Control')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-access-tier': self._deserialize('str', response.headers.get('x-ms-access-tier')), 'x-ms-access-tier-inferred': self._deserialize('bool', response.headers.get('x-ms-access-tier-inferred')), 'x-ms-archive-status': self._deserialize('str', response.headers.get('x-ms-archive-status')), 'x-ms-access-tier-change-time': self._deserialize('rfc-1123', response.headers.get('x-ms-access-tier-change-time')), + 'x-ms-tag-count': self._deserialize('int', response.headers.get('x-ms-tag-count')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) get_properties.metadata = {'url': '/{containerName}/{blob}'} - async def delete(self, snapshot=None, timeout=None, delete_snapshots=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def delete(self, snapshot=None, version_id=None, timeout=None, delete_snapshots=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): """If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from the storage account. If the storage account's soft delete feature is enabled, then, when a blob @@ -370,7 +441,15 @@ async def delete(self, snapshot=None, timeout=None, delete_snapshots=None, reque parameter to discover which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the - service to return an HTTP status code of 404 (ResourceNotFound). + service to return an HTTP status code of 404 (ResourceNotFound). If the + storage account's automatic snapshot feature is enabled, then, when a + blob is deleted, an automatic snapshot is created. The blob becomes + inaccessible immediately. All other operations on the blob causes the + service to return an HTTP status code of 404 (ResourceNotFound). You + can access automatic snapshot using snapshot timestamp or version id. + You can restore the blob by calling Put or Copy Blob API with automatic + snapshot as source. Deleting automatic snapshot requires shared key or + special SAS/RBAC permissions. :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more @@ -378,6 +457,9 @@ async def delete(self, snapshot=None, timeout=None, delete_snapshots=None, reque href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -388,24 +470,26 @@ async def delete(self, snapshot=None, timeout=None, delete_snapshots=None, reque the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob itself. Possible values include: 'include', 'only' - :type delete_snapshots: str or ~blob.models.DeleteSnapshotsOptionType + :type delete_snapshots: str or + ~azure.storage.blob.models.DeleteSnapshotsOptionType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -435,6 +519,8 @@ async def delete(self, snapshot=None, timeout=None, delete_snapshots=None, reque query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) @@ -467,6 +553,7 @@ async def delete(self, snapshot=None, timeout=None, delete_snapshots=None, reque if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -475,6 +562,204 @@ async def delete(self, snapshot=None, timeout=None, delete_snapshots=None, reque return cls(response, None, response_headers) delete.metadata = {'url': '/{containerName}/{blob}'} + async def rename(self, rename_source, timeout=None, path_rename_mode=None, directory_properties=None, posix_permissions=None, posix_umask=None, source_lease_id=None, request_id=None, directory_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, source_modified_access_conditions=None, *, cls=None, **kwargs): + """Rename a blob/file. By default, the destination is overwritten and if + the destination already exists and has a lease the lease is broken. + This operation supports conditional HTTP requests. For more + information, see [Specifying Conditional Headers for Blob Service + Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). + To fail if the destination already exists, use a conditional request + with If-None-Match: "*". + + :param rename_source: The file or directory to be renamed. The value + must have the following format: "/{filesysystem}/{path}". If + "x-ms-properties" is specified, the properties will overwrite the + existing properties; otherwise, the existing properties will be + preserved. + :type rename_source: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param path_rename_mode: Determines the behavior of the rename + operation. Possible values include: 'legacy', 'posix' + :type path_rename_mode: str or + ~azure.storage.blob.models.PathRenameMode + :param directory_properties: Optional. User-defined properties to be + stored with the file or directory, in the format of a comma-separated + list of name and value pairs "n1=v1, n2=v2, ...", where each value is + base64 encoded. + :type directory_properties: str + :param posix_permissions: Optional and only valid if Hierarchical + Namespace is enabled for the account. Sets POSIX access permissions + for the file owner, the file owning group, and others. Each class may + be granted read, write, or execute permission. The sticky bit is also + supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. + 0766) are supported. + :type posix_permissions: str + :param posix_umask: Only valid if Hierarchical Namespace is enabled + for the account. This umask restricts permission settings for file and + directory, and will only be applied when default Acl does not exist in + parent directory. If the umask bit has set, it means that the + corresponding permission will be disabled. Otherwise the corresponding + permission will be determined by the permission. A 4-digit octal + notation (e.g. 0022) is supported here. If no umask was specified, a + default umask - 0027 will be used. + :type posix_umask: str + :param source_lease_id: A lease ID for the source path. If specified, + the source path must have an active lease and the leaase ID must + match. + :type source_lease_id: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param directory_http_headers: Additional parameters for the operation + :type directory_http_headers: + ~azure.storage.blob.models.DirectoryHttpHeaders + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`DataLakeStorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + cache_control = None + if directory_http_headers is not None: + cache_control = directory_http_headers.cache_control + content_type = None + if directory_http_headers is not None: + content_type = directory_http_headers.content_type + content_encoding = None + if directory_http_headers is not None: + content_encoding = directory_http_headers.content_encoding + content_language = None + if directory_http_headers is not None: + content_language = directory_http_headers.content_language + content_disposition = None + if directory_http_headers is not None: + content_disposition = directory_http_headers.content_disposition + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + + # Construct URL + url = self.rename.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if path_rename_mode is not None: + query_parameters['mode'] = self._serialize.query("path_rename_mode", path_rename_mode, 'PathRenameMode') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-rename-source'] = self._serialize.header("rename_source", rename_source, 'str') + if directory_properties is not None: + header_parameters['x-ms-properties'] = self._serialize.header("directory_properties", directory_properties, 'str') + if posix_permissions is not None: + header_parameters['x-ms-permissions'] = self._serialize.header("posix_permissions", posix_permissions, 'str') + if posix_umask is not None: + header_parameters['x-ms-umask'] = self._serialize.header("posix_umask", posix_umask, 'str') + if source_lease_id is not None: + header_parameters['x-ms-source-lease-id'] = self._serialize.header("source_lease_id", source_lease_id, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if cache_control is not None: + header_parameters['x-ms-cache-control'] = self._serialize.header("cache_control", cache_control, 'str') + if content_type is not None: + header_parameters['x-ms-content-type'] = self._serialize.header("content_type", content_type, 'str') + if content_encoding is not None: + header_parameters['x-ms-content-encoding'] = self._serialize.header("content_encoding", content_encoding, 'str') + if content_language is not None: + header_parameters['x-ms-content-language'] = self._serialize.header("content_language", content_language, 'str') + if content_disposition is not None: + header_parameters['x-ms-content-disposition'] = self._serialize.header("content_disposition", content_disposition, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.DataLakeStorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Content-Length': self._deserialize('long', response.headers.get('Content-Length')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + } + return cls(response, None, response_headers) + rename.metadata = {'url': '/{filesystem}/{path}'} + async def undelete(self, timeout=None, request_id=None, *, cls=None, **kwargs): """Undelete a blob that was previously soft deleted. @@ -492,7 +777,7 @@ async def undelete(self, timeout=None, request_id=None, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "undelete" @@ -527,6 +812,7 @@ async def undelete(self, timeout=None, request_id=None, *, cls=None, **kwargs): if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -548,20 +834,21 @@ async def set_http_headers(self, timeout=None, request_id=None, blob_http_header analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_cache_control = None @@ -655,6 +942,7 @@ async def set_http_headers(self, timeout=None, request_id=None, blob_http_header 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -663,7 +951,7 @@ async def set_http_headers(self, timeout=None, request_id=None, blob_http_header return cls(response, None, response_headers) set_http_headers.metadata = {'url': '/{containerName}/{blob}'} - async def set_metadata(self, timeout=None, metadata=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def set_metadata(self, timeout=None, metadata=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value pairs. @@ -682,28 +970,51 @@ async def set_metadata(self, timeout=None, metadata=None, request_id=None, lease C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -730,7 +1041,15 @@ async def set_metadata(self, timeout=None, metadata=None, request_id=None, lease query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -763,10 +1082,13 @@ async def set_metadata(self, timeout=None, metadata=None, request_id=None, lease response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -798,13 +1120,13 @@ async def acquire_lease(self, timeout=None, duration=None, proposed_lease_id=Non :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -869,6 +1191,7 @@ async def acquire_lease(self, timeout=None, duration=None, proposed_lease_id=Non 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -895,13 +1218,13 @@ async def release_lease(self, lease_id, timeout=None, request_id=None, modified_ :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -962,6 +1285,7 @@ async def release_lease(self, lease_id, timeout=None, request_id=None, modified_ response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -988,13 +1312,13 @@ async def renew_lease(self, lease_id, timeout=None, request_id=None, modified_ac :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1056,6 +1380,7 @@ async def renew_lease(self, lease_id, timeout=None, request_id=None, modified_ac 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1087,13 +1412,13 @@ async def change_lease(self, lease_id, proposed_lease_id, timeout=None, request_ :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1155,6 +1480,7 @@ async def change_lease(self, lease_id, proposed_lease_id, timeout=None, request_ response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), @@ -1190,13 +1516,13 @@ async def break_lease(self, timeout=None, break_period=None, request_id=None, mo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1259,6 +1585,7 @@ async def break_lease(self, timeout=None, break_period=None, request_id=None, mo 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-time': self._deserialize('int', response.headers.get('x-ms-lease-time')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1267,7 +1594,7 @@ async def break_lease(self, timeout=None, break_period=None, request_id=None, mo return cls(response, None, response_headers) break_lease.metadata = {'url': '/{containerName}/{blob}'} - async def create_snapshot(self, timeout=None, metadata=None, request_id=None, modified_access_conditions=None, lease_access_conditions=None, *, cls=None, **kwargs): + async def create_snapshot(self, timeout=None, metadata=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, customer_provided_key_info=None, modified_access_conditions=None, lease_access_conditions=None, *, cls=None, **kwargs): """The Create Snapshot operation creates a read-only snapshot of a blob. :param timeout: The timeout parameter is expressed in seconds. For @@ -1285,25 +1612,48 @@ async def create_snapshot(self, timeout=None, metadata=None, request_id=None, mo C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -1333,7 +1683,15 @@ async def create_snapshot(self, timeout=None, metadata=None, request_id=None, mo query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -1367,15 +1725,20 @@ async def create_snapshot(self, timeout=None, metadata=None, request_id=None, mo 'x-ms-snapshot': self._deserialize('str', response.headers.get('x-ms-snapshot')), 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) create_snapshot.metadata = {'url': '/{containerName}/{blob}'} - async def start_copy_from_url(self, copy_source, timeout=None, metadata=None, request_id=None, source_modified_access_conditions=None, modified_access_conditions=None, lease_access_conditions=None, *, cls=None, **kwargs): + async def start_copy_from_url(self, copy_source, timeout=None, metadata=None, tags=None, tier=None, rehydrate_priority=None, request_id=None, source_modified_access_conditions=None, modified_access_conditions=None, lease_access_conditions=None, *, cls=None, **kwargs): """The Start Copy From URL operation copies a blob or an internet resource to a new blob. @@ -1400,6 +1763,19 @@ async def start_copy_from_url(self, copy_source, timeout=None, metadata=None, re C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional + :param rehydrate_priority: Optional: Indicates the priority with which + to rehydrate an archived blob. Possible values include: 'High', + 'Standard' + :type rehydrate_priority: str or + ~azure.storage.blob.models.RehydratePriority :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. @@ -1407,20 +1783,21 @@ async def start_copy_from_url(self, copy_source, timeout=None, metadata=None, re :param source_modified_access_conditions: Additional parameters for the operation :type source_modified_access_conditions: - ~blob.models.SourceModifiedAccessConditions + ~azure.storage.blob.models.SourceModifiedAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) source_if_modified_since = None @@ -1467,6 +1844,12 @@ async def start_copy_from_url(self, copy_source, timeout=None, metadata=None, re header_parameters = {} if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') + if rehydrate_priority is not None: + header_parameters['x-ms-rehydrate-priority'] = self._serialize.header("rehydrate_priority", rehydrate_priority, 'str') header_parameters['x-ms-copy-source'] = self._serialize.header("copy_source", copy_source, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: @@ -1503,8 +1886,10 @@ async def start_copy_from_url(self, copy_source, timeout=None, metadata=None, re response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-copy-id': self._deserialize('str', response.headers.get('x-ms-copy-id')), 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), @@ -1513,6 +1898,160 @@ async def start_copy_from_url(self, copy_source, timeout=None, metadata=None, re return cls(response, None, response_headers) start_copy_from_url.metadata = {'url': '/{containerName}/{blob}'} + async def copy_from_url(self, copy_source, timeout=None, metadata=None, tags=None, tier=None, request_id=None, source_modified_access_conditions=None, modified_access_conditions=None, lease_access_conditions=None, *, cls=None, **kwargs): + """The Copy From URL operation copies a blob or an internet resource to a + new blob. It will not return a response until the copy is complete. + + :param copy_source: Specifies the name of the source page blob + snapshot. This value is a URL of up to 2 KB in length that specifies a + page blob snapshot. The value should be URL-encoded as it would appear + in a request URI. The source blob must either be public or must be + authenticated via a shared access signature. + :type copy_source: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param metadata: Optional. Specifies a user-defined name-value pair + associated with the blob. If no name-value pairs are specified, the + operation will copy the metadata from the source blob or file to the + destination blob. If one or more name-value pairs are specified, the + destination blob is created with the specified metadata, and metadata + is not copied from the source blob or file. Note that beginning with + version 2009-09-19, metadata names must adhere to the naming rules for + C# identifiers. See Naming and Referencing Containers, Blobs, and + Metadata for more information. + :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + + # Construct URL + url = self.copy_from_url.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + + # Construct headers + header_parameters = {} + if metadata is not None: + header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') + header_parameters['x-ms-copy-source'] = self._serialize.header("copy_source", copy_source, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + header_parameters['x-ms-requires-sync'] = self._serialize.header("self.x_ms_requires_sync", self.x_ms_requires_sync, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-copy-id': self._deserialize('str', response.headers.get('x-ms-copy-id')), + 'x-ms-copy-status': self._deserialize(models.SyncCopyStatusType, response.headers.get('x-ms-copy-status')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + copy_from_url.metadata = {'url': '/{containerName}/{blob}'} + async def abort_copy_from_url(self, copy_id, timeout=None, request_id=None, lease_access_conditions=None, *, cls=None, **kwargs): """The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with zero length and full @@ -1532,13 +2071,14 @@ async def abort_copy_from_url(self, copy_id, timeout=None, request_id=None, leas :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -1581,6 +2121,7 @@ async def abort_copy_from_url(self, copy_id, timeout=None, request_id=None, leas if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1589,7 +2130,7 @@ async def abort_copy_from_url(self, copy_id, timeout=None, request_id=None, leas return cls(response, None, response_headers) abort_copy_from_url.metadata = {'url': '/{containerName}/{blob}'} - async def set_tier(self, tier, timeout=None, request_id=None, lease_access_conditions=None, *, cls=None, **kwargs): + async def set_tier(self, tier, timeout=None, rehydrate_priority=None, request_id=None, lease_access_conditions=None, *, cls=None, **kwargs): """The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage account (locally redundant storage only). A premium @@ -1600,25 +2141,31 @@ async def set_tier(self, tier, timeout=None, request_id=None, lease_access_condi :param tier: Indicates the tier to be set on the blob. Possible values include: 'P4', 'P6', 'P10', 'P20', 'P30', 'P40', 'P50', 'Hot', 'Cool', 'Archive' - :type tier: str or ~blob.models.AccessTier + :type tier: str or ~azure.storage.blob.models.AccessTierRequired :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param rehydrate_priority: Optional: Indicates the priority with which + to rehydrate an archived blob. Possible values include: 'High', + 'Standard' + :type rehydrate_priority: str or + ~azure.storage.blob.models.RehydratePriority :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -1643,6 +2190,8 @@ async def set_tier(self, tier, timeout=None, request_id=None, lease_access_condi # Construct headers header_parameters = {} header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') + if rehydrate_priority is not None: + header_parameters['x-ms-rehydrate-priority'] = self._serialize.header("rehydrate_priority", rehydrate_priority, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -1660,6 +2209,7 @@ async def set_tier(self, tier, timeout=None, request_id=None, lease_access_condi if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -1675,7 +2225,7 @@ async def get_account_info(self, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -1707,6 +2257,7 @@ async def get_account_info(self, *, cls=None, **kwargs): if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1715,4 +2266,172 @@ async def get_account_info(self, *, cls=None, **kwargs): 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) - get_account_info.metadata = {'url': '/{containerName}/{blobName}'} + get_account_info.metadata = {'url': '/{containerName}/{blob}'} + + async def set_tags(self, tags, content_length, timeout=None, transactional_content_md5=None, transactional_content_crc64=None, request_id=None, *, cls=None, **kwargs): + """The Set Blob Tags operation sets tags for the specified blob. This API + is only supported in version 2018-11-09 and later. + + :param tags: + :type tags: ~azure.storage.blob.models.BlobTags + :param content_length: The length of the request. + :type content_length: long + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param transactional_content_md5: Specify the transactional md5 for + the body, to be validated by the service. + :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + comp = "tags" + + # Construct URL + url = self.set_tags.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/xml; charset=utf-8' + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + if transactional_content_md5 is not None: + header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + + # Construct body + body_content = self._serialize.body(tags, 'BlobTags') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + set_tags.metadata = {'url': '/{containerName}/{blob}'} + + async def get_tags(self, content_length, timeout=None, snapshot=None, version_id=None, request_id=None, *, cls=None, **kwargs): + """The Get Blob Tags operation returns all tags for the specified blob, + snapshot, or version. This API is only supported in version 2018-11-09 + and later. + + :param content_length: The length of the request. + :type content_length: long + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param snapshot: The snapshot parameter is an opaque DateTime value + that, when present, specifies the blob snapshot to retrieve. For more + information on working with blob snapshots, see Creating + a Snapshot of a Blob. + :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param callable cls: A custom type or function that will be passed the + direct response + :return: BlobTags or the result of cls(response) + :rtype: ~azure.storage.blob.models.BlobTags + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + comp = "tags" + + # Construct URL + url = self.get_tags.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if snapshot is not None: + query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BlobTags', response) + header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + + if cls: + return cls(response, deserialized, header_dict) + + return deserialized + get_tags.metadata = {'url': '/{containerName}/{blob}'} diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_block_blob_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_block_blob_operations_async.py index 1b88b9cfdfc3..08a6169e71f5 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_block_blob_operations_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_block_blob_operations_async.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -38,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config self.x_ms_blob_type = "BlockBlob" - async def upload(self, body, content_length, timeout=None, metadata=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def upload(self, body, content_length, timeout=None, metadata=None, tags=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, tier=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; @@ -65,25 +64,53 @@ async def upload(self, body, content_length, timeout=None, metadata=None, reques C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_content_type = None @@ -107,6 +134,9 @@ async def upload(self, body, content_length, timeout=None, metadata=None, reques lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -131,6 +161,14 @@ async def upload(self, body, content_length, timeout=None, metadata=None, reques query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -138,6 +176,10 @@ async def upload(self, body, content_length, timeout=None, metadata=None, reques header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -181,16 +223,20 @@ async def upload(self, body, content_length, timeout=None, metadata=None, reques 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) upload.metadata = {'url': '/{containerName}/{blob}'} - async def stage_block(self, block_id, content_length, body, transactional_content_md5=None, timeout=None, request_id=None, lease_access_conditions=None, *, cls=None, **kwargs): + async def stage_block(self, block_id, content_length, body, transactional_content_md5=None, transactional_content_crc64=None, timeout=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, customer_provided_key_info=None, *, cls=None, **kwargs): """The Stage Block operation creates a new block to be committed as part of a blob. @@ -206,29 +252,55 @@ async def stage_block(self, block_id, content_length, body, transactional_conten :param transactional_content_md5: Specify the transactional md5 for the body, to be validated by the service. :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope comp = "block" @@ -244,7 +316,15 @@ async def stage_block(self, block_id, content_length, body, transactional_conten query_parameters['blockid'] = self._serialize.query("block_id", block_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -252,6 +332,8 @@ async def stage_block(self, block_id, content_length, body, transactional_conten header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if transactional_content_md5 is not None: header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -272,16 +354,20 @@ async def stage_block(self, block_id, content_length, body, transactional_conten if cls: response_headers = { 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) stage_block.metadata = {'url': '/{containerName}/{blob}'} - async def stage_block_from_url(self, block_id, content_length, source_url, source_range=None, source_content_md5=None, timeout=None, request_id=None, lease_access_conditions=None, *, cls=None, **kwargs): + async def stage_block_from_url(self, block_id, content_length, source_url, source_range=None, source_content_md5=None, source_contentcrc64=None, timeout=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, customer_provided_key_info=None, source_modified_access_conditions=None, *, cls=None, **kwargs): """The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL. @@ -299,29 +385,71 @@ async def stage_block_from_url(self, block_id, content_length, source_url, sourc :param source_content_md5: Specify the md5 calculated for the range of bytes that must be read from the copy source. :type source_content_md5: bytearray + :param source_contentcrc64: Specify the crc64 calculated for the range + of bytes that must be read from the copy source. + :type source_contentcrc64: bytearray :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match comp = "block" @@ -337,7 +465,15 @@ async def stage_block_from_url(self, block_id, content_length, source_url, sourc query_parameters['blockid'] = self._serialize.query("block_id", block_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -347,11 +483,21 @@ async def stage_block_from_url(self, block_id, content_length, source_url, sourc header_parameters['x-ms-source-range'] = self._serialize.header("source_range", source_range, 'str') if source_content_md5 is not None: header_parameters['x-ms-source-content-md5'] = self._serialize.header("source_content_md5", source_content_md5, 'bytearray') + if source_contentcrc64 is not None: + header_parameters['x-ms-source-content-crc64'] = self._serialize.header("source_contentcrc64", source_contentcrc64, 'bytearray') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') if lease_id is not None: header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') # Construct and send request request = self._client.put(url, query_parameters, header_parameters) @@ -365,16 +511,20 @@ async def stage_block_from_url(self, block_id, content_length, source_url, sourc if cls: response_headers = { 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) stage_block_from_url.metadata = {'url': '/{containerName}/{blob}'} - async def commit_block_list(self, blocks, timeout=None, metadata=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def commit_block_list(self, blocks, timeout=None, transactional_content_md5=None, transactional_content_crc64=None, metadata=None, tags=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, tier=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a @@ -386,12 +536,18 @@ async def commit_block_list(self, blocks, timeout=None, metadata=None, request_i block, whichever list it may belong to. :param blocks: - :type blocks: ~blob.models.BlockLookupList + :type blocks: ~azure.storage.blob.models.BlockLookupList :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param transactional_content_md5: Specify the transactional md5 for + the body, to be validated by the service. + :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray :param metadata: Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the @@ -402,25 +558,53 @@ async def commit_block_list(self, blocks, timeout=None, metadata=None, request_i C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_cache_control = None @@ -444,6 +628,9 @@ async def commit_block_list(self, blocks, timeout=None, metadata=None, request_i lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -470,13 +657,29 @@ async def commit_block_list(self, blocks, timeout=None, metadata=None, request_i query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/xml; charset=utf-8' + if transactional_content_md5 is not None: + header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -520,29 +723,37 @@ async def commit_block_list(self, blocks, timeout=None, metadata=None, request_i 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) commit_block_list.metadata = {'url': '/{containerName}/{blob}'} - async def get_block_list(self, list_type="committed", snapshot=None, timeout=None, request_id=None, lease_access_conditions=None, *, cls=None, **kwargs): + async def get_block_list(self, list_type="committed", snapshot=None, version_id=None, timeout=None, request_id=None, lease_access_conditions=None, *, cls=None, **kwargs): """The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. :param list_type: Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together. Possible values include: 'committed', 'uncommitted', 'all' - :type list_type: str or ~blob.models.BlockListType + :type list_type: str or ~azure.storage.blob.models.BlockListType :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -554,13 +765,14 @@ async def get_block_list(self, list_type="committed", snapshot=None, timeout=Non :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: BlockList or the result of cls(response) - :rtype: ~blob.models.BlockList + :rtype: ~azure.storage.blob.models.BlockList :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -580,6 +792,8 @@ async def get_block_list(self, list_type="committed", snapshot=None, timeout=Non query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') query_parameters['blocklisttype'] = self._serialize.query("list_type", list_type, 'BlockListType') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) @@ -587,7 +801,7 @@ async def get_block_list(self, list_type="committed", snapshot=None, timeout=Non # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -612,6 +826,7 @@ async def get_block_list(self, list_type="committed", snapshot=None, timeout=Non 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Content-Type': self._deserialize('str', response.headers.get('Content-Type')), 'x-ms-blob-content-length': self._deserialize('long', response.headers.get('x-ms-blob-content-length')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_container_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_container_operations_async.py index 950e07fc74ab..c21bf05c8629 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_container_operations_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_container_operations_async.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -36,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config - async def create(self, timeout=None, metadata=None, access=None, request_id=None, *, cls=None, **kwargs): + async def create(self, timeout=None, metadata=None, access=None, default_encryption_scope=None, deny_encryption_scope_override=None, request_id=None, *, cls=None, **kwargs): """creates a new container under the specified account. If the container with the same name already exists, the operation fails. @@ -58,7 +57,18 @@ async def create(self, timeout=None, metadata=None, access=None, request_id=None :param access: Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'container', 'blob' - :type access: str or ~blob.models.PublicAccessType + :type access: str or ~azure.storage.blob.models.PublicAccessType + :param default_encryption_scope: Optional. Specifies the default + encryption scope on the container. If not specified, encryption is + performed with the root account encryption key. For more information, + see Encryption at Rest for Azure Storage Services. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Optional. Specifies whether to + deny encryption scope override provided in the request or not. If + true, reject the request with encryption scope. If false, encryption + is performed using encryption scope provided in the request. For more + information, see Encryption at Rest for Azure Storage Services. + :type deny_encryption_scope_override: bool :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. @@ -68,7 +78,7 @@ async def create(self, timeout=None, metadata=None, access=None, request_id=None :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "container" @@ -92,6 +102,10 @@ async def create(self, timeout=None, metadata=None, access=None, request_id=None header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') if access is not None: header_parameters['x-ms-blob-public-access'] = self._serialize.header("access", access, 'str') + if default_encryption_scope is not None: + header_parameters['x-ms-default-encryption-scope'] = self._serialize.header("default_encryption_scope", default_encryption_scope, 'str') + if deny_encryption_scope_override is not None: + header_parameters['x-ms-deny-encryption-scope-override'] = self._serialize.header("deny_encryption_scope_override", deny_encryption_scope_override, 'bool') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -109,6 +123,7 @@ async def create(self, timeout=None, metadata=None, access=None, request_id=None response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -133,13 +148,14 @@ async def get_properties(self, timeout=None, request_id=None, lease_access_condi :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -186,10 +202,13 @@ async def get_properties(self, timeout=None, request_id=None, lease_access_condi 'x-ms-lease-duration': self._deserialize(models.LeaseDurationType, response.headers.get('x-ms-lease-duration')), 'x-ms-lease-state': self._deserialize(models.LeaseStateType, response.headers.get('x-ms-lease-state')), 'x-ms-lease-status': self._deserialize(models.LeaseStatusType, response.headers.get('x-ms-lease-status')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-blob-public-access': self._deserialize('str', response.headers.get('x-ms-blob-public-access')), + 'x-ms-default-encryption-scope': self._deserialize('str', response.headers.get('x-ms-default-encryption-scope')), + 'x-ms-deny-encryption-scope-override': self._deserialize('bool', response.headers.get('x-ms-deny-encryption-scope-override')), 'x-ms-has-immutability-policy': self._deserialize('bool', response.headers.get('x-ms-has-immutability-policy')), 'x-ms-has-legal-hold': self._deserialize('bool', response.headers.get('x-ms-has-legal-hold')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -213,17 +232,18 @@ async def delete(self, timeout=None, request_id=None, lease_access_conditions=No :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -274,6 +294,7 @@ async def delete(self, timeout=None, request_id=None, lease_access_conditions=No if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -307,17 +328,18 @@ async def set_metadata(self, timeout=None, metadata=None, request_id=None, lease :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -369,6 +391,7 @@ async def set_metadata(self, timeout=None, metadata=None, request_id=None, lease response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -392,13 +415,14 @@ async def get_access_policy(self, timeout=None, request_id=None, lease_access_co :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~blob.models.SignedIdentifier] + :rtype: list[~azure.storage.blob.models.SignedIdentifier] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -424,7 +448,7 @@ async def get_access_policy(self, timeout=None, request_id=None, lease_access_co # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -448,6 +472,7 @@ async def get_access_policy(self, timeout=None, request_id=None, lease_access_co 'x-ms-blob-public-access': self._deserialize('str', response.headers.get('x-ms-blob-public-access')), 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -465,7 +490,7 @@ async def set_access_policy(self, container_acl=None, timeout=None, access=None, indicate whether blobs in a container may be accessed publicly. :param container_acl: the acls for the container - :type container_acl: list[~blob.models.SignedIdentifier] + :type container_acl: list[~azure.storage.blob.models.SignedIdentifier] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -474,24 +499,25 @@ async def set_access_policy(self, container_acl=None, timeout=None, access=None, :param access: Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'container', 'blob' - :type access: str or ~blob.models.PublicAccessType + :type access: str or ~azure.storage.blob.models.PublicAccessType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -556,6 +582,7 @@ async def set_access_policy(self, container_acl=None, timeout=None, access=None, response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -591,13 +618,13 @@ async def acquire_lease(self, timeout=None, duration=None, proposed_lease_id=Non :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -654,6 +681,7 @@ async def acquire_lease(self, timeout=None, duration=None, proposed_lease_id=Non 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -681,13 +709,13 @@ async def release_lease(self, lease_id, timeout=None, request_id=None, modified_ :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -740,6 +768,7 @@ async def release_lease(self, lease_id, timeout=None, request_id=None, modified_ response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -767,13 +796,13 @@ async def renew_lease(self, lease_id, timeout=None, request_id=None, modified_ac :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -827,6 +856,7 @@ async def renew_lease(self, lease_id, timeout=None, request_id=None, modified_ac 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -862,13 +892,13 @@ async def break_lease(self, timeout=None, break_period=None, request_id=None, mo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -923,6 +953,7 @@ async def break_lease(self, timeout=None, break_period=None, request_id=None, mo 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-time': self._deserialize('int', response.headers.get('x-ms-lease-time')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -955,13 +986,13 @@ async def change_lease(self, lease_id, proposed_lease_id, timeout=None, request_ :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1016,6 +1047,7 @@ async def change_lease(self, lease_id, proposed_lease_id, timeout=None, request_ 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1050,7 +1082,8 @@ async def list_blob_flat_segment(self, prefix=None, marker=None, maxresults=None :type maxresults: int :param include: Include this parameter to specify one or more datasets to include in the response. - :type include: list[str or ~blob.models.ListBlobsIncludeItem] + :type include: list[str or + ~azure.storage.blob.models.ListBlobsIncludeItem] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -1063,9 +1096,9 @@ async def list_blob_flat_segment(self, prefix=None, marker=None, maxresults=None :param callable cls: A custom type or function that will be passed the direct response :return: ListBlobsFlatSegmentResponse or the result of cls(response) - :rtype: ~blob.models.ListBlobsFlatSegmentResponse + :rtype: ~azure.storage.blob.models.ListBlobsFlatSegmentResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "container" @@ -1095,7 +1128,7 @@ async def list_blob_flat_segment(self, prefix=None, marker=None, maxresults=None # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -1115,6 +1148,7 @@ async def list_blob_flat_segment(self, prefix=None, marker=None, maxresults=None deserialized = self._deserialize('ListBlobsFlatSegmentResponse', response) header_dict = { 'Content-Type': self._deserialize('str', response.headers.get('Content-Type')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1159,7 +1193,8 @@ async def list_blob_hierarchy_segment(self, delimiter, prefix=None, marker=None, :type maxresults: int :param include: Include this parameter to specify one or more datasets to include in the response. - :type include: list[str or ~blob.models.ListBlobsIncludeItem] + :type include: list[str or + ~azure.storage.blob.models.ListBlobsIncludeItem] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -1173,9 +1208,9 @@ async def list_blob_hierarchy_segment(self, delimiter, prefix=None, marker=None, direct response :return: ListBlobsHierarchySegmentResponse or the result of cls(response) - :rtype: ~blob.models.ListBlobsHierarchySegmentResponse + :rtype: ~azure.storage.blob.models.ListBlobsHierarchySegmentResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "container" @@ -1206,7 +1241,7 @@ async def list_blob_hierarchy_segment(self, delimiter, prefix=None, marker=None, # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -1226,6 +1261,7 @@ async def list_blob_hierarchy_segment(self, delimiter, prefix=None, marker=None, deserialized = self._deserialize('ListBlobsHierarchySegmentResponse', response) header_dict = { 'Content-Type': self._deserialize('str', response.headers.get('Content-Type')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1246,7 +1282,7 @@ async def get_account_info(self, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "account" @@ -1279,6 +1315,7 @@ async def get_account_info(self, *, cls=None, **kwargs): if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_directory_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_directory_operations_async.py new file mode 100644 index 000000000000..71d6887552f9 --- /dev/null +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_directory_operations_async.py @@ -0,0 +1,508 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import map_error + +from ... import models + + +class DirectoryOperations: + """DirectoryOperations async operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar resource: . Constant value: "directory". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self._config = config + self.resource = "directory" + + async def create(self, timeout=None, directory_properties=None, posix_permissions=None, posix_umask=None, request_id=None, directory_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + """Create a directory. By default, the destination is overwritten and if + the destination already exists and has a lease the lease is broken. + This operation supports conditional HTTP requests. For more + information, see [Specifying Conditional Headers for Blob Service + Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). + To fail if the destination already exists, use a conditional request + with If-None-Match: "*". + + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param directory_properties: Optional. User-defined properties to be + stored with the file or directory, in the format of a comma-separated + list of name and value pairs "n1=v1, n2=v2, ...", where each value is + base64 encoded. + :type directory_properties: str + :param posix_permissions: Optional and only valid if Hierarchical + Namespace is enabled for the account. Sets POSIX access permissions + for the file owner, the file owning group, and others. Each class may + be granted read, write, or execute permission. The sticky bit is also + supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. + 0766) are supported. + :type posix_permissions: str + :param posix_umask: Only valid if Hierarchical Namespace is enabled + for the account. This umask restricts permission settings for file and + directory, and will only be applied when default Acl does not exist in + parent directory. If the umask bit has set, it means that the + corresponding permission will be disabled. Otherwise the corresponding + permission will be determined by the permission. A 4-digit octal + notation (e.g. 0022) is supported here. If no umask was specified, a + default umask - 0027 will be used. + :type posix_umask: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param directory_http_headers: Additional parameters for the operation + :type directory_http_headers: + ~azure.storage.blob.models.DirectoryHttpHeaders + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`DataLakeStorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + cache_control = None + if directory_http_headers is not None: + cache_control = directory_http_headers.cache_control + content_type = None + if directory_http_headers is not None: + content_type = directory_http_headers.content_type + content_encoding = None + if directory_http_headers is not None: + content_encoding = directory_http_headers.content_encoding + content_language = None + if directory_http_headers is not None: + content_language = directory_http_headers.content_language + content_disposition = None + if directory_http_headers is not None: + content_disposition = directory_http_headers.content_disposition + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['resource'] = self._serialize.query("self.resource", self.resource, 'str') + + # Construct headers + header_parameters = {} + if directory_properties is not None: + header_parameters['x-ms-properties'] = self._serialize.header("directory_properties", directory_properties, 'str') + if posix_permissions is not None: + header_parameters['x-ms-permissions'] = self._serialize.header("posix_permissions", posix_permissions, 'str') + if posix_umask is not None: + header_parameters['x-ms-umask'] = self._serialize.header("posix_umask", posix_umask, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if cache_control is not None: + header_parameters['x-ms-cache-control'] = self._serialize.header("cache_control", cache_control, 'str') + if content_type is not None: + header_parameters['x-ms-content-type'] = self._serialize.header("content_type", content_type, 'str') + if content_encoding is not None: + header_parameters['x-ms-content-encoding'] = self._serialize.header("content_encoding", content_encoding, 'str') + if content_language is not None: + header_parameters['x-ms-content-language'] = self._serialize.header("content_language", content_language, 'str') + if content_disposition is not None: + header_parameters['x-ms-content-disposition'] = self._serialize.header("content_disposition", content_disposition, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.DataLakeStorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Content-Length': self._deserialize('long', response.headers.get('Content-Length')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + } + return cls(response, None, response_headers) + create.metadata = {'url': '/{filesystem}/{path}'} + + async def rename(self, rename_source, timeout=None, marker=None, path_rename_mode=None, directory_properties=None, posix_permissions=None, posix_umask=None, source_lease_id=None, request_id=None, directory_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, source_modified_access_conditions=None, *, cls=None, **kwargs): + """Rename a directory. By default, the destination is overwritten and if + the destination already exists and has a lease the lease is broken. + This operation supports conditional HTTP requests. For more + information, see [Specifying Conditional Headers for Blob Service + Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). + To fail if the destination already exists, use a conditional request + with If-None-Match: "*". + + :param rename_source: The file or directory to be renamed. The value + must have the following format: "/{filesysystem}/{path}". If + "x-ms-properties" is specified, the properties will overwrite the + existing properties; otherwise, the existing properties will be + preserved. + :type rename_source: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param marker: When renaming a directory, the number of paths that are + renamed with each invocation is limited. If the number of paths to be + renamed exceeds this limit, a continuation token is returned in this + response header. When a continuation token is returned in the + response, it must be specified in a subsequent invocation of the + rename operation to continue renaming the directory. + :type marker: str + :param path_rename_mode: Determines the behavior of the rename + operation. Possible values include: 'legacy', 'posix' + :type path_rename_mode: str or + ~azure.storage.blob.models.PathRenameMode + :param directory_properties: Optional. User-defined properties to be + stored with the file or directory, in the format of a comma-separated + list of name and value pairs "n1=v1, n2=v2, ...", where each value is + base64 encoded. + :type directory_properties: str + :param posix_permissions: Optional and only valid if Hierarchical + Namespace is enabled for the account. Sets POSIX access permissions + for the file owner, the file owning group, and others. Each class may + be granted read, write, or execute permission. The sticky bit is also + supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. + 0766) are supported. + :type posix_permissions: str + :param posix_umask: Only valid if Hierarchical Namespace is enabled + for the account. This umask restricts permission settings for file and + directory, and will only be applied when default Acl does not exist in + parent directory. If the umask bit has set, it means that the + corresponding permission will be disabled. Otherwise the corresponding + permission will be determined by the permission. A 4-digit octal + notation (e.g. 0022) is supported here. If no umask was specified, a + default umask - 0027 will be used. + :type posix_umask: str + :param source_lease_id: A lease ID for the source path. If specified, + the source path must have an active lease and the leaase ID must + match. + :type source_lease_id: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param directory_http_headers: Additional parameters for the operation + :type directory_http_headers: + ~azure.storage.blob.models.DirectoryHttpHeaders + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`DataLakeStorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + cache_control = None + if directory_http_headers is not None: + cache_control = directory_http_headers.cache_control + content_type = None + if directory_http_headers is not None: + content_type = directory_http_headers.content_type + content_encoding = None + if directory_http_headers is not None: + content_encoding = directory_http_headers.content_encoding + content_language = None + if directory_http_headers is not None: + content_language = directory_http_headers.content_language + content_disposition = None + if directory_http_headers is not None: + content_disposition = directory_http_headers.content_disposition + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + + # Construct URL + url = self.rename.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if marker is not None: + query_parameters['continuation'] = self._serialize.query("marker", marker, 'str') + if path_rename_mode is not None: + query_parameters['mode'] = self._serialize.query("path_rename_mode", path_rename_mode, 'PathRenameMode') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-rename-source'] = self._serialize.header("rename_source", rename_source, 'str') + if directory_properties is not None: + header_parameters['x-ms-properties'] = self._serialize.header("directory_properties", directory_properties, 'str') + if posix_permissions is not None: + header_parameters['x-ms-permissions'] = self._serialize.header("posix_permissions", posix_permissions, 'str') + if posix_umask is not None: + header_parameters['x-ms-umask'] = self._serialize.header("posix_umask", posix_umask, 'str') + if source_lease_id is not None: + header_parameters['x-ms-source-lease-id'] = self._serialize.header("source_lease_id", source_lease_id, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if cache_control is not None: + header_parameters['x-ms-cache-control'] = self._serialize.header("cache_control", cache_control, 'str') + if content_type is not None: + header_parameters['x-ms-content-type'] = self._serialize.header("content_type", content_type, 'str') + if content_encoding is not None: + header_parameters['x-ms-content-encoding'] = self._serialize.header("content_encoding", content_encoding, 'str') + if content_language is not None: + header_parameters['x-ms-content-language'] = self._serialize.header("content_language", content_language, 'str') + if content_disposition is not None: + header_parameters['x-ms-content-disposition'] = self._serialize.header("content_disposition", content_disposition, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.DataLakeStorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'x-ms-continuation': self._deserialize('str', response.headers.get('x-ms-continuation')), + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Content-Length': self._deserialize('long', response.headers.get('Content-Length')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + } + return cls(response, None, response_headers) + rename.metadata = {'url': '/{filesystem}/{path}'} + + async def delete(self, recursive_directory_delete, timeout=None, marker=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + """Deletes the directory. + + :param recursive_directory_delete: If "true", all paths beneath the + directory will be deleted. If "false" and the directory is non-empty, + an error occurs. + :type recursive_directory_delete: bool + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param marker: When renaming a directory, the number of paths that are + renamed with each invocation is limited. If the number of paths to be + renamed exceeds this limit, a continuation token is returned in this + response header. When a continuation token is returned in the + response, it must be specified in a subsequent invocation of the + rename operation to continue renaming the directory. + :type marker: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`DataLakeStorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['recursive'] = self._serialize.query("recursive_directory_delete", recursive_directory_delete, 'bool') + if marker is not None: + query_parameters['continuation'] = self._serialize.query("marker", marker, 'str') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.DataLakeStorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'x-ms-continuation': self._deserialize('str', response.headers.get('x-ms-continuation')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + } + return cls(response, None, response_headers) + delete.metadata = {'url': '/{filesystem}/{path}'} diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_page_blob_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_page_blob_operations_async.py index b889ad30075a..c42fc091155a 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_page_blob_operations_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_page_blob_operations_async.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -38,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config self.x_ms_blob_type = "PageBlob" - async def create(self, content_length, blob_content_length, timeout=None, metadata=None, blob_sequence_number=0, request_id=None, blob_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def create(self, content_length, blob_content_length, timeout=None, metadata=None, tags=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, blob_sequence_number=0, request_id=None, blob_http_headers=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Create operation creates a new page blob. :param content_length: The length of the request. @@ -62,6 +61,26 @@ async def create(self, content_length, blob_content_length, timeout=None, metada C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param blob_sequence_number: Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. @@ -71,20 +90,25 @@ async def create(self, content_length, blob_content_length, timeout=None, metada analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_content_type = None @@ -108,6 +132,9 @@ async def create(self, content_length, blob_content_length, timeout=None, metada lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -132,12 +159,22 @@ async def create(self, content_length, blob_content_length, timeout=None, metada query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') header_parameters['x-ms-blob-content-length'] = self._serialize.header("blob_content_length", blob_content_length, 'long') if blob_sequence_number is not None: header_parameters['x-ms-blob-sequence-number'] = self._serialize.header("blob_sequence_number", blob_sequence_number, 'long') @@ -182,16 +219,20 @@ async def create(self, content_length, blob_content_length, timeout=None, metada 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) create.metadata = {'url': '/{containerName}/{blob}'} - async def upload_pages(self, body, content_length, transactional_content_md5=None, timeout=None, range=None, request_id=None, lease_access_conditions=None, sequence_number_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def upload_pages(self, body, content_length, transactional_content_md5=None, transactional_content_crc64=None, timeout=None, range=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, customer_provided_key_info=None, sequence_number_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Upload Pages operation writes a range of pages to a page blob. :param body: Initial data @@ -201,6 +242,9 @@ async def upload_pages(self, body, content_length, transactional_content_md5=Non :param transactional_content_md5: Specify the transactional md5 for the body, to be validated by the service. :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -209,32 +253,55 @@ async def upload_pages(self, body, content_length, transactional_content_md5=Non :param range: Return only the bytes of the blob in the specified range. :type range: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param sequence_number_access_conditions: Additional parameters for the operation :type sequence_number_access_conditions: - ~blob.models.SequenceNumberAccessConditions + ~azure.storage.blob.models.SequenceNumberAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_sequence_number_less_than_or_equal_to = None if sequence_number_access_conditions is not None: if_sequence_number_less_than_or_equal_to = sequence_number_access_conditions.if_sequence_number_less_than_or_equal_to @@ -271,7 +338,15 @@ async def upload_pages(self, body, content_length, transactional_content_md5=Non query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -279,6 +354,8 @@ async def upload_pages(self, body, content_length, transactional_content_md5=Non header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if transactional_content_md5 is not None: header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') if range is not None: header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') @@ -318,11 +395,15 @@ async def upload_pages(self, body, content_length, transactional_content_md5=Non 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -347,21 +428,22 @@ async def clear_pages(self, content_length, timeout=None, range=None, request_id :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param sequence_number_access_conditions: Additional parameters for the operation :type sequence_number_access_conditions: - ~blob.models.SequenceNumberAccessConditions + ~azure.storage.blob.models.SequenceNumberAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -445,7 +527,9 @@ async def clear_pages(self, content_length, timeout=None, range=None, request_id 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -454,9 +538,180 @@ async def clear_pages(self, content_length, timeout=None, range=None, request_id return cls(response, None, response_headers) clear_pages.metadata = {'url': '/{containerName}/{blob}'} - async def get_page_ranges(self, snapshot=None, timeout=None, range=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def upload_pages_from_url(self, source_url, source_range, content_length, range, source_content_md5=None, source_contentcrc64=None, timeout=None, request_id=None, lease_access_conditions=None, sequence_number_access_conditions=None, modified_access_conditions=None, source_modified_access_conditions=None, *, cls=None, **kwargs): + """The Upload Pages operation writes a range of pages to a page blob where + the contents are read from a URL. + + :param source_url: Specify a URL to the copy source. + :type source_url: str + :param source_range: Bytes of source data in the specified range. The + length of this range should match the ContentLength header and + x-ms-range/Range destination range header. + :type source_range: str + :param content_length: The length of the request. + :type content_length: long + :param range: The range of bytes to which the source range would be + written. The range should be 512 aligned and range-end is required. + :type range: str + :param source_content_md5: Specify the md5 calculated for the range of + bytes that must be read from the copy source. + :type source_content_md5: bytearray + :param source_contentcrc64: Specify the crc64 calculated for the range + of bytes that must be read from the copy source. + :type source_contentcrc64: bytearray + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param sequence_number_access_conditions: Additional parameters for + the operation + :type sequence_number_access_conditions: + ~azure.storage.blob.models.SequenceNumberAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_sequence_number_less_than_or_equal_to = None + if sequence_number_access_conditions is not None: + if_sequence_number_less_than_or_equal_to = sequence_number_access_conditions.if_sequence_number_less_than_or_equal_to + if_sequence_number_less_than = None + if sequence_number_access_conditions is not None: + if_sequence_number_less_than = sequence_number_access_conditions.if_sequence_number_less_than + if_sequence_number_equal_to = None + if sequence_number_access_conditions is not None: + if_sequence_number_equal_to = sequence_number_access_conditions.if_sequence_number_equal_to + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + + comp = "page" + page_write = "update" + + # Construct URL + url = self.upload_pages_from_url.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-copy-source'] = self._serialize.header("source_url", source_url, 'str') + header_parameters['x-ms-source-range'] = self._serialize.header("source_range", source_range, 'str') + if source_content_md5 is not None: + header_parameters['x-ms-source-content-md5'] = self._serialize.header("source_content_md5", source_content_md5, 'bytearray') + if source_contentcrc64 is not None: + header_parameters['x-ms-source-content-crc64'] = self._serialize.header("source_contentcrc64", source_contentcrc64, 'bytearray') + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + header_parameters['x-ms-page-write'] = self._serialize.header("page_write", page_write, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_sequence_number_less_than_or_equal_to is not None: + header_parameters['x-ms-if-sequence-number-le'] = self._serialize.header("if_sequence_number_less_than_or_equal_to", if_sequence_number_less_than_or_equal_to, 'long') + if if_sequence_number_less_than is not None: + header_parameters['x-ms-if-sequence-number-lt'] = self._serialize.header("if_sequence_number_less_than", if_sequence_number_less_than, 'long') + if if_sequence_number_equal_to is not None: + header_parameters['x-ms-if-sequence-number-eq'] = self._serialize.header("if_sequence_number_equal_to", if_sequence_number_equal_to, 'long') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + upload_pages_from_url.metadata = {'url': '/{containerName}/{blob}'} + + async def get_page_ranges(self, snapshot=None, version_id=None, timeout=None, range=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): """The Get Page Ranges operation returns the list of valid page ranges for - a page blob or snapshot of a page blob. + a page blob, version or snapshot of a page blob. :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more @@ -464,6 +719,9 @@ async def get_page_ranges(self, snapshot=None, timeout=None, range=None, request href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -478,17 +736,18 @@ async def get_page_ranges(self, snapshot=None, timeout=None, range=None, request :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: PageList or the result of cls(response) - :rtype: ~blob.models.PageList + :rtype: ~azure.storage.blob.models.PageList :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -520,13 +779,15 @@ async def get_page_ranges(self, snapshot=None, timeout=None, range=None, request query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) query_parameters['comp'] = self._serialize.query("comp", comp, 'str') # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' if range is not None: header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') @@ -560,6 +821,7 @@ async def get_page_ranges(self, snapshot=None, timeout=None, range=None, request 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'ETag': self._deserialize('str', response.headers.get('ETag')), 'x-ms-blob-content-length': self._deserialize('long', response.headers.get('x-ms-blob-content-length')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -572,10 +834,10 @@ async def get_page_ranges(self, snapshot=None, timeout=None, range=None, request return deserialized get_page_ranges.metadata = {'url': '/{containerName}/{blob}'} - async def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=None, range=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): + async def get_page_ranges_diff(self, snapshot=None, version_id=None, timeout=None, prevsnapshot=None, range=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, *, cls=None, **kwargs): """[Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were changed between target blob and - previous snapshot. + previous snapshot or version. :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more @@ -583,6 +845,9 @@ async def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=N href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -606,17 +871,18 @@ async def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=N :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: PageList or the result of cls(response) - :rtype: ~blob.models.PageList + :rtype: ~azure.storage.blob.models.PageList :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -648,6 +914,8 @@ async def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=N query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) if prevsnapshot is not None: @@ -656,7 +924,7 @@ async def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=N # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' if range is not None: header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') @@ -690,6 +958,7 @@ async def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=N 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'ETag': self._deserialize('str', response.headers.get('ETag')), 'x-ms-blob-content-length': self._deserialize('long', response.headers.get('x-ms-blob-content-length')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -720,17 +989,18 @@ async def resize(self, blob_content_length, timeout=None, request_id=None, lease :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -795,6 +1065,7 @@ async def resize(self, blob_content_length, timeout=None, request_id=None, lease 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -812,7 +1083,7 @@ async def update_sequence_number(self, sequence_number_action, timeout=None, blo should modify the blob's sequence number. Possible values include: 'max', 'update', 'increment' :type sequence_number_action: str or - ~blob.models.SequenceNumberActionType + ~azure.storage.blob.models.SequenceNumberActionType :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -828,17 +1099,18 @@ async def update_sequence_number(self, sequence_number_action, timeout=None, blo :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -905,6 +1177,7 @@ async def update_sequence_number(self, sequence_number_action, timeout=None, blo 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -939,13 +1212,13 @@ async def copy_incremental(self, copy_source, timeout=None, request_id=None, mod :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1004,6 +1277,7 @@ async def copy_incremental(self, copy_source, timeout=None, request_id=None, mod response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_service_operations_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_service_operations_async.py index 511bb3251af8..d33692136e8a 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_service_operations_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations_async/_service_operations_async.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -43,7 +42,7 @@ async def set_properties(self, storage_service_properties, timeout=None, request :param storage_service_properties: The StorageService properties. :type storage_service_properties: - ~blob.models.StorageServiceProperties + ~azure.storage.blob.models.StorageServiceProperties :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -58,7 +57,7 @@ async def set_properties(self, storage_service_properties, timeout=None, request :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "service" @@ -99,6 +98,7 @@ async def set_properties(self, storage_service_properties, timeout=None, request if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -123,9 +123,9 @@ async def get_properties(self, timeout=None, request_id=None, *, cls=None, **kwa :param callable cls: A custom type or function that will be passed the direct response :return: StorageServiceProperties or the result of cls(response) - :rtype: ~blob.models.StorageServiceProperties + :rtype: ~azure.storage.blob.models.StorageServiceProperties :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "service" @@ -147,7 +147,7 @@ async def get_properties(self, timeout=None, request_id=None, *, cls=None, **kwa # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -166,6 +166,7 @@ async def get_properties(self, timeout=None, request_id=None, *, cls=None, **kwa if response.status_code == 200: deserialized = self._deserialize('StorageServiceProperties', response) header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -194,9 +195,9 @@ async def get_statistics(self, timeout=None, request_id=None, *, cls=None, **kwa :param callable cls: A custom type or function that will be passed the direct response :return: StorageServiceStats or the result of cls(response) - :rtype: ~blob.models.StorageServiceStats + :rtype: ~azure.storage.blob.models.StorageServiceStats :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "service" @@ -218,7 +219,7 @@ async def get_statistics(self, timeout=None, request_id=None, *, cls=None, **kwa # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -237,6 +238,7 @@ async def get_statistics(self, timeout=None, request_id=None, *, cls=None, **kwa if response.status_code == 200: deserialized = self._deserialize('StorageServiceStats', response) header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -276,7 +278,8 @@ async def list_containers_segment(self, prefix=None, marker=None, maxresults=Non :param include: Include this parameter to specify that the container's metadata be returned as part of the response body. Possible values include: 'metadata' - :type include: str or ~blob.models.ListContainersIncludeType + :type include: str or + ~azure.storage.blob.models.ListContainersIncludeType :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -289,9 +292,9 @@ async def list_containers_segment(self, prefix=None, marker=None, maxresults=Non :param callable cls: A custom type or function that will be passed the direct response :return: ListContainersSegmentResponse or the result of cls(response) - :rtype: ~blob.models.ListContainersSegmentResponse + :rtype: ~azure.storage.blob.models.ListContainersSegmentResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "list" @@ -319,7 +322,7 @@ async def list_containers_segment(self, prefix=None, marker=None, maxresults=Non # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -338,6 +341,7 @@ async def list_containers_segment(self, prefix=None, marker=None, maxresults=Non if response.status_code == 200: deserialized = self._deserialize('ListContainersSegmentResponse', response) header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -349,6 +353,84 @@ async def list_containers_segment(self, prefix=None, marker=None, maxresults=Non return deserialized list_containers_segment.metadata = {'url': '/'} + async def get_user_delegation_key(self, key_info, timeout=None, request_id=None, *, cls=None, **kwargs): + """Retrieves a user delgation key for the Blob service. This is only a + valid operation when using bearer token authentication. + + :param key_info: + :type key_info: ~azure.storage.blob.models.KeyInfo + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param callable cls: A custom type or function that will be passed the + direct response + :return: UserDelegationKey or the result of cls(response) + :rtype: ~azure.storage.blob.models.UserDelegationKey + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + restype = "service" + comp = "userdelegationkey" + + # Construct URL + url = self.get_user_delegation_key.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['restype'] = self._serialize.query("restype", restype, 'str') + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' + header_parameters['Content-Type'] = 'application/xml; charset=utf-8' + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + + # Construct body + body_content = self._serialize.body(key_info, 'KeyInfo') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('UserDelegationKey', response) + header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + + if cls: + return cls(response, deserialized, header_dict) + + return deserialized + get_user_delegation_key.metadata = {'url': '/'} + async def get_account_info(self, *, cls=None, **kwargs): """Returns the sku name and account kind . @@ -357,7 +439,7 @@ async def get_account_info(self, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "account" @@ -390,6 +472,7 @@ async def get_account_info(self, *, cls=None, **kwargs): if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -399,3 +482,100 @@ async def get_account_info(self, *, cls=None, **kwargs): } return cls(response, None, response_headers) get_account_info.metadata = {'url': '/'} + + async def filter_blobs(self, filter, marker=None, maxresults=None, timeout=None, request_id=None, *, cls=None, **kwargs): + """The Filter Blobs operation enables callers to list blobs in an account + whose tags match a given search expression. + + :param filter: The filter parameter enables the caller to query blobs + whose tags match a given expression. The given expression must + evaluate to true for a blob to be returned in the results. + :type filter: str + :param marker: A string value that identifies the portion of the list + of containers to be returned with the next listing operation. The + operation returns the NextMarker value within the response body if the + listing operation did not return all containers remaining to be listed + with the current page. The NextMarker value can be used as the value + for the marker parameter in a subsequent call to request the next page + of list items. The marker value is opaque to the client. + :type marker: str + :param maxresults: Specifies the maximum number of containers to + return. If the request does not specify maxresults, or specifies a + value greater than 5000, the server will return up to 5000 items. Note + that if the listing operation crosses a partition boundary, then the + service will return a continuation token for retrieving the remainder + of the results. For this reason, it is possible that the service will + return fewer results than specified by maxresults, or than the default + of 5000. + :type maxresults: int + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param callable cls: A custom type or function that will be passed the + direct response + :return: FilterBlobsResponse or the result of cls(response) + :rtype: ~azure.storage.blob.models.FilterBlobsResponse + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + comp = "blobs" + + # Construct URL + url = self.filter_blobs.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if marker is not None: + query_parameters['marker'] = self._serialize.query("marker", marker, 'str') + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', minimum=1) + query_parameters['filter'] = self._serialize.query("filter", filter, 'str') + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FilterBlobsResponse', response) + header_dict = { + 'Content-Type': self._deserialize('str', response.headers.get('Content-Type')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + + if cls: + return cls(response, deserialized, header_dict) + + return deserialized + filter_blobs.metadata = {'url': '/'} diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/__init__.py index 57b0962c02fd..7f7ffdda157a 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/__init__.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file try: from ._models_py3 import AccessPolicy @@ -17,8 +16,10 @@ from ._models_py3 import BlobHierarchyListSegment from ._models_py3 import BlobHTTPHeaders from ._models_py3 import BlobItem + from ._models_py3 import BlobMetadata from ._models_py3 import BlobPrefix from ._models_py3 import BlobProperties + from ._models_py3 import BlobTags from ._models_py3 import Block from ._models_py3 import BlockList from ._models_py3 import BlockLookupList @@ -26,7 +27,15 @@ from ._models_py3 import ContainerItem from ._models_py3 import ContainerProperties from ._models_py3 import CorsRule + from ._models_py3 import CustomerProvidedKeyInfo + from ._models_py3 import DataLakeStorageError, DataLakeStorageErrorException + from ._models_py3 import DataLakeStorageErrorError + from ._models_py3 import DirectoryHttpHeaders + from ._models_py3 import FilterBlobsItem + from ._models_py3 import FilterBlobsResponse + from ._models_py3 import FilterBlobsSegment from ._models_py3 import GeoReplication + from ._models_py3 import KeyInfo from ._models_py3 import LeaseAccessConditions from ._models_py3 import ListBlobsFlatSegmentResponse from ._models_py3 import ListBlobsHierarchySegmentResponse @@ -44,6 +53,8 @@ from ._models_py3 import StorageError, StorageErrorException from ._models_py3 import StorageServiceProperties from ._models_py3 import StorageServiceStats + from ._models_py3 import Tag + from ._models_py3 import UserDelegationKey except (SyntaxError, ImportError): from ._models import AccessPolicy from ._models import AppendPositionAccessConditions @@ -51,8 +62,10 @@ from ._models import BlobHierarchyListSegment from ._models import BlobHTTPHeaders from ._models import BlobItem + from ._models import BlobMetadata from ._models import BlobPrefix from ._models import BlobProperties + from ._models import BlobTags from ._models import Block from ._models import BlockList from ._models import BlockLookupList @@ -60,7 +73,15 @@ from ._models import ContainerItem from ._models import ContainerProperties from ._models import CorsRule + from ._models import CustomerProvidedKeyInfo + from ._models import DataLakeStorageError, DataLakeStorageErrorException + from ._models import DataLakeStorageErrorError + from ._models import DirectoryHttpHeaders + from ._models import FilterBlobsItem + from ._models import FilterBlobsResponse + from ._models import FilterBlobsSegment from ._models import GeoReplication + from ._models import KeyInfo from ._models import LeaseAccessConditions from ._models import ListBlobsFlatSegmentResponse from ._models import ListBlobsHierarchySegmentResponse @@ -78,24 +99,32 @@ from ._models import StorageError, StorageErrorException from ._models import StorageServiceProperties from ._models import StorageServiceStats + from ._models import Tag + from ._models import UserDelegationKey from ._azure_blob_storage_enums import ( AccessTier, + AccessTierOptional, + AccessTierRequired, AccountKind, ArchiveStatus, BlobType, BlockListType, CopyStatusType, DeleteSnapshotsOptionType, + EncryptionAlgorithmType, GeoReplicationStatusType, LeaseDurationType, LeaseStateType, LeaseStatusType, ListBlobsIncludeItem, ListContainersIncludeType, + PathRenameMode, PublicAccessType, + RehydratePriority, SequenceNumberActionType, SkuName, StorageErrorCode, + SyncCopyStatusType, ) __all__ = [ @@ -105,8 +134,10 @@ 'BlobHierarchyListSegment', 'BlobHTTPHeaders', 'BlobItem', + 'BlobMetadata', 'BlobPrefix', 'BlobProperties', + 'BlobTags', 'Block', 'BlockList', 'BlockLookupList', @@ -114,7 +145,15 @@ 'ContainerItem', 'ContainerProperties', 'CorsRule', + 'CustomerProvidedKeyInfo', + 'DataLakeStorageError', 'DataLakeStorageErrorException', + 'DataLakeStorageErrorError', + 'DirectoryHttpHeaders', + 'FilterBlobsItem', + 'FilterBlobsResponse', + 'FilterBlobsSegment', 'GeoReplication', + 'KeyInfo', 'LeaseAccessConditions', 'ListBlobsFlatSegmentResponse', 'ListBlobsHierarchySegmentResponse', @@ -132,6 +171,8 @@ 'StorageError', 'StorageErrorException', 'StorageServiceProperties', 'StorageServiceStats', + 'Tag', + 'UserDelegationKey', 'PublicAccessType', 'CopyStatusType', 'LeaseDurationType', @@ -142,11 +183,17 @@ 'BlobType', 'StorageErrorCode', 'GeoReplicationStatusType', + 'AccessTierRequired', + 'AccessTierOptional', + 'RehydratePriority', 'BlockListType', 'DeleteSnapshotsOptionType', + 'EncryptionAlgorithmType', 'ListBlobsIncludeItem', 'ListContainersIncludeType', + 'PathRenameMode', 'SequenceNumberActionType', 'SkuName', 'AccountKind', + 'SyncCopyStatusType', ] diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py index 7967cdffe70e..9aab2a9ff08b 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_azure_blob_storage_enums.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from enum import Enum @@ -81,7 +80,6 @@ class StorageErrorCode(str, Enum): account_being_created = "AccountBeingCreated" account_is_disabled = "AccountIsDisabled" authentication_failed = "AuthenticationFailed" - authorization_failure = "AuthorizationFailure" condition_headers_not_supported = "ConditionHeadersNotSupported" condition_not_met = "ConditionNotMet" empty_metadata_key = "EmptyMetadataKey" @@ -191,6 +189,33 @@ class GeoReplicationStatusType(str, Enum): unavailable = "unavailable" +class AccessTierRequired(str, Enum): + + p4 = "P4" + p6 = "P6" + p10 = "P10" + p20 = "P20" + p30 = "P30" + p40 = "P40" + p50 = "P50" + hot = "Hot" + cool = "Cool" + archive = "Archive" + + +class AccessTierOptional(str, Enum): + + hot = "Hot" + cool = "Cool" + archive = "Archive" + + +class RehydratePriority(str, Enum): + + high = "High" + standard = "Standard" + + class BlockListType(str, Enum): committed = "committed" @@ -204,13 +229,19 @@ class DeleteSnapshotsOptionType(str, Enum): only = "only" +class EncryptionAlgorithmType(str, Enum): + + aes256 = "AES256" + + class ListBlobsIncludeItem(str, Enum): - snapshots = "snapshots" - metadata = "metadata" - uncommittedblobs = "uncommittedblobs" copy = "copy" deleted = "deleted" + metadata = "metadata" + snapshots = "snapshots" + tags = "tags" + uncommittedblobs = "uncommittedblobs" class ListContainersIncludeType(str, Enum): @@ -218,6 +249,12 @@ class ListContainersIncludeType(str, Enum): metadata = "metadata" +class PathRenameMode(str, Enum): + + legacy = "legacy" + posix = "posix" + + class SequenceNumberActionType(str, Enum): max = "max" @@ -239,3 +276,8 @@ class AccountKind(str, Enum): storage = "Storage" blob_storage = "BlobStorage" storage_v2 = "StorageV2" + + +class SyncCopyStatusType(str, Enum): + + success = "success" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py index 9ad7e74f6478..d6346992f456 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from msrest.serialization import Model from azure.core import HttpResponseError @@ -19,12 +18,10 @@ class AccessPolicy(Model): All required parameters must be populated in order to send to Azure. - :param start: Required. the date-time the policy is active. - The date should be exactly in this 019-05-23T21:21:28Z format - :type start: datetime + :param start: Required. the date-time the policy is active + :type start: str :param expiry: Required. the date-time the policy expires - The date should be exactly in this 019-05-23T21:21:28Z format - :type expiry: datetime + :type expiry: str :param permission: Required. the permissions for the acl policy :type permission: str """ @@ -51,7 +48,8 @@ def __init__(self, **kwargs): class AppendPositionAccessConditions(Model): - """Additional parameters for append_block operation. + """Additional parameters for a set of operations, such as: + AppendBlob_append_block, AppendBlob_append_block_from_url. :param max_size: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause @@ -88,7 +86,7 @@ class BlobFlatListSegment(Model): All required parameters must be populated in order to send to Azure. :param blob_items: Required. - :type blob_items: list[~blob.models.BlobItem] + :type blob_items: list[~azure.storage.blob.models.BlobItem] """ _validation = { @@ -113,9 +111,9 @@ class BlobHierarchyListSegment(Model): All required parameters must be populated in order to send to Azure. :param blob_prefixes: - :type blob_prefixes: list[~blob.models.BlobPrefix] + :type blob_prefixes: list[~azure.storage.blob.models.BlobPrefix] :param blob_items: Required. - :type blob_items: list[~blob.models.BlobItem] + :type blob_items: list[~azure.storage.blob.models.BlobItem] """ _validation = { @@ -196,16 +194,21 @@ class BlobItem(Model): :type deleted: bool :param snapshot: Required. :type snapshot: str + :param version_id: Required. + :type version_id: str :param properties: Required. - :type properties: ~blob.models.BlobProperties + :type properties: ~azure.storage.blob.models.BlobProperties :param metadata: - :type metadata: dict[str, str] + :type metadata: ~azure.storage.blob.models.BlobMetadata + :param tags: + :type tags: ~azure.storage.blob.models.BlobTags """ _validation = { 'name': {'required': True}, 'deleted': {'required': True}, 'snapshot': {'required': True}, + 'version_id': {'required': True}, 'properties': {'required': True}, } @@ -213,8 +216,10 @@ class BlobItem(Model): 'name': {'key': 'Name', 'type': 'str', 'xml': {'name': 'Name'}}, 'deleted': {'key': 'Deleted', 'type': 'bool', 'xml': {'name': 'Deleted'}}, 'snapshot': {'key': 'Snapshot', 'type': 'str', 'xml': {'name': 'Snapshot'}}, + 'version_id': {'key': 'VersionId', 'type': 'str', 'xml': {'name': 'VersionId'}}, 'properties': {'key': 'Properties', 'type': 'BlobProperties', 'xml': {'name': 'Properties'}}, - 'metadata': {'key': 'Metadata', 'type': '{str}', 'xml': {'name': 'Metadata'}}, + 'metadata': {'key': 'Metadata', 'type': 'BlobMetadata', 'xml': {'name': 'Metadata'}}, + 'tags': {'key': 'Tags', 'type': 'BlobTags', 'xml': {'name': 'Tags'}}, } _xml_map = { 'name': 'Blob' @@ -225,8 +230,34 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) self.deleted = kwargs.get('deleted', None) self.snapshot = kwargs.get('snapshot', None) + self.version_id = kwargs.get('version_id', None) self.properties = kwargs.get('properties', None) self.metadata = kwargs.get('metadata', None) + self.tags = kwargs.get('tags', None) + + +class BlobMetadata(Model): + """BlobMetadata. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, str] + :param encrypted: + :type encrypted: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{str}', 'xml': {'name': 'additional_properties'}}, + 'encrypted': {'key': 'Encrypted', 'type': 'str', 'xml': {'name': 'Encrypted', 'attr': True}}, + } + _xml_map = { + 'name': 'Metadata' + } + + def __init__(self, **kwargs): + super(BlobMetadata, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.encrypted = kwargs.get('encrypted', None) class BlobPrefix(Model): @@ -282,19 +313,19 @@ class BlobProperties(Model): :type blob_sequence_number: long :param blob_type: Possible values include: 'BlockBlob', 'PageBlob', 'AppendBlob' - :type blob_type: str or ~blob.models.BlobType + :type blob_type: str or ~azure.storage.blob.models.BlobType :param lease_status: Possible values include: 'locked', 'unlocked' - :type lease_status: str or ~blob.models.LeaseStatusType + :type lease_status: str or ~azure.storage.blob.models.LeaseStatusType :param lease_state: Possible values include: 'available', 'leased', 'expired', 'breaking', 'broken' - :type lease_state: str or ~blob.models.LeaseStateType + :type lease_state: str or ~azure.storage.blob.models.LeaseStateType :param lease_duration: Possible values include: 'infinite', 'fixed' - :type lease_duration: str or ~blob.models.LeaseDurationType + :type lease_duration: str or ~azure.storage.blob.models.LeaseDurationType :param copy_id: :type copy_id: str :param copy_status: Possible values include: 'pending', 'success', 'aborted', 'failed' - :type copy_status: str or ~blob.models.CopyStatusType + :type copy_status: str or ~azure.storage.blob.models.CopyStatusType :param copy_source: :type copy_source: str :param copy_progress: @@ -315,19 +346,26 @@ class BlobProperties(Model): :type remaining_retention_days: int :param access_tier: Possible values include: 'P4', 'P6', 'P10', 'P20', 'P30', 'P40', 'P50', 'Hot', 'Cool', 'Archive' - :type access_tier: str or ~blob.models.AccessTier + :type access_tier: str or ~azure.storage.blob.models.AccessTier :param access_tier_inferred: :type access_tier_inferred: bool :param archive_status: Possible values include: 'rehydrate-pending-to-hot', 'rehydrate-pending-to-cool' - :type archive_status: str or ~blob.models.ArchiveStatus + :type archive_status: str or ~azure.storage.blob.models.ArchiveStatus + :param customer_provided_key_sha256: + :type customer_provided_key_sha256: str + :param encryption_scope: + :type encryption_scope: str :param access_tier_change_time: :type access_tier_change_time: datetime + :param tag_count: Required. The number of tags corresponding to the blob. + :type tag_count: int """ _validation = { 'last_modified': {'required': True}, 'etag': {'required': True}, + 'tag_count': {'required': True}, } _attribute_map = { @@ -360,7 +398,10 @@ class BlobProperties(Model): 'access_tier': {'key': 'AccessTier', 'type': 'str', 'xml': {'name': 'AccessTier'}}, 'access_tier_inferred': {'key': 'AccessTierInferred', 'type': 'bool', 'xml': {'name': 'AccessTierInferred'}}, 'archive_status': {'key': 'ArchiveStatus', 'type': 'str', 'xml': {'name': 'ArchiveStatus'}}, + 'customer_provided_key_sha256': {'key': 'CustomerProvidedKeySha256', 'type': 'str', 'xml': {'name': 'CustomerProvidedKeySha256'}}, + 'encryption_scope': {'key': 'EncryptionScope', 'type': 'str', 'xml': {'name': 'EncryptionScope'}}, 'access_tier_change_time': {'key': 'AccessTierChangeTime', 'type': 'rfc-1123', 'xml': {'name': 'AccessTierChangeTime'}}, + 'tag_count': {'key': 'TagCount', 'type': 'int', 'xml': {'name': 'TagCount'}}, } _xml_map = { 'name': 'Properties' @@ -397,7 +438,29 @@ def __init__(self, **kwargs): self.access_tier = kwargs.get('access_tier', None) self.access_tier_inferred = kwargs.get('access_tier_inferred', None) self.archive_status = kwargs.get('archive_status', None) + self.customer_provided_key_sha256 = kwargs.get('customer_provided_key_sha256', None) + self.encryption_scope = kwargs.get('encryption_scope', None) self.access_tier_change_time = kwargs.get('access_tier_change_time', None) + self.tag_count = kwargs.get('tag_count', None) + + +class BlobTags(Model): + """XML containing key/value pairs representing the tags for the blob. + + :param tag_set: + :type tag_set: list[~azure.storage.blob.models.Tag] + """ + + _attribute_map = { + 'tag_set': {'key': 'TagSet', 'type': '[Tag]', 'xml': {'name': 'TagSet', 'itemsName': 'Tag', 'wrapped': True}}, + } + _xml_map = { + 'name': 'Tags' + } + + def __init__(self, **kwargs): + super(BlobTags, self).__init__(**kwargs) + self.tag_set = kwargs.get('tag_set', None) class Block(Model): @@ -434,9 +497,9 @@ class BlockList(Model): """BlockList. :param committed_blocks: - :type committed_blocks: list[~blob.models.Block] + :type committed_blocks: list[~azure.storage.blob.models.Block] :param uncommitted_blocks: - :type uncommitted_blocks: list[~blob.models.Block] + :type uncommitted_blocks: list[~azure.storage.blob.models.Block] """ _attribute_map = { @@ -517,7 +580,7 @@ class ContainerItem(Model): :param name: Required. :type name: str :param properties: Required. - :type properties: ~blob.models.ContainerProperties + :type properties: ~azure.storage.blob.models.ContainerProperties :param metadata: :type metadata: dict[str, str] """ @@ -553,14 +616,14 @@ class ContainerProperties(Model): :param etag: Required. :type etag: str :param lease_status: Possible values include: 'locked', 'unlocked' - :type lease_status: str or ~blob.models.LeaseStatusType + :type lease_status: str or ~azure.storage.blob.models.LeaseStatusType :param lease_state: Possible values include: 'available', 'leased', 'expired', 'breaking', 'broken' - :type lease_state: str or ~blob.models.LeaseStateType + :type lease_state: str or ~azure.storage.blob.models.LeaseStateType :param lease_duration: Possible values include: 'infinite', 'fixed' - :type lease_duration: str or ~blob.models.LeaseDurationType + :type lease_duration: str or ~azure.storage.blob.models.LeaseDurationType :param public_access: Possible values include: 'container', 'blob' - :type public_access: str or ~blob.models.PublicAccessType + :type public_access: str or ~azure.storage.blob.models.PublicAccessType :param has_immutability_policy: :type has_immutability_policy: bool :param has_legal_hold: @@ -655,6 +718,212 @@ def __init__(self, **kwargs): self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) +class CustomerProvidedKeyInfo(Model): + """Additional parameters for a set of operations. + + :param encryption_scope: Optional. Specifies the encryption scope to use + to encrypt the data provided in the request. If not specified, encryption + is performed with the root account encryption key. For more information, + see Encryption at Rest for Azure Storage Services. + :type encryption_scope: str + """ + + _attribute_map = { + 'encryption_scope': {'key': '', 'type': 'str', 'xml': {'name': 'encryption_scope'}}, + } + _xml_map = { + } + + def __init__(self, **kwargs): + super(CustomerProvidedKeyInfo, self).__init__(**kwargs) + self.encryption_scope = kwargs.get('encryption_scope', None) + + +class DataLakeStorageError(Model): + """DataLakeStorageError. + + :param error: The service error response object. + :type error: ~azure.storage.blob.models.DataLakeStorageErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DataLakeStorageErrorError', 'xml': {'name': 'error'}}, + } + _xml_map = { + } + + def __init__(self, **kwargs): + super(DataLakeStorageError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class DataLakeStorageErrorException(HttpResponseError): + """Server responsed with exception of type: 'DataLakeStorageError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, response, deserialize, *args): + + model_name = 'DataLakeStorageError' + self.error = deserialize(model_name, response) + if self.error is None: + self.error = deserialize.dependencies[model_name]() + super(DataLakeStorageErrorException, self).__init__(response=response) + + +class DataLakeStorageErrorError(Model): + """The service error response object. + + :param code: The service error code. + :type code: str + :param message: The service error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str', 'xml': {'name': 'code'}}, + 'message': {'key': 'message', 'type': 'str', 'xml': {'name': 'message'}}, + } + _xml_map = { + } + + def __init__(self, **kwargs): + super(DataLakeStorageErrorError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class DirectoryHttpHeaders(Model): + """Additional parameters for a set of operations, such as: Directory_create, + Directory_rename, Blob_rename. + + :param cache_control: Cache control for given resource + :type cache_control: str + :param content_type: Content type for given resource + :type content_type: str + :param content_encoding: Content encoding for given resource + :type content_encoding: str + :param content_language: Content language for given resource + :type content_language: str + :param content_disposition: Content disposition for given resource + :type content_disposition: str + """ + + _attribute_map = { + 'cache_control': {'key': '', 'type': 'str', 'xml': {'name': 'cache_control'}}, + 'content_type': {'key': '', 'type': 'str', 'xml': {'name': 'content_type'}}, + 'content_encoding': {'key': '', 'type': 'str', 'xml': {'name': 'content_encoding'}}, + 'content_language': {'key': '', 'type': 'str', 'xml': {'name': 'content_language'}}, + 'content_disposition': {'key': '', 'type': 'str', 'xml': {'name': 'content_disposition'}}, + } + _xml_map = { + } + + def __init__(self, **kwargs): + super(DirectoryHttpHeaders, self).__init__(**kwargs) + self.cache_control = kwargs.get('cache_control', None) + self.content_type = kwargs.get('content_type', None) + self.content_encoding = kwargs.get('content_encoding', None) + self.content_language = kwargs.get('content_language', None) + self.content_disposition = kwargs.get('content_disposition', None) + + +class FilterBlobsItem(Model): + """FilterBlobsItem. + + :param name: + :type name: str + :param container_name: + :type container_name: str + :param tag_value: + :type tag_value: str + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str', 'xml': {'name': 'Name'}}, + 'container_name': {'key': 'ContainerName', 'type': 'str', 'xml': {'name': 'ContainerName'}}, + 'tag_value': {'key': 'TagValue', 'type': 'str', 'xml': {'name': 'TagValue'}}, + } + _xml_map = { + 'name': 'Blob' + } + + def __init__(self, **kwargs): + super(FilterBlobsItem, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.container_name = kwargs.get('container_name', None) + self.tag_value = kwargs.get('tag_value', None) + + +class FilterBlobsResponse(Model): + """An enumeration of blobs which matched the filter. + + All required parameters must be populated in order to send to Azure. + + :param service_endpoint: Required. + :type service_endpoint: str + :param filter: Required. + :type filter: str + :param marker: + :type marker: str + :param max_results: + :type max_results: int + :param segment: Required. + :type segment: ~azure.storage.blob.models.FilterBlobsSegment + :param next_marker: Required. + :type next_marker: str + """ + + _validation = { + 'service_endpoint': {'required': True}, + 'filter': {'required': True}, + 'segment': {'required': True}, + 'next_marker': {'required': True}, + } + + _attribute_map = { + 'service_endpoint': {'key': 'ServiceEndpoint', 'type': 'str', 'xml': {'name': 'ServiceEndpoint', 'attr': True}}, + 'filter': {'key': 'Filter', 'type': 'str', 'xml': {'name': 'Filter'}}, + 'marker': {'key': 'Marker', 'type': 'str', 'xml': {'name': 'Marker'}}, + 'max_results': {'key': 'MaxResults', 'type': 'int', 'xml': {'name': 'MaxResults'}}, + 'segment': {'key': 'Segment', 'type': 'FilterBlobsSegment', 'xml': {'name': 'Segment'}}, + 'next_marker': {'key': 'NextMarker', 'type': 'str', 'xml': {'name': 'NextMarker'}}, + } + _xml_map = { + 'name': 'EnumerationResults' + } + + def __init__(self, **kwargs): + super(FilterBlobsResponse, self).__init__(**kwargs) + self.service_endpoint = kwargs.get('service_endpoint', None) + self.filter = kwargs.get('filter', None) + self.marker = kwargs.get('marker', None) + self.max_results = kwargs.get('max_results', None) + self.segment = kwargs.get('segment', None) + self.next_marker = kwargs.get('next_marker', None) + + +class FilterBlobsSegment(Model): + """FilterBlobsSegment. + + :param blob_items: + :type blob_items: list[~azure.storage.blob.models.FilterBlobsItem] + """ + + _attribute_map = { + 'blob_items': {'key': 'BlobItems', 'type': '[FilterBlobsItem]', 'xml': {'name': 'BlobItems', 'itemsName': 'Blob'}}, + } + _xml_map = { + 'name': 'Blobs' + } + + def __init__(self, **kwargs): + super(FilterBlobsSegment, self).__init__(**kwargs) + self.blob_items = kwargs.get('blob_items', None) + + class GeoReplication(Model): """Geo-Replication information for the Secondary Storage Service. @@ -662,7 +931,7 @@ class GeoReplication(Model): :param status: Required. The status of the secondary location. Possible values include: 'live', 'bootstrap', 'unavailable' - :type status: str or ~blob.models.GeoReplicationStatusType + :type status: str or ~azure.storage.blob.models.GeoReplicationStatusType :param last_sync_time: Required. A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time @@ -688,6 +957,37 @@ def __init__(self, **kwargs): self.last_sync_time = kwargs.get('last_sync_time', None) +class KeyInfo(Model): + """Key information. + + All required parameters must be populated in order to send to Azure. + + :param start: Required. The date-time the key is active in ISO 8601 UTC + time + :type start: str + :param expiry: Required. The date-time the key expires in ISO 8601 UTC + time + :type expiry: str + """ + + _validation = { + 'start': {'required': True}, + 'expiry': {'required': True}, + } + + _attribute_map = { + 'start': {'key': 'Start', 'type': 'str', 'xml': {'name': 'Start'}}, + 'expiry': {'key': 'Expiry', 'type': 'str', 'xml': {'name': 'Expiry'}}, + } + _xml_map = { + } + + def __init__(self, **kwargs): + super(KeyInfo, self).__init__(**kwargs) + self.start = kwargs.get('start', None) + self.expiry = kwargs.get('expiry', None) + + class LeaseAccessConditions(Model): """Additional parameters for a set of operations. @@ -716,29 +1016,24 @@ class ListBlobsFlatSegmentResponse(Model): :type service_endpoint: str :param container_name: Required. :type container_name: str - :param prefix: Required. + :param prefix: :type prefix: str - :param marker: Required. + :param marker: :type marker: str - :param max_results: Required. + :param max_results: :type max_results: int - :param delimiter: Required. + :param delimiter: :type delimiter: str :param segment: Required. - :type segment: ~blob.models.BlobFlatListSegment - :param next_marker: Required. + :type segment: ~azure.storage.blob.models.BlobFlatListSegment + :param next_marker: :type next_marker: str """ _validation = { 'service_endpoint': {'required': True}, 'container_name': {'required': True}, - 'prefix': {'required': True}, - 'marker': {'required': True}, - 'max_results': {'required': True}, - 'delimiter': {'required': True}, 'segment': {'required': True}, - 'next_marker': {'required': True}, } _attribute_map = { @@ -776,29 +1071,24 @@ class ListBlobsHierarchySegmentResponse(Model): :type service_endpoint: str :param container_name: Required. :type container_name: str - :param prefix: Required. + :param prefix: :type prefix: str - :param marker: Required. + :param marker: :type marker: str - :param max_results: Required. + :param max_results: :type max_results: int - :param delimiter: Required. + :param delimiter: :type delimiter: str :param segment: Required. - :type segment: ~blob.models.BlobHierarchyListSegment - :param next_marker: Required. + :type segment: ~azure.storage.blob.models.BlobHierarchyListSegment + :param next_marker: :type next_marker: str """ _validation = { 'service_endpoint': {'required': True}, 'container_name': {'required': True}, - 'prefix': {'required': True}, - 'marker': {'required': True}, - 'max_results': {'required': True}, - 'delimiter': {'required': True}, 'segment': {'required': True}, - 'next_marker': {'required': True}, } _attribute_map = { @@ -834,24 +1124,21 @@ class ListContainersSegmentResponse(Model): :param service_endpoint: Required. :type service_endpoint: str - :param prefix: Required. + :param prefix: :type prefix: str :param marker: :type marker: str - :param max_results: Required. + :param max_results: :type max_results: int :param container_items: Required. - :type container_items: list[~blob.models.ContainerItem] - :param next_marker: Required. + :type container_items: list[~azure.storage.blob.models.ContainerItem] + :param next_marker: :type next_marker: str """ _validation = { 'service_endpoint': {'required': True}, - 'prefix': {'required': True}, - 'max_results': {'required': True}, 'container_items': {'required': True}, - 'next_marker': {'required': True}, } _attribute_map = { @@ -893,7 +1180,7 @@ class Logging(Model): logged. :type write: bool :param retention_policy: Required. - :type retention_policy: ~blob.models.RetentionPolicy + :type retention_policy: ~azure.storage.blob.models.RetentionPolicy """ _validation = { @@ -938,7 +1225,7 @@ class Metrics(Model): statistics for called API operations. :type include_apis: bool :param retention_policy: - :type retention_policy: ~blob.models.RetentionPolicy + :type retention_policy: ~azure.storage.blob.models.RetentionPolicy """ _validation = { @@ -1000,9 +1287,9 @@ class PageList(Model): """the list of pages. :param page_range: - :type page_range: list[~blob.models.PageRange] + :type page_range: list[~azure.storage.blob.models.PageRange] :param clear_range: - :type clear_range: list[~blob.models.ClearRange] + :type clear_range: list[~azure.storage.blob.models.ClearRange] """ _attribute_map = { @@ -1083,7 +1370,8 @@ def __init__(self, **kwargs): class SequenceNumberAccessConditions(Model): """Additional parameters for a set of operations, such as: - PageBlob_upload_pages, PageBlob_clear_pages. + PageBlob_upload_pages, PageBlob_clear_pages, + PageBlob_upload_pages_from_url. :param if_sequence_number_less_than_or_equal_to: Specify this header value to operate only on a blob if it has a sequence number less than or equal @@ -1119,13 +1407,12 @@ class SignedIdentifier(Model): :param id: Required. a unique id :type id: str - :param access_policy: Required. - :type access_policy: ~blob.models.AccessPolicy + :param access_policy: + :type access_policy: ~azure.storage.blob.models.AccessPolicy """ _validation = { 'id': {'required': True}, - 'access_policy': {'required': True}, } _attribute_map = { @@ -1133,6 +1420,7 @@ class SignedIdentifier(Model): 'access_policy': {'key': 'AccessPolicy', 'type': 'AccessPolicy', 'xml': {'name': 'AccessPolicy'}}, } _xml_map = { + 'name': 'SignedIdentifier' } def __init__(self, **kwargs): @@ -1142,7 +1430,7 @@ def __init__(self, **kwargs): class SourceModifiedAccessConditions(Model): - """Additional parameters for start_copy_from_url operation. + """Additional parameters for a set of operations. :param source_if_modified_since: Specify this header value to operate only on a blob if it has been modified since the specified date/time. @@ -1247,21 +1535,21 @@ class StorageServiceProperties(Model): """Storage Service Properties. :param logging: - :type logging: ~blob.models.Logging + :type logging: ~azure.storage.blob.models.Logging :param hour_metrics: - :type hour_metrics: ~blob.models.Metrics + :type hour_metrics: ~azure.storage.blob.models.Metrics :param minute_metrics: - :type minute_metrics: ~blob.models.Metrics + :type minute_metrics: ~azure.storage.blob.models.Metrics :param cors: The set of CORS rules. - :type cors: list[~blob.models.CorsRule] + :type cors: list[~azure.storage.blob.models.CorsRule] :param default_service_version: The default version to use for requests to the Blob service if an incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent versions :type default_service_version: str :param delete_retention_policy: - :type delete_retention_policy: ~blob.models.RetentionPolicy + :type delete_retention_policy: ~azure.storage.blob.models.RetentionPolicy :param static_website: - :type static_website: ~blob.models.StaticWebsite + :type static_website: ~azure.storage.blob.models.StaticWebsite """ _attribute_map = { @@ -1291,7 +1579,7 @@ class StorageServiceStats(Model): """Stats for the storage service. :param geo_replication: - :type geo_replication: ~blob.models.GeoReplication + :type geo_replication: ~azure.storage.blob.models.GeoReplication """ _attribute_map = { @@ -1303,3 +1591,89 @@ class StorageServiceStats(Model): def __init__(self, **kwargs): super(StorageServiceStats, self).__init__(**kwargs) self.geo_replication = kwargs.get('geo_replication', None) + + +class Tag(Model): + """Represents a single user-provided tag. + + All required parameters must be populated in order to send to Azure. + + :param key: Required. The tag name. + :type key: str + :param value: Required. The tag value. + :type value: str + """ + + _validation = { + 'key': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'Key', 'type': 'str', 'xml': {'name': 'Key'}}, + 'value': {'key': 'Value', 'type': 'str', 'xml': {'name': 'Value'}}, + } + _xml_map = { + } + + def __init__(self, **kwargs): + super(Tag, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.value = kwargs.get('value', None) + + +class UserDelegationKey(Model): + """A user delegation key. + + All required parameters must be populated in order to send to Azure. + + :param signed_oid: Required. The Azure Active Directory object ID in GUID + format. + :type signed_oid: str + :param signed_tid: Required. The Azure Active Directory tenant ID in GUID + format + :type signed_tid: str + :param signed_start: Required. The date-time the key is active + :type signed_start: datetime + :param signed_expiry: Required. The date-time the key expires + :type signed_expiry: datetime + :param signed_service: Required. Abbreviation of the Azure Storage service + that accepts the key + :type signed_service: str + :param signed_version: Required. The service version that created the key + :type signed_version: str + :param value: Required. The key as a base64 string + :type value: str + """ + + _validation = { + 'signed_oid': {'required': True}, + 'signed_tid': {'required': True}, + 'signed_start': {'required': True}, + 'signed_expiry': {'required': True}, + 'signed_service': {'required': True}, + 'signed_version': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'signed_oid': {'key': 'SignedOid', 'type': 'str', 'xml': {'name': 'SignedOid'}}, + 'signed_tid': {'key': 'SignedTid', 'type': 'str', 'xml': {'name': 'SignedTid'}}, + 'signed_start': {'key': 'SignedStart', 'type': 'iso-8601', 'xml': {'name': 'SignedStart'}}, + 'signed_expiry': {'key': 'SignedExpiry', 'type': 'iso-8601', 'xml': {'name': 'SignedExpiry'}}, + 'signed_service': {'key': 'SignedService', 'type': 'str', 'xml': {'name': 'SignedService'}}, + 'signed_version': {'key': 'SignedVersion', 'type': 'str', 'xml': {'name': 'SignedVersion'}}, + 'value': {'key': 'Value', 'type': 'str', 'xml': {'name': 'Value'}}, + } + _xml_map = { + } + + def __init__(self, **kwargs): + super(UserDelegationKey, self).__init__(**kwargs) + self.signed_oid = kwargs.get('signed_oid', None) + self.signed_tid = kwargs.get('signed_tid', None) + self.signed_start = kwargs.get('signed_start', None) + self.signed_expiry = kwargs.get('signed_expiry', None) + self.signed_service = kwargs.get('signed_service', None) + self.signed_version = kwargs.get('signed_version', None) + self.value = kwargs.get('value', None) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py index 091fb7ec8e1e..cdfb367872c2 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/models/_models_py3.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from msrest.serialization import Model from azure.core import HttpResponseError @@ -20,11 +19,9 @@ class AccessPolicy(Model): All required parameters must be populated in order to send to Azure. :param start: Required. the date-time the policy is active - The date should be exactly in this 019-05-23T21:21:28Z format - :type start: datetime + :type start: str :param expiry: Required. the date-time the policy expires - The date should be exactly in this 019-05-23T21:21:28Z format - :type expiry: datetime + :type expiry: str :param permission: Required. the permissions for the acl policy :type permission: str """ @@ -43,7 +40,7 @@ class AccessPolicy(Model): _xml_map = { } - def __init__(self, *, start, expiry, permission: str, **kwargs) -> None: + def __init__(self, *, start: str, expiry: str, permission: str, **kwargs) -> None: super(AccessPolicy, self).__init__(**kwargs) self.start = start self.expiry = expiry @@ -51,7 +48,8 @@ def __init__(self, *, start, expiry, permission: str, **kwargs) -> None: class AppendPositionAccessConditions(Model): - """Additional parameters for append_block operation. + """Additional parameters for a set of operations, such as: + AppendBlob_append_block, AppendBlob_append_block_from_url. :param max_size: Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause @@ -88,7 +86,7 @@ class BlobFlatListSegment(Model): All required parameters must be populated in order to send to Azure. :param blob_items: Required. - :type blob_items: list[~blob.models.BlobItem] + :type blob_items: list[~azure.storage.blob.models.BlobItem] """ _validation = { @@ -113,9 +111,9 @@ class BlobHierarchyListSegment(Model): All required parameters must be populated in order to send to Azure. :param blob_prefixes: - :type blob_prefixes: list[~blob.models.BlobPrefix] + :type blob_prefixes: list[~azure.storage.blob.models.BlobPrefix] :param blob_items: Required. - :type blob_items: list[~blob.models.BlobItem] + :type blob_items: list[~azure.storage.blob.models.BlobItem] """ _validation = { @@ -196,16 +194,21 @@ class BlobItem(Model): :type deleted: bool :param snapshot: Required. :type snapshot: str + :param version_id: Required. + :type version_id: str :param properties: Required. - :type properties: ~blob.models.BlobProperties + :type properties: ~azure.storage.blob.models.BlobProperties :param metadata: - :type metadata: dict[str, str] + :type metadata: ~azure.storage.blob.models.BlobMetadata + :param tags: + :type tags: ~azure.storage.blob.models.BlobTags """ _validation = { 'name': {'required': True}, 'deleted': {'required': True}, 'snapshot': {'required': True}, + 'version_id': {'required': True}, 'properties': {'required': True}, } @@ -213,20 +216,48 @@ class BlobItem(Model): 'name': {'key': 'Name', 'type': 'str', 'xml': {'name': 'Name'}}, 'deleted': {'key': 'Deleted', 'type': 'bool', 'xml': {'name': 'Deleted'}}, 'snapshot': {'key': 'Snapshot', 'type': 'str', 'xml': {'name': 'Snapshot'}}, + 'version_id': {'key': 'VersionId', 'type': 'str', 'xml': {'name': 'VersionId'}}, 'properties': {'key': 'Properties', 'type': 'BlobProperties', 'xml': {'name': 'Properties'}}, - 'metadata': {'key': 'Metadata', 'type': '{str}', 'xml': {'name': 'Metadata'}}, + 'metadata': {'key': 'Metadata', 'type': 'BlobMetadata', 'xml': {'name': 'Metadata'}}, + 'tags': {'key': 'Tags', 'type': 'BlobTags', 'xml': {'name': 'Tags'}}, } _xml_map = { 'name': 'Blob' } - def __init__(self, *, name: str, deleted: bool, snapshot: str, properties, metadata=None, **kwargs) -> None: + def __init__(self, *, name: str, deleted: bool, snapshot: str, version_id: str, properties, metadata=None, tags=None, **kwargs) -> None: super(BlobItem, self).__init__(**kwargs) self.name = name self.deleted = deleted self.snapshot = snapshot + self.version_id = version_id self.properties = properties self.metadata = metadata + self.tags = tags + + +class BlobMetadata(Model): + """BlobMetadata. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, str] + :param encrypted: + :type encrypted: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{str}', 'xml': {'name': 'additional_properties'}}, + 'encrypted': {'key': 'Encrypted', 'type': 'str', 'xml': {'name': 'Encrypted', 'attr': True}}, + } + _xml_map = { + 'name': 'Metadata' + } + + def __init__(self, *, additional_properties=None, encrypted: str=None, **kwargs) -> None: + super(BlobMetadata, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.encrypted = encrypted class BlobPrefix(Model): @@ -282,19 +313,19 @@ class BlobProperties(Model): :type blob_sequence_number: long :param blob_type: Possible values include: 'BlockBlob', 'PageBlob', 'AppendBlob' - :type blob_type: str or ~blob.models.BlobType + :type blob_type: str or ~azure.storage.blob.models.BlobType :param lease_status: Possible values include: 'locked', 'unlocked' - :type lease_status: str or ~blob.models.LeaseStatusType + :type lease_status: str or ~azure.storage.blob.models.LeaseStatusType :param lease_state: Possible values include: 'available', 'leased', 'expired', 'breaking', 'broken' - :type lease_state: str or ~blob.models.LeaseStateType + :type lease_state: str or ~azure.storage.blob.models.LeaseStateType :param lease_duration: Possible values include: 'infinite', 'fixed' - :type lease_duration: str or ~blob.models.LeaseDurationType + :type lease_duration: str or ~azure.storage.blob.models.LeaseDurationType :param copy_id: :type copy_id: str :param copy_status: Possible values include: 'pending', 'success', 'aborted', 'failed' - :type copy_status: str or ~blob.models.CopyStatusType + :type copy_status: str or ~azure.storage.blob.models.CopyStatusType :param copy_source: :type copy_source: str :param copy_progress: @@ -315,19 +346,26 @@ class BlobProperties(Model): :type remaining_retention_days: int :param access_tier: Possible values include: 'P4', 'P6', 'P10', 'P20', 'P30', 'P40', 'P50', 'Hot', 'Cool', 'Archive' - :type access_tier: str or ~blob.models.AccessTier + :type access_tier: str or ~azure.storage.blob.models.AccessTier :param access_tier_inferred: :type access_tier_inferred: bool :param archive_status: Possible values include: 'rehydrate-pending-to-hot', 'rehydrate-pending-to-cool' - :type archive_status: str or ~blob.models.ArchiveStatus + :type archive_status: str or ~azure.storage.blob.models.ArchiveStatus + :param customer_provided_key_sha256: + :type customer_provided_key_sha256: str + :param encryption_scope: + :type encryption_scope: str :param access_tier_change_time: :type access_tier_change_time: datetime + :param tag_count: Required. The number of tags corresponding to the blob. + :type tag_count: int """ _validation = { 'last_modified': {'required': True}, 'etag': {'required': True}, + 'tag_count': {'required': True}, } _attribute_map = { @@ -360,13 +398,16 @@ class BlobProperties(Model): 'access_tier': {'key': 'AccessTier', 'type': 'str', 'xml': {'name': 'AccessTier'}}, 'access_tier_inferred': {'key': 'AccessTierInferred', 'type': 'bool', 'xml': {'name': 'AccessTierInferred'}}, 'archive_status': {'key': 'ArchiveStatus', 'type': 'str', 'xml': {'name': 'ArchiveStatus'}}, + 'customer_provided_key_sha256': {'key': 'CustomerProvidedKeySha256', 'type': 'str', 'xml': {'name': 'CustomerProvidedKeySha256'}}, + 'encryption_scope': {'key': 'EncryptionScope', 'type': 'str', 'xml': {'name': 'EncryptionScope'}}, 'access_tier_change_time': {'key': 'AccessTierChangeTime', 'type': 'rfc-1123', 'xml': {'name': 'AccessTierChangeTime'}}, + 'tag_count': {'key': 'TagCount', 'type': 'int', 'xml': {'name': 'TagCount'}}, } _xml_map = { 'name': 'Properties' } - def __init__(self, *, last_modified, etag: str, creation_time=None, content_length: int=None, content_type: str=None, content_encoding: str=None, content_language: str=None, content_md5: bytearray=None, content_disposition: str=None, cache_control: str=None, blob_sequence_number: int=None, blob_type=None, lease_status=None, lease_state=None, lease_duration=None, copy_id: str=None, copy_status=None, copy_source: str=None, copy_progress: str=None, copy_completion_time=None, copy_status_description: str=None, server_encrypted: bool=None, incremental_copy: bool=None, destination_snapshot: str=None, deleted_time=None, remaining_retention_days: int=None, access_tier=None, access_tier_inferred: bool=None, archive_status=None, access_tier_change_time=None, **kwargs) -> None: + def __init__(self, *, last_modified, etag: str, tag_count: int, creation_time=None, content_length: int=None, content_type: str=None, content_encoding: str=None, content_language: str=None, content_md5: bytearray=None, content_disposition: str=None, cache_control: str=None, blob_sequence_number: int=None, blob_type=None, lease_status=None, lease_state=None, lease_duration=None, copy_id: str=None, copy_status=None, copy_source: str=None, copy_progress: str=None, copy_completion_time=None, copy_status_description: str=None, server_encrypted: bool=None, incremental_copy: bool=None, destination_snapshot: str=None, deleted_time=None, remaining_retention_days: int=None, access_tier=None, access_tier_inferred: bool=None, archive_status=None, customer_provided_key_sha256: str=None, encryption_scope: str=None, access_tier_change_time=None, **kwargs) -> None: super(BlobProperties, self).__init__(**kwargs) self.creation_time = creation_time self.last_modified = last_modified @@ -397,7 +438,29 @@ def __init__(self, *, last_modified, etag: str, creation_time=None, content_leng self.access_tier = access_tier self.access_tier_inferred = access_tier_inferred self.archive_status = archive_status + self.customer_provided_key_sha256 = customer_provided_key_sha256 + self.encryption_scope = encryption_scope self.access_tier_change_time = access_tier_change_time + self.tag_count = tag_count + + +class BlobTags(Model): + """XML containing key/value pairs representing the tags for the blob. + + :param tag_set: + :type tag_set: list[~azure.storage.blob.models.Tag] + """ + + _attribute_map = { + 'tag_set': {'key': 'TagSet', 'type': '[Tag]', 'xml': {'name': 'TagSet', 'itemsName': 'Tag', 'wrapped': True}}, + } + _xml_map = { + 'name': 'Tags' + } + + def __init__(self, *, tag_set=None, **kwargs) -> None: + super(BlobTags, self).__init__(**kwargs) + self.tag_set = tag_set class Block(Model): @@ -434,9 +497,9 @@ class BlockList(Model): """BlockList. :param committed_blocks: - :type committed_blocks: list[~blob.models.Block] + :type committed_blocks: list[~azure.storage.blob.models.Block] :param uncommitted_blocks: - :type uncommitted_blocks: list[~blob.models.Block] + :type uncommitted_blocks: list[~azure.storage.blob.models.Block] """ _attribute_map = { @@ -517,7 +580,7 @@ class ContainerItem(Model): :param name: Required. :type name: str :param properties: Required. - :type properties: ~blob.models.ContainerProperties + :type properties: ~azure.storage.blob.models.ContainerProperties :param metadata: :type metadata: dict[str, str] """ @@ -553,14 +616,14 @@ class ContainerProperties(Model): :param etag: Required. :type etag: str :param lease_status: Possible values include: 'locked', 'unlocked' - :type lease_status: str or ~blob.models.LeaseStatusType + :type lease_status: str or ~azure.storage.blob.models.LeaseStatusType :param lease_state: Possible values include: 'available', 'leased', 'expired', 'breaking', 'broken' - :type lease_state: str or ~blob.models.LeaseStateType + :type lease_state: str or ~azure.storage.blob.models.LeaseStateType :param lease_duration: Possible values include: 'infinite', 'fixed' - :type lease_duration: str or ~blob.models.LeaseDurationType + :type lease_duration: str or ~azure.storage.blob.models.LeaseDurationType :param public_access: Possible values include: 'container', 'blob' - :type public_access: str or ~blob.models.PublicAccessType + :type public_access: str or ~azure.storage.blob.models.PublicAccessType :param has_immutability_policy: :type has_immutability_policy: bool :param has_legal_hold: @@ -655,6 +718,212 @@ def __init__(self, *, allowed_origins: str, allowed_methods: str, allowed_header self.max_age_in_seconds = max_age_in_seconds +class CustomerProvidedKeyInfo(Model): + """Additional parameters for a set of operations. + + :param encryption_scope: Optional. Specifies the encryption scope to use + to encrypt the data provided in the request. If not specified, encryption + is performed with the root account encryption key. For more information, + see Encryption at Rest for Azure Storage Services. + :type encryption_scope: str + """ + + _attribute_map = { + 'encryption_scope': {'key': '', 'type': 'str', 'xml': {'name': 'encryption_scope'}}, + } + _xml_map = { + } + + def __init__(self, *, encryption_scope: str=None, **kwargs) -> None: + super(CustomerProvidedKeyInfo, self).__init__(**kwargs) + self.encryption_scope = encryption_scope + + +class DataLakeStorageError(Model): + """DataLakeStorageError. + + :param error: The service error response object. + :type error: ~azure.storage.blob.models.DataLakeStorageErrorError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'DataLakeStorageErrorError', 'xml': {'name': 'error'}}, + } + _xml_map = { + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(DataLakeStorageError, self).__init__(**kwargs) + self.error = error + + +class DataLakeStorageErrorException(HttpResponseError): + """Server responsed with exception of type: 'DataLakeStorageError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, response, deserialize, *args): + + model_name = 'DataLakeStorageError' + self.error = deserialize(model_name, response) + if self.error is None: + self.error = deserialize.dependencies[model_name]() + super(DataLakeStorageErrorException, self).__init__(response=response) + + +class DataLakeStorageErrorError(Model): + """The service error response object. + + :param code: The service error code. + :type code: str + :param message: The service error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str', 'xml': {'name': 'code'}}, + 'message': {'key': 'message', 'type': 'str', 'xml': {'name': 'message'}}, + } + _xml_map = { + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(DataLakeStorageErrorError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class DirectoryHttpHeaders(Model): + """Additional parameters for a set of operations, such as: Directory_create, + Directory_rename, Blob_rename. + + :param cache_control: Cache control for given resource + :type cache_control: str + :param content_type: Content type for given resource + :type content_type: str + :param content_encoding: Content encoding for given resource + :type content_encoding: str + :param content_language: Content language for given resource + :type content_language: str + :param content_disposition: Content disposition for given resource + :type content_disposition: str + """ + + _attribute_map = { + 'cache_control': {'key': '', 'type': 'str', 'xml': {'name': 'cache_control'}}, + 'content_type': {'key': '', 'type': 'str', 'xml': {'name': 'content_type'}}, + 'content_encoding': {'key': '', 'type': 'str', 'xml': {'name': 'content_encoding'}}, + 'content_language': {'key': '', 'type': 'str', 'xml': {'name': 'content_language'}}, + 'content_disposition': {'key': '', 'type': 'str', 'xml': {'name': 'content_disposition'}}, + } + _xml_map = { + } + + def __init__(self, *, cache_control: str=None, content_type: str=None, content_encoding: str=None, content_language: str=None, content_disposition: str=None, **kwargs) -> None: + super(DirectoryHttpHeaders, self).__init__(**kwargs) + self.cache_control = cache_control + self.content_type = content_type + self.content_encoding = content_encoding + self.content_language = content_language + self.content_disposition = content_disposition + + +class FilterBlobsItem(Model): + """FilterBlobsItem. + + :param name: + :type name: str + :param container_name: + :type container_name: str + :param tag_value: + :type tag_value: str + """ + + _attribute_map = { + 'name': {'key': 'Name', 'type': 'str', 'xml': {'name': 'Name'}}, + 'container_name': {'key': 'ContainerName', 'type': 'str', 'xml': {'name': 'ContainerName'}}, + 'tag_value': {'key': 'TagValue', 'type': 'str', 'xml': {'name': 'TagValue'}}, + } + _xml_map = { + 'name': 'Blob' + } + + def __init__(self, *, name: str=None, container_name: str=None, tag_value: str=None, **kwargs) -> None: + super(FilterBlobsItem, self).__init__(**kwargs) + self.name = name + self.container_name = container_name + self.tag_value = tag_value + + +class FilterBlobsResponse(Model): + """An enumeration of blobs which matched the filter. + + All required parameters must be populated in order to send to Azure. + + :param service_endpoint: Required. + :type service_endpoint: str + :param filter: Required. + :type filter: str + :param marker: + :type marker: str + :param max_results: + :type max_results: int + :param segment: Required. + :type segment: ~azure.storage.blob.models.FilterBlobsSegment + :param next_marker: Required. + :type next_marker: str + """ + + _validation = { + 'service_endpoint': {'required': True}, + 'filter': {'required': True}, + 'segment': {'required': True}, + 'next_marker': {'required': True}, + } + + _attribute_map = { + 'service_endpoint': {'key': 'ServiceEndpoint', 'type': 'str', 'xml': {'name': 'ServiceEndpoint', 'attr': True}}, + 'filter': {'key': 'Filter', 'type': 'str', 'xml': {'name': 'Filter'}}, + 'marker': {'key': 'Marker', 'type': 'str', 'xml': {'name': 'Marker'}}, + 'max_results': {'key': 'MaxResults', 'type': 'int', 'xml': {'name': 'MaxResults'}}, + 'segment': {'key': 'Segment', 'type': 'FilterBlobsSegment', 'xml': {'name': 'Segment'}}, + 'next_marker': {'key': 'NextMarker', 'type': 'str', 'xml': {'name': 'NextMarker'}}, + } + _xml_map = { + 'name': 'EnumerationResults' + } + + def __init__(self, *, service_endpoint: str, filter: str, segment, next_marker: str, marker: str=None, max_results: int=None, **kwargs) -> None: + super(FilterBlobsResponse, self).__init__(**kwargs) + self.service_endpoint = service_endpoint + self.filter = filter + self.marker = marker + self.max_results = max_results + self.segment = segment + self.next_marker = next_marker + + +class FilterBlobsSegment(Model): + """FilterBlobsSegment. + + :param blob_items: + :type blob_items: list[~azure.storage.blob.models.FilterBlobsItem] + """ + + _attribute_map = { + 'blob_items': {'key': 'BlobItems', 'type': '[FilterBlobsItem]', 'xml': {'name': 'BlobItems', 'itemsName': 'Blob'}}, + } + _xml_map = { + 'name': 'Blobs' + } + + def __init__(self, *, blob_items=None, **kwargs) -> None: + super(FilterBlobsSegment, self).__init__(**kwargs) + self.blob_items = blob_items + + class GeoReplication(Model): """Geo-Replication information for the Secondary Storage Service. @@ -662,7 +931,7 @@ class GeoReplication(Model): :param status: Required. The status of the secondary location. Possible values include: 'live', 'bootstrap', 'unavailable' - :type status: str or ~blob.models.GeoReplicationStatusType + :type status: str or ~azure.storage.blob.models.GeoReplicationStatusType :param last_sync_time: Required. A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time @@ -688,6 +957,37 @@ def __init__(self, *, status, last_sync_time, **kwargs) -> None: self.last_sync_time = last_sync_time +class KeyInfo(Model): + """Key information. + + All required parameters must be populated in order to send to Azure. + + :param start: Required. The date-time the key is active in ISO 8601 UTC + time + :type start: str + :param expiry: Required. The date-time the key expires in ISO 8601 UTC + time + :type expiry: str + """ + + _validation = { + 'start': {'required': True}, + 'expiry': {'required': True}, + } + + _attribute_map = { + 'start': {'key': 'Start', 'type': 'str', 'xml': {'name': 'Start'}}, + 'expiry': {'key': 'Expiry', 'type': 'str', 'xml': {'name': 'Expiry'}}, + } + _xml_map = { + } + + def __init__(self, *, start: str, expiry: str, **kwargs) -> None: + super(KeyInfo, self).__init__(**kwargs) + self.start = start + self.expiry = expiry + + class LeaseAccessConditions(Model): """Additional parameters for a set of operations. @@ -716,29 +1016,24 @@ class ListBlobsFlatSegmentResponse(Model): :type service_endpoint: str :param container_name: Required. :type container_name: str - :param prefix: Required. + :param prefix: :type prefix: str - :param marker: Required. + :param marker: :type marker: str - :param max_results: Required. + :param max_results: :type max_results: int - :param delimiter: Required. + :param delimiter: :type delimiter: str :param segment: Required. - :type segment: ~blob.models.BlobFlatListSegment - :param next_marker: Required. + :type segment: ~azure.storage.blob.models.BlobFlatListSegment + :param next_marker: :type next_marker: str """ _validation = { 'service_endpoint': {'required': True}, 'container_name': {'required': True}, - 'prefix': {'required': True}, - 'marker': {'required': True}, - 'max_results': {'required': True}, - 'delimiter': {'required': True}, 'segment': {'required': True}, - 'next_marker': {'required': True}, } _attribute_map = { @@ -755,7 +1050,7 @@ class ListBlobsFlatSegmentResponse(Model): 'name': 'EnumerationResults' } - def __init__(self, *, service_endpoint: str, container_name: str, prefix: str, marker: str, max_results: int, delimiter: str, segment, next_marker: str, **kwargs) -> None: + def __init__(self, *, service_endpoint: str, container_name: str, segment, prefix: str=None, marker: str=None, max_results: int=None, delimiter: str=None, next_marker: str=None, **kwargs) -> None: super(ListBlobsFlatSegmentResponse, self).__init__(**kwargs) self.service_endpoint = service_endpoint self.container_name = container_name @@ -776,29 +1071,24 @@ class ListBlobsHierarchySegmentResponse(Model): :type service_endpoint: str :param container_name: Required. :type container_name: str - :param prefix: Required. + :param prefix: :type prefix: str - :param marker: Required. + :param marker: :type marker: str - :param max_results: Required. + :param max_results: :type max_results: int - :param delimiter: Required. + :param delimiter: :type delimiter: str :param segment: Required. - :type segment: ~blob.models.BlobHierarchyListSegment - :param next_marker: Required. + :type segment: ~azure.storage.blob.models.BlobHierarchyListSegment + :param next_marker: :type next_marker: str """ _validation = { 'service_endpoint': {'required': True}, 'container_name': {'required': True}, - 'prefix': {'required': True}, - 'marker': {'required': True}, - 'max_results': {'required': True}, - 'delimiter': {'required': True}, 'segment': {'required': True}, - 'next_marker': {'required': True}, } _attribute_map = { @@ -815,7 +1105,7 @@ class ListBlobsHierarchySegmentResponse(Model): 'name': 'EnumerationResults' } - def __init__(self, *, service_endpoint: str, container_name: str, prefix: str, marker: str, max_results: int, delimiter: str, segment, next_marker: str, **kwargs) -> None: + def __init__(self, *, service_endpoint: str, container_name: str, segment, prefix: str=None, marker: str=None, max_results: int=None, delimiter: str=None, next_marker: str=None, **kwargs) -> None: super(ListBlobsHierarchySegmentResponse, self).__init__(**kwargs) self.service_endpoint = service_endpoint self.container_name = container_name @@ -834,24 +1124,21 @@ class ListContainersSegmentResponse(Model): :param service_endpoint: Required. :type service_endpoint: str - :param prefix: Required. + :param prefix: :type prefix: str :param marker: :type marker: str - :param max_results: Required. + :param max_results: :type max_results: int :param container_items: Required. - :type container_items: list[~blob.models.ContainerItem] - :param next_marker: Required. + :type container_items: list[~azure.storage.blob.models.ContainerItem] + :param next_marker: :type next_marker: str """ _validation = { 'service_endpoint': {'required': True}, - 'prefix': {'required': True}, - 'max_results': {'required': True}, 'container_items': {'required': True}, - 'next_marker': {'required': True}, } _attribute_map = { @@ -866,7 +1153,7 @@ class ListContainersSegmentResponse(Model): 'name': 'EnumerationResults' } - def __init__(self, *, service_endpoint: str, prefix: str, max_results: int, container_items, next_marker: str, marker: str=None, **kwargs) -> None: + def __init__(self, *, service_endpoint: str, container_items, prefix: str=None, marker: str=None, max_results: int=None, next_marker: str=None, **kwargs) -> None: super(ListContainersSegmentResponse, self).__init__(**kwargs) self.service_endpoint = service_endpoint self.prefix = prefix @@ -893,7 +1180,7 @@ class Logging(Model): logged. :type write: bool :param retention_policy: Required. - :type retention_policy: ~blob.models.RetentionPolicy + :type retention_policy: ~azure.storage.blob.models.RetentionPolicy """ _validation = { @@ -938,7 +1225,7 @@ class Metrics(Model): statistics for called API operations. :type include_apis: bool :param retention_policy: - :type retention_policy: ~blob.models.RetentionPolicy + :type retention_policy: ~azure.storage.blob.models.RetentionPolicy """ _validation = { @@ -1000,9 +1287,9 @@ class PageList(Model): """the list of pages. :param page_range: - :type page_range: list[~blob.models.PageRange] + :type page_range: list[~azure.storage.blob.models.PageRange] :param clear_range: - :type clear_range: list[~blob.models.ClearRange] + :type clear_range: list[~azure.storage.blob.models.ClearRange] """ _attribute_map = { @@ -1083,7 +1370,8 @@ def __init__(self, *, enabled: bool, days: int=None, **kwargs) -> None: class SequenceNumberAccessConditions(Model): """Additional parameters for a set of operations, such as: - PageBlob_upload_pages, PageBlob_clear_pages. + PageBlob_upload_pages, PageBlob_clear_pages, + PageBlob_upload_pages_from_url. :param if_sequence_number_less_than_or_equal_to: Specify this header value to operate only on a blob if it has a sequence number less than or equal @@ -1119,13 +1407,12 @@ class SignedIdentifier(Model): :param id: Required. a unique id :type id: str - :param access_policy: Required. - :type access_policy: ~blob.models.AccessPolicy + :param access_policy: + :type access_policy: ~azure.storage.blob.models.AccessPolicy """ _validation = { 'id': {'required': True}, - 'access_policy': {'required': True}, } _attribute_map = { @@ -1133,16 +1420,17 @@ class SignedIdentifier(Model): 'access_policy': {'key': 'AccessPolicy', 'type': 'AccessPolicy', 'xml': {'name': 'AccessPolicy'}}, } _xml_map = { + 'name': 'SignedIdentifier' } - def __init__(self, *, id: str, access_policy, **kwargs) -> None: + def __init__(self, *, id: str, access_policy=None, **kwargs) -> None: super(SignedIdentifier, self).__init__(**kwargs) self.id = id self.access_policy = access_policy class SourceModifiedAccessConditions(Model): - """Additional parameters for start_copy_from_url operation. + """Additional parameters for a set of operations. :param source_if_modified_since: Specify this header value to operate only on a blob if it has been modified since the specified date/time. @@ -1247,21 +1535,21 @@ class StorageServiceProperties(Model): """Storage Service Properties. :param logging: - :type logging: ~blob.models.Logging + :type logging: ~azure.storage.blob.models.Logging :param hour_metrics: - :type hour_metrics: ~blob.models.Metrics + :type hour_metrics: ~azure.storage.blob.models.Metrics :param minute_metrics: - :type minute_metrics: ~blob.models.Metrics + :type minute_metrics: ~azure.storage.blob.models.Metrics :param cors: The set of CORS rules. - :type cors: list[~blob.models.CorsRule] + :type cors: list[~azure.storage.blob.models.CorsRule] :param default_service_version: The default version to use for requests to the Blob service if an incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent versions :type default_service_version: str :param delete_retention_policy: - :type delete_retention_policy: ~blob.models.RetentionPolicy + :type delete_retention_policy: ~azure.storage.blob.models.RetentionPolicy :param static_website: - :type static_website: ~blob.models.StaticWebsite + :type static_website: ~azure.storage.blob.models.StaticWebsite """ _attribute_map = { @@ -1291,7 +1579,7 @@ class StorageServiceStats(Model): """Stats for the storage service. :param geo_replication: - :type geo_replication: ~blob.models.GeoReplication + :type geo_replication: ~azure.storage.blob.models.GeoReplication """ _attribute_map = { @@ -1303,3 +1591,89 @@ class StorageServiceStats(Model): def __init__(self, *, geo_replication=None, **kwargs) -> None: super(StorageServiceStats, self).__init__(**kwargs) self.geo_replication = geo_replication + + +class Tag(Model): + """Represents a single user-provided tag. + + All required parameters must be populated in order to send to Azure. + + :param key: Required. The tag name. + :type key: str + :param value: Required. The tag value. + :type value: str + """ + + _validation = { + 'key': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'Key', 'type': 'str', 'xml': {'name': 'Key'}}, + 'value': {'key': 'Value', 'type': 'str', 'xml': {'name': 'Value'}}, + } + _xml_map = { + } + + def __init__(self, *, key: str, value: str, **kwargs) -> None: + super(Tag, self).__init__(**kwargs) + self.key = key + self.value = value + + +class UserDelegationKey(Model): + """A user delegation key. + + All required parameters must be populated in order to send to Azure. + + :param signed_oid: Required. The Azure Active Directory object ID in GUID + format. + :type signed_oid: str + :param signed_tid: Required. The Azure Active Directory tenant ID in GUID + format + :type signed_tid: str + :param signed_start: Required. The date-time the key is active + :type signed_start: datetime + :param signed_expiry: Required. The date-time the key expires + :type signed_expiry: datetime + :param signed_service: Required. Abbreviation of the Azure Storage service + that accepts the key + :type signed_service: str + :param signed_version: Required. The service version that created the key + :type signed_version: str + :param value: Required. The key as a base64 string + :type value: str + """ + + _validation = { + 'signed_oid': {'required': True}, + 'signed_tid': {'required': True}, + 'signed_start': {'required': True}, + 'signed_expiry': {'required': True}, + 'signed_service': {'required': True}, + 'signed_version': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'signed_oid': {'key': 'SignedOid', 'type': 'str', 'xml': {'name': 'SignedOid'}}, + 'signed_tid': {'key': 'SignedTid', 'type': 'str', 'xml': {'name': 'SignedTid'}}, + 'signed_start': {'key': 'SignedStart', 'type': 'iso-8601', 'xml': {'name': 'SignedStart'}}, + 'signed_expiry': {'key': 'SignedExpiry', 'type': 'iso-8601', 'xml': {'name': 'SignedExpiry'}}, + 'signed_service': {'key': 'SignedService', 'type': 'str', 'xml': {'name': 'SignedService'}}, + 'signed_version': {'key': 'SignedVersion', 'type': 'str', 'xml': {'name': 'SignedVersion'}}, + 'value': {'key': 'Value', 'type': 'str', 'xml': {'name': 'Value'}}, + } + _xml_map = { + } + + def __init__(self, *, signed_oid: str, signed_tid: str, signed_start, signed_expiry, signed_service: str, signed_version: str, value: str, **kwargs) -> None: + super(UserDelegationKey, self).__init__(**kwargs) + self.signed_oid = signed_oid + self.signed_tid = signed_tid + self.signed_start = signed_start + self.signed_expiry = signed_expiry + self.signed_service = signed_service + self.signed_version = signed_version + self.value = value diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/__init__.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/__init__.py index 2cfa9f90e806..1ea045334401 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/__init__.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/__init__.py @@ -8,10 +8,10 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from ._service_operations import ServiceOperations from ._container_operations import ContainerOperations +from ._directory_operations import DirectoryOperations from ._blob_operations import BlobOperations from ._page_blob_operations import PageBlobOperations from ._append_blob_operations import AppendBlobOperations @@ -20,6 +20,7 @@ __all__ = [ 'ServiceOperations', 'ContainerOperations', + 'DirectoryOperations', 'BlobOperations', 'PageBlobOperations', 'AppendBlobOperations', diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_append_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_append_blob_operations.py index 483c00b58976..2b2750d677f3 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_append_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_append_blob_operations.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -40,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self.x_ms_blob_type = "AppendBlob" self.comp = "appendblock" - def create(self, content_length, timeout=None, metadata=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def create(self, content_length, timeout=None, metadata=None, tags=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, cls=None, **kwargs): """The Create Append Blob operation creates a new append blob. :param content_length: The length of the request. @@ -60,25 +59,50 @@ def create(self, content_length, timeout=None, metadata=None, request_id=None, b C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_content_type = None @@ -102,6 +126,9 @@ def create(self, content_length, timeout=None, metadata=None, request_id=None, b lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -126,12 +153,22 @@ def create(self, content_length, timeout=None, metadata=None, request_id=None, b query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -173,16 +210,20 @@ def create(self, content_length, timeout=None, metadata=None, request_id=None, b 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) create.metadata = {'url': '/{containerName}/{blob}'} - def append_block(self, body, content_length, timeout=None, transactional_content_md5=None, request_id=None, lease_access_conditions=None, append_position_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def append_block(self, body, content_length, timeout=None, transactional_content_md5=None, transactional_content_crc64=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, append_position_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, cls=None, **kwargs): """The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append @@ -200,27 +241,50 @@ def append_block(self, body, content_length, timeout=None, transactional_content :param transactional_content_md5: Specify the transactional md5 for the body, to be validated by the service. :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param append_position_access_conditions: Additional parameters for the operation :type append_position_access_conditions: - ~blob.models.AppendPositionAccessConditions + ~azure.storage.blob.models.AppendPositionAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -232,6 +296,9 @@ def append_block(self, body, content_length, timeout=None, transactional_content append_position = None if append_position_access_conditions is not None: append_position = append_position_access_conditions.append_position + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -256,14 +323,24 @@ def append_block(self, body, content_length, timeout=None, transactional_content query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("self.comp", self.comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/octet-stream' + header_parameters['Content-Type'] = 'application/xml; charset=utf-8' header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if transactional_content_md5 is not None: header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -298,12 +375,182 @@ def append_block(self, body, content_length, timeout=None, transactional_content 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-blob-append-offset': self._deserialize('str', response.headers.get('x-ms-blob-append-offset')), 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), + 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) append_block.metadata = {'url': '/{containerName}/{blob}'} + + def append_block_from_url(self, source_url, content_length, source_range=None, source_content_md5=None, source_contentcrc64=None, timeout=None, transactional_content_md5=None, request_id=None, lease_access_conditions=None, append_position_access_conditions=None, modified_access_conditions=None, source_modified_access_conditions=None, cls=None, **kwargs): + """The Append Block operation commits a new block of data to the end of an + existing append blob where the contents are read from a source url. The + Append Block operation is permitted only if the blob was created with + x-ms-blob-type set to AppendBlob. Append Block is supported only on + version 2015-02-21 version or later. + + :param source_url: Specify a URL to the copy source. + :type source_url: str + :param content_length: The length of the request. + :type content_length: long + :param source_range: Bytes of source data in the specified range. + :type source_range: str + :param source_content_md5: Specify the md5 calculated for the range of + bytes that must be read from the copy source. + :type source_content_md5: bytearray + :param source_contentcrc64: Specify the crc64 calculated for the range + of bytes that must be read from the copy source. + :type source_contentcrc64: bytearray + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param transactional_content_md5: Specify the transactional md5 for + the body, to be validated by the service. + :type transactional_content_md5: bytearray + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param append_position_access_conditions: Additional parameters for + the operation + :type append_position_access_conditions: + ~azure.storage.blob.models.AppendPositionAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + max_size = None + if append_position_access_conditions is not None: + max_size = append_position_access_conditions.max_size + append_position = None + if append_position_access_conditions is not None: + append_position = append_position_access_conditions.append_position + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + + # Construct URL + url = self.append_block_from_url.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['comp'] = self._serialize.query("self.comp", self.comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-copy-source'] = self._serialize.header("source_url", source_url, 'str') + if source_range is not None: + header_parameters['x-ms-source-range'] = self._serialize.header("source_range", source_range, 'str') + if source_content_md5 is not None: + header_parameters['x-ms-source-content-md5'] = self._serialize.header("source_content_md5", source_content_md5, 'bytearray') + if source_contentcrc64 is not None: + header_parameters['x-ms-source-content-crc64'] = self._serialize.header("source_contentcrc64", source_contentcrc64, 'bytearray') + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + if transactional_content_md5 is not None: + header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if max_size is not None: + header_parameters['x-ms-blob-condition-maxsize'] = self._serialize.header("max_size", max_size, 'long') + if append_position is not None: + header_parameters['x-ms-blob-condition-appendpos'] = self._serialize.header("append_position", append_position, 'long') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-blob-append-offset': self._deserialize('str', response.headers.get('x-ms-blob-append-offset')), + 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + append_block_from_url.metadata = {'url': '/{containerName}/{blob}'} diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py index 888080713464..e7c3de1491ef 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_blob_operations.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -24,6 +23,7 @@ class BlobOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar x_ms_requires_sync: . Constant value: "true". :ivar x_ms_copy_action: . Constant value: "abort". :ivar restype: . Constant value: "account". """ @@ -37,13 +37,14 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + self.x_ms_requires_sync = "true" self.x_ms_copy_action = "abort" self.restype = "account" - def download(self, snapshot=None, timeout=None, range=None, range_get_content_md5=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def download(self, snapshot=None, version_id=None, timeout=None, range=None, range_get_content_md5=None, range_get_content_crc64=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): """The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to - read a snapshot. + read a snapshot or verison. :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more @@ -51,6 +52,9 @@ def download(self, snapshot=None, timeout=None, range=None, range_get_content_md href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -63,23 +67,43 @@ def download(self, snapshot=None, timeout=None, range=None, range_get_content_md with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. :type range_get_content_md5: bool + :param range_get_content_crc64: When set to true and specified + together with the Range, the service returns the CRC64 hash for the + range, as long as the range is less than or equal to 4 MB in size. + :type range_get_content_crc64: bool + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: object or the result of cls(response) :rtype: Generator :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -109,16 +133,26 @@ def download(self, snapshot=None, timeout=None, range=None, range_get_content_md query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' if range is not None: header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') if range_get_content_md5 is not None: header_parameters['x-ms-range-get-content-md5'] = self._serialize.header("range_get_content_md5", range_get_content_md5, 'bool') + if range_get_content_crc64 is not None: + header_parameters['x-ms-range-get-content-crc64'] = self._serialize.header("range_get_content_crc64", range_get_content_crc64, 'bool') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -169,13 +203,18 @@ def download(self, snapshot=None, timeout=None, range=None, range_get_content_md 'x-ms-lease-duration': self._deserialize(models.LeaseDurationType, response.headers.get('x-ms-lease-duration')), 'x-ms-lease-state': self._deserialize(models.LeaseStateType, response.headers.get('x-ms-lease-state')), 'x-ms-lease-status': self._deserialize(models.LeaseStatusType, response.headers.get('x-ms-lease-status')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-blob-content-md5': self._deserialize('bytearray', response.headers.get('x-ms-blob-content-md5')), + 'x-ms-tag-count': self._deserialize('int', response.headers.get('x-ms-tag-count')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } if response.status_code == 206: @@ -203,13 +242,18 @@ def download(self, snapshot=None, timeout=None, range=None, range_get_content_md 'x-ms-lease-duration': self._deserialize(models.LeaseDurationType, response.headers.get('x-ms-lease-duration')), 'x-ms-lease-state': self._deserialize(models.LeaseStateType, response.headers.get('x-ms-lease-state')), 'x-ms-lease-status': self._deserialize(models.LeaseStatusType, response.headers.get('x-ms-lease-status')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-blob-content-md5': self._deserialize('bytearray', response.headers.get('x-ms-blob-content-md5')), + 'x-ms-tag-count': self._deserialize('int', response.headers.get('x-ms-tag-count')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } @@ -219,41 +263,58 @@ def download(self, snapshot=None, timeout=None, range=None, range_get_content_md return deserialized download.metadata = {'url': '/{containerName}/{blob}'} - def get_properties(self, comp=None, snapshot=None, timeout=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def get_properties(self, snapshot=None, version_id=None, timeout=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): """The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob. - :param comp: Possible values include: 'metadata' - :type comp: str :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -281,12 +342,18 @@ def get_properties(self, comp=None, snapshot=None, timeout=None, request_id=None # Construct parameters query_parameters = {} - if comp is not None: - query_parameters['comp'] = self._serialize.query("comp", comp, 'str') if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') # Construct headers header_parameters = {} @@ -339,22 +406,26 @@ def get_properties(self, comp=None, snapshot=None, timeout=None, request_id=None 'Content-Language': self._deserialize('str', response.headers.get('Content-Language')), 'Cache-Control': self._deserialize('str', response.headers.get('Cache-Control')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), 'x-ms-blob-committed-block-count': self._deserialize('int', response.headers.get('x-ms-blob-committed-block-count')), 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-access-tier': self._deserialize('str', response.headers.get('x-ms-access-tier')), 'x-ms-access-tier-inferred': self._deserialize('bool', response.headers.get('x-ms-access-tier-inferred')), 'x-ms-archive-status': self._deserialize('str', response.headers.get('x-ms-archive-status')), 'x-ms-access-tier-change-time': self._deserialize('rfc-1123', response.headers.get('x-ms-access-tier-change-time')), + 'x-ms-tag-count': self._deserialize('int', response.headers.get('x-ms-tag-count')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) get_properties.metadata = {'url': '/{containerName}/{blob}'} - def delete(self, snapshot=None, timeout=None, delete_snapshots=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def delete(self, snapshot=None, version_id=None, timeout=None, delete_snapshots=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): """If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from the storage account. If the storage account's soft delete feature is enabled, then, when a blob @@ -369,7 +440,15 @@ def delete(self, snapshot=None, timeout=None, delete_snapshots=None, request_id= parameter to discover which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the - service to return an HTTP status code of 404 (ResourceNotFound). + service to return an HTTP status code of 404 (ResourceNotFound). If the + storage account's automatic snapshot feature is enabled, then, when a + blob is deleted, an automatic snapshot is created. The blob becomes + inaccessible immediately. All other operations on the blob causes the + service to return an HTTP status code of 404 (ResourceNotFound). You + can access automatic snapshot using snapshot timestamp or version id. + You can restore the blob by calling Put or Copy Blob API with automatic + snapshot as source. Deleting automatic snapshot requires shared key or + special SAS/RBAC permissions. :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more @@ -377,6 +456,9 @@ def delete(self, snapshot=None, timeout=None, delete_snapshots=None, request_id= href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -387,24 +469,26 @@ def delete(self, snapshot=None, timeout=None, delete_snapshots=None, request_id= the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob itself. Possible values include: 'include', 'only' - :type delete_snapshots: str or ~blob.models.DeleteSnapshotsOptionType + :type delete_snapshots: str or + ~azure.storage.blob.models.DeleteSnapshotsOptionType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -434,6 +518,8 @@ def delete(self, snapshot=None, timeout=None, delete_snapshots=None, request_id= query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) @@ -466,6 +552,7 @@ def delete(self, snapshot=None, timeout=None, delete_snapshots=None, request_id= if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -474,6 +561,204 @@ def delete(self, snapshot=None, timeout=None, delete_snapshots=None, request_id= return cls(response, None, response_headers) delete.metadata = {'url': '/{containerName}/{blob}'} + def rename(self, rename_source, timeout=None, path_rename_mode=None, directory_properties=None, posix_permissions=None, posix_umask=None, source_lease_id=None, request_id=None, directory_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, source_modified_access_conditions=None, cls=None, **kwargs): + """Rename a blob/file. By default, the destination is overwritten and if + the destination already exists and has a lease the lease is broken. + This operation supports conditional HTTP requests. For more + information, see [Specifying Conditional Headers for Blob Service + Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). + To fail if the destination already exists, use a conditional request + with If-None-Match: "*". + + :param rename_source: The file or directory to be renamed. The value + must have the following format: "/{filesysystem}/{path}". If + "x-ms-properties" is specified, the properties will overwrite the + existing properties; otherwise, the existing properties will be + preserved. + :type rename_source: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param path_rename_mode: Determines the behavior of the rename + operation. Possible values include: 'legacy', 'posix' + :type path_rename_mode: str or + ~azure.storage.blob.models.PathRenameMode + :param directory_properties: Optional. User-defined properties to be + stored with the file or directory, in the format of a comma-separated + list of name and value pairs "n1=v1, n2=v2, ...", where each value is + base64 encoded. + :type directory_properties: str + :param posix_permissions: Optional and only valid if Hierarchical + Namespace is enabled for the account. Sets POSIX access permissions + for the file owner, the file owning group, and others. Each class may + be granted read, write, or execute permission. The sticky bit is also + supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. + 0766) are supported. + :type posix_permissions: str + :param posix_umask: Only valid if Hierarchical Namespace is enabled + for the account. This umask restricts permission settings for file and + directory, and will only be applied when default Acl does not exist in + parent directory. If the umask bit has set, it means that the + corresponding permission will be disabled. Otherwise the corresponding + permission will be determined by the permission. A 4-digit octal + notation (e.g. 0022) is supported here. If no umask was specified, a + default umask - 0027 will be used. + :type posix_umask: str + :param source_lease_id: A lease ID for the source path. If specified, + the source path must have an active lease and the leaase ID must + match. + :type source_lease_id: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param directory_http_headers: Additional parameters for the operation + :type directory_http_headers: + ~azure.storage.blob.models.DirectoryHttpHeaders + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`DataLakeStorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + cache_control = None + if directory_http_headers is not None: + cache_control = directory_http_headers.cache_control + content_type = None + if directory_http_headers is not None: + content_type = directory_http_headers.content_type + content_encoding = None + if directory_http_headers is not None: + content_encoding = directory_http_headers.content_encoding + content_language = None + if directory_http_headers is not None: + content_language = directory_http_headers.content_language + content_disposition = None + if directory_http_headers is not None: + content_disposition = directory_http_headers.content_disposition + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + + # Construct URL + url = self.rename.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if path_rename_mode is not None: + query_parameters['mode'] = self._serialize.query("path_rename_mode", path_rename_mode, 'PathRenameMode') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-rename-source'] = self._serialize.header("rename_source", rename_source, 'str') + if directory_properties is not None: + header_parameters['x-ms-properties'] = self._serialize.header("directory_properties", directory_properties, 'str') + if posix_permissions is not None: + header_parameters['x-ms-permissions'] = self._serialize.header("posix_permissions", posix_permissions, 'str') + if posix_umask is not None: + header_parameters['x-ms-umask'] = self._serialize.header("posix_umask", posix_umask, 'str') + if source_lease_id is not None: + header_parameters['x-ms-source-lease-id'] = self._serialize.header("source_lease_id", source_lease_id, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if cache_control is not None: + header_parameters['x-ms-cache-control'] = self._serialize.header("cache_control", cache_control, 'str') + if content_type is not None: + header_parameters['x-ms-content-type'] = self._serialize.header("content_type", content_type, 'str') + if content_encoding is not None: + header_parameters['x-ms-content-encoding'] = self._serialize.header("content_encoding", content_encoding, 'str') + if content_language is not None: + header_parameters['x-ms-content-language'] = self._serialize.header("content_language", content_language, 'str') + if content_disposition is not None: + header_parameters['x-ms-content-disposition'] = self._serialize.header("content_disposition", content_disposition, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.DataLakeStorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Content-Length': self._deserialize('long', response.headers.get('Content-Length')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + } + return cls(response, None, response_headers) + rename.metadata = {'url': '/{filesystem}/{path}'} + def undelete(self, timeout=None, request_id=None, cls=None, **kwargs): """Undelete a blob that was previously soft deleted. @@ -491,7 +776,7 @@ def undelete(self, timeout=None, request_id=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "undelete" @@ -526,6 +811,7 @@ def undelete(self, timeout=None, request_id=None, cls=None, **kwargs): if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -547,20 +833,21 @@ def set_http_headers(self, timeout=None, request_id=None, blob_http_headers=None analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_cache_control = None @@ -654,6 +941,7 @@ def set_http_headers(self, timeout=None, request_id=None, blob_http_headers=None 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -662,7 +950,7 @@ def set_http_headers(self, timeout=None, request_id=None, blob_http_headers=None return cls(response, None, response_headers) set_http_headers.metadata = {'url': '/{containerName}/{blob}'} - def set_metadata(self, timeout=None, metadata=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def set_metadata(self, timeout=None, metadata=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, cls=None, **kwargs): """The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value pairs. @@ -681,28 +969,51 @@ def set_metadata(self, timeout=None, metadata=None, request_id=None, lease_acces C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -729,7 +1040,15 @@ def set_metadata(self, timeout=None, metadata=None, request_id=None, lease_acces query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -762,10 +1081,13 @@ def set_metadata(self, timeout=None, metadata=None, request_id=None, lease_acces response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -797,13 +1119,13 @@ def acquire_lease(self, timeout=None, duration=None, proposed_lease_id=None, req :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -868,6 +1190,7 @@ def acquire_lease(self, timeout=None, duration=None, proposed_lease_id=None, req 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -894,13 +1217,13 @@ def release_lease(self, lease_id, timeout=None, request_id=None, modified_access :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -961,6 +1284,7 @@ def release_lease(self, lease_id, timeout=None, request_id=None, modified_access response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -987,13 +1311,13 @@ def renew_lease(self, lease_id, timeout=None, request_id=None, modified_access_c :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1055,6 +1379,7 @@ def renew_lease(self, lease_id, timeout=None, request_id=None, modified_access_c 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1086,13 +1411,13 @@ def change_lease(self, lease_id, proposed_lease_id, timeout=None, request_id=Non :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1154,6 +1479,7 @@ def change_lease(self, lease_id, proposed_lease_id, timeout=None, request_id=Non response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), @@ -1189,13 +1515,13 @@ def break_lease(self, timeout=None, break_period=None, request_id=None, modified :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1258,6 +1584,7 @@ def break_lease(self, timeout=None, break_period=None, request_id=None, modified 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-time': self._deserialize('int', response.headers.get('x-ms-lease-time')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1266,7 +1593,7 @@ def break_lease(self, timeout=None, break_period=None, request_id=None, modified return cls(response, None, response_headers) break_lease.metadata = {'url': '/{containerName}/{blob}'} - def create_snapshot(self, timeout=None, metadata=None, request_id=None, modified_access_conditions=None, lease_access_conditions=None, cls=None, **kwargs): + def create_snapshot(self, timeout=None, metadata=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, customer_provided_key_info=None, modified_access_conditions=None, lease_access_conditions=None, cls=None, **kwargs): """The Create Snapshot operation creates a read-only snapshot of a blob. :param timeout: The timeout parameter is expressed in seconds. For @@ -1284,25 +1611,48 @@ def create_snapshot(self, timeout=None, metadata=None, request_id=None, modified C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -1332,7 +1682,15 @@ def create_snapshot(self, timeout=None, metadata=None, request_id=None, modified query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -1366,15 +1724,20 @@ def create_snapshot(self, timeout=None, metadata=None, request_id=None, modified 'x-ms-snapshot': self._deserialize('str', response.headers.get('x-ms-snapshot')), 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) create_snapshot.metadata = {'url': '/{containerName}/{blob}'} - def start_copy_from_url(self, copy_source, timeout=None, metadata=None, request_id=None, source_modified_access_conditions=None, modified_access_conditions=None, lease_access_conditions=None, cls=None, **kwargs): + def start_copy_from_url(self, copy_source, timeout=None, metadata=None, tags=None, tier=None, rehydrate_priority=None, request_id=None, source_modified_access_conditions=None, modified_access_conditions=None, lease_access_conditions=None, cls=None, **kwargs): """The Start Copy From URL operation copies a blob or an internet resource to a new blob. @@ -1399,6 +1762,19 @@ def start_copy_from_url(self, copy_source, timeout=None, metadata=None, request_ C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional + :param rehydrate_priority: Optional: Indicates the priority with which + to rehydrate an archived blob. Possible values include: 'High', + 'Standard' + :type rehydrate_priority: str or + ~azure.storage.blob.models.RehydratePriority :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. @@ -1406,20 +1782,21 @@ def start_copy_from_url(self, copy_source, timeout=None, metadata=None, request_ :param source_modified_access_conditions: Additional parameters for the operation :type source_modified_access_conditions: - ~blob.models.SourceModifiedAccessConditions + ~azure.storage.blob.models.SourceModifiedAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) source_if_modified_since = None @@ -1466,6 +1843,12 @@ def start_copy_from_url(self, copy_source, timeout=None, metadata=None, request_ header_parameters = {} if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') + if rehydrate_priority is not None: + header_parameters['x-ms-rehydrate-priority'] = self._serialize.header("rehydrate_priority", rehydrate_priority, 'str') header_parameters['x-ms-copy-source'] = self._serialize.header("copy_source", copy_source, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: @@ -1502,8 +1885,10 @@ def start_copy_from_url(self, copy_source, timeout=None, metadata=None, request_ response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-copy-id': self._deserialize('str', response.headers.get('x-ms-copy-id')), 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), @@ -1512,6 +1897,160 @@ def start_copy_from_url(self, copy_source, timeout=None, metadata=None, request_ return cls(response, None, response_headers) start_copy_from_url.metadata = {'url': '/{containerName}/{blob}'} + def copy_from_url(self, copy_source, timeout=None, metadata=None, tags=None, tier=None, request_id=None, source_modified_access_conditions=None, modified_access_conditions=None, lease_access_conditions=None, cls=None, **kwargs): + """The Copy From URL operation copies a blob or an internet resource to a + new blob. It will not return a response until the copy is complete. + + :param copy_source: Specifies the name of the source page blob + snapshot. This value is a URL of up to 2 KB in length that specifies a + page blob snapshot. The value should be URL-encoded as it would appear + in a request URI. The source blob must either be public or must be + authenticated via a shared access signature. + :type copy_source: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param metadata: Optional. Specifies a user-defined name-value pair + associated with the blob. If no name-value pairs are specified, the + operation will copy the metadata from the source blob or file to the + destination blob. If one or more name-value pairs are specified, the + destination blob is created with the specified metadata, and metadata + is not copied from the source blob or file. Note that beginning with + version 2009-09-19, metadata names must adhere to the naming rules for + C# identifiers. See Naming and Referencing Containers, Blobs, and + Metadata for more information. + :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + + # Construct URL + url = self.copy_from_url.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + + # Construct headers + header_parameters = {} + if metadata is not None: + header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') + header_parameters['x-ms-copy-source'] = self._serialize.header("copy_source", copy_source, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + header_parameters['x-ms-requires-sync'] = self._serialize.header("self.x_ms_requires_sync", self.x_ms_requires_sync, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-copy-id': self._deserialize('str', response.headers.get('x-ms-copy-id')), + 'x-ms-copy-status': self._deserialize(models.SyncCopyStatusType, response.headers.get('x-ms-copy-status')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + copy_from_url.metadata = {'url': '/{containerName}/{blob}'} + def abort_copy_from_url(self, copy_id, timeout=None, request_id=None, lease_access_conditions=None, cls=None, **kwargs): """The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with zero length and full @@ -1531,13 +2070,14 @@ def abort_copy_from_url(self, copy_id, timeout=None, request_id=None, lease_acce :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -1580,6 +2120,7 @@ def abort_copy_from_url(self, copy_id, timeout=None, request_id=None, lease_acce if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1588,7 +2129,7 @@ def abort_copy_from_url(self, copy_id, timeout=None, request_id=None, lease_acce return cls(response, None, response_headers) abort_copy_from_url.metadata = {'url': '/{containerName}/{blob}'} - def set_tier(self, tier, timeout=None, request_id=None, lease_access_conditions=None, cls=None, **kwargs): + def set_tier(self, tier, timeout=None, rehydrate_priority=None, request_id=None, lease_access_conditions=None, cls=None, **kwargs): """The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage account (locally redundant storage only). A premium @@ -1599,25 +2140,31 @@ def set_tier(self, tier, timeout=None, request_id=None, lease_access_conditions= :param tier: Indicates the tier to be set on the blob. Possible values include: 'P4', 'P6', 'P10', 'P20', 'P30', 'P40', 'P50', 'Hot', 'Cool', 'Archive' - :type tier: str or ~blob.models.AccessTier + :type tier: str or ~azure.storage.blob.models.AccessTierRequired :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param rehydrate_priority: Optional: Indicates the priority with which + to rehydrate an archived blob. Possible values include: 'High', + 'Standard' + :type rehydrate_priority: str or + ~azure.storage.blob.models.RehydratePriority :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -1642,6 +2189,8 @@ def set_tier(self, tier, timeout=None, request_id=None, lease_access_conditions= # Construct headers header_parameters = {} header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') + if rehydrate_priority is not None: + header_parameters['x-ms-rehydrate-priority'] = self._serialize.header("rehydrate_priority", rehydrate_priority, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -1659,6 +2208,7 @@ def set_tier(self, tier, timeout=None, request_id=None, lease_access_conditions= if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -1674,7 +2224,7 @@ def get_account_info(self, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -1706,6 +2256,7 @@ def get_account_info(self, cls=None, **kwargs): if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1714,4 +2265,172 @@ def get_account_info(self, cls=None, **kwargs): 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) - get_account_info.metadata = {'url': '/{containerName}/{blobName}'} + get_account_info.metadata = {'url': '/{containerName}/{blob}'} + + def set_tags(self, tags, content_length, timeout=None, transactional_content_md5=None, transactional_content_crc64=None, request_id=None, cls=None, **kwargs): + """The Set Blob Tags operation sets tags for the specified blob. This API + is only supported in version 2018-11-09 and later. + + :param tags: + :type tags: ~azure.storage.blob.models.BlobTags + :param content_length: The length of the request. + :type content_length: long + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param transactional_content_md5: Specify the transactional md5 for + the body, to be validated by the service. + :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + comp = "tags" + + # Construct URL + url = self.set_tags.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/xml; charset=utf-8' + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + if transactional_content_md5 is not None: + header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + + # Construct body + body_content = self._serialize.body(tags, 'BlobTags') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + set_tags.metadata = {'url': '/{containerName}/{blob}'} + + def get_tags(self, content_length, timeout=None, snapshot=None, version_id=None, request_id=None, cls=None, **kwargs): + """The Get Blob Tags operation returns all tags for the specified blob, + snapshot, or version. This API is only supported in version 2018-11-09 + and later. + + :param content_length: The length of the request. + :type content_length: long + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param snapshot: The snapshot parameter is an opaque DateTime value + that, when present, specifies the blob snapshot to retrieve. For more + information on working with blob snapshots, see Creating + a Snapshot of a Blob. + :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param callable cls: A custom type or function that will be passed the + direct response + :return: BlobTags or the result of cls(response) + :rtype: ~azure.storage.blob.models.BlobTags + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + comp = "tags" + + # Construct URL + url = self.get_tags.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if snapshot is not None: + query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BlobTags', response) + header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + + if cls: + return cls(response, deserialized, header_dict) + + return deserialized + get_tags.metadata = {'url': '/{containerName}/{blob}'} diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py index 98612bd9eb13..e07e1fb2b8cb 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_block_blob_operations.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -38,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._config = config self.x_ms_blob_type = "BlockBlob" - def upload(self, body, content_length, timeout=None, metadata=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def upload(self, body, content_length, timeout=None, metadata=None, tags=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, tier=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, cls=None, **kwargs): """The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; @@ -65,25 +64,53 @@ def upload(self, body, content_length, timeout=None, metadata=None, request_id=N C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_content_type = None @@ -107,6 +134,9 @@ def upload(self, body, content_length, timeout=None, metadata=None, request_id=N lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -131,6 +161,14 @@ def upload(self, body, content_length, timeout=None, metadata=None, request_id=N query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -138,6 +176,10 @@ def upload(self, body, content_length, timeout=None, metadata=None, request_id=N header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -181,16 +223,20 @@ def upload(self, body, content_length, timeout=None, metadata=None, request_id=N 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) upload.metadata = {'url': '/{containerName}/{blob}'} - def stage_block(self, block_id, content_length, body, transactional_content_md5=None, timeout=None, request_id=None, lease_access_conditions=None, cls=None, **kwargs): + def stage_block(self, block_id, content_length, body, transactional_content_md5=None, transactional_content_crc64=None, timeout=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, customer_provided_key_info=None, cls=None, **kwargs): """The Stage Block operation creates a new block to be committed as part of a blob. @@ -206,29 +252,55 @@ def stage_block(self, block_id, content_length, body, transactional_content_md5= :param transactional_content_md5: Specify the transactional md5 for the body, to be validated by the service. :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope comp = "block" @@ -244,7 +316,15 @@ def stage_block(self, block_id, content_length, body, transactional_content_md5= query_parameters['blockid'] = self._serialize.query("block_id", block_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -252,6 +332,8 @@ def stage_block(self, block_id, content_length, body, transactional_content_md5= header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if transactional_content_md5 is not None: header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -272,16 +354,20 @@ def stage_block(self, block_id, content_length, body, transactional_content_md5= if cls: response_headers = { 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) stage_block.metadata = {'url': '/{containerName}/{blob}'} - def stage_block_from_url(self, block_id, content_length, source_url, source_range=None, source_content_md5=None, timeout=None, request_id=None, lease_access_conditions=None, cls=None, **kwargs): + def stage_block_from_url(self, block_id, content_length, source_url, source_range=None, source_content_md5=None, source_contentcrc64=None, timeout=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, customer_provided_key_info=None, source_modified_access_conditions=None, cls=None, **kwargs): """The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL. @@ -299,29 +385,71 @@ def stage_block_from_url(self, block_id, content_length, source_url, source_rang :param source_content_md5: Specify the md5 calculated for the range of bytes that must be read from the copy source. :type source_content_md5: bytearray + :param source_contentcrc64: Specify the crc64 calculated for the range + of bytes that must be read from the copy source. + :type source_contentcrc64: bytearray :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match comp = "block" @@ -337,7 +465,15 @@ def stage_block_from_url(self, block_id, content_length, source_url, source_rang query_parameters['blockid'] = self._serialize.query("block_id", block_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -347,11 +483,21 @@ def stage_block_from_url(self, block_id, content_length, source_url, source_rang header_parameters['x-ms-source-range'] = self._serialize.header("source_range", source_range, 'str') if source_content_md5 is not None: header_parameters['x-ms-source-content-md5'] = self._serialize.header("source_content_md5", source_content_md5, 'bytearray') + if source_contentcrc64 is not None: + header_parameters['x-ms-source-content-crc64'] = self._serialize.header("source_contentcrc64", source_contentcrc64, 'bytearray') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') if lease_id is not None: header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') # Construct and send request request = self._client.put(url, query_parameters, header_parameters) @@ -365,16 +511,20 @@ def stage_block_from_url(self, block_id, content_length, source_url, source_rang if cls: response_headers = { 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) stage_block_from_url.metadata = {'url': '/{containerName}/{blob}'} - def commit_block_list(self, blocks, timeout=None, metadata=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def commit_block_list(self, blocks, timeout=None, transactional_content_md5=None, transactional_content_crc64=None, metadata=None, tags=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, tier=None, request_id=None, blob_http_headers=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, cls=None, **kwargs): """The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a @@ -386,12 +536,18 @@ def commit_block_list(self, blocks, timeout=None, metadata=None, request_id=None block, whichever list it may belong to. :param blocks: - :type blocks: ~blob.models.BlockLookupList + :type blocks: ~azure.storage.blob.models.BlockLookupList :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. :type timeout: int + :param transactional_content_md5: Specify the transactional md5 for + the body, to be validated by the service. + :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray :param metadata: Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the @@ -402,25 +558,53 @@ def commit_block_list(self, blocks, timeout=None, metadata=None, request_id=None C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType + :param tier: Optional. Indicates the tier to be set on the blob. + Possible values include: 'Hot', 'Cool', 'Archive' + :type tier: str or ~azure.storage.blob.models.AccessTierOptional :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_cache_control = None @@ -444,6 +628,9 @@ def commit_block_list(self, blocks, timeout=None, metadata=None, request_id=None lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -470,13 +657,29 @@ def commit_block_list(self, blocks, timeout=None, metadata=None, request_id=None query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} header_parameters['Content-Type'] = 'application/xml; charset=utf-8' + if transactional_content_md5 is not None: + header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') + if tier is not None: + header_parameters['x-ms-access-tier'] = self._serialize.header("tier", tier, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -520,29 +723,37 @@ def commit_block_list(self, blocks, timeout=None, metadata=None, request_id=None 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) commit_block_list.metadata = {'url': '/{containerName}/{blob}'} - def get_block_list(self, list_type="committed", snapshot=None, timeout=None, request_id=None, lease_access_conditions=None, cls=None, **kwargs): + def get_block_list(self, list_type="committed", snapshot=None, version_id=None, timeout=None, request_id=None, lease_access_conditions=None, cls=None, **kwargs): """The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob. :param list_type: Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together. Possible values include: 'committed', 'uncommitted', 'all' - :type list_type: str or ~blob.models.BlockListType + :type list_type: str or ~azure.storage.blob.models.BlockListType :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -554,13 +765,14 @@ def get_block_list(self, list_type="committed", snapshot=None, timeout=None, req :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: BlockList or the result of cls(response) - :rtype: ~blob.models.BlockList + :rtype: ~azure.storage.blob.models.BlockList :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -580,6 +792,8 @@ def get_block_list(self, list_type="committed", snapshot=None, timeout=None, req query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') query_parameters['blocklisttype'] = self._serialize.query("list_type", list_type, 'BlockListType') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) @@ -587,7 +801,7 @@ def get_block_list(self, list_type="committed", snapshot=None, timeout=None, req # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -612,6 +826,7 @@ def get_block_list(self, list_type="committed", snapshot=None, timeout=None, req 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Content-Type': self._deserialize('str', response.headers.get('Content-Type')), 'x-ms-blob-content-length': self._deserialize('long', response.headers.get('x-ms-blob-content-length')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py index ec265ff10242..f1d7a0fb8fd5 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_container_operations.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -36,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._config = config - def create(self, timeout=None, metadata=None, access=None, request_id=None, cls=None, **kwargs): + def create(self, timeout=None, metadata=None, access=None, default_encryption_scope=None, deny_encryption_scope_override=None, request_id=None, cls=None, **kwargs): """creates a new container under the specified account. If the container with the same name already exists, the operation fails. @@ -58,7 +57,18 @@ def create(self, timeout=None, metadata=None, access=None, request_id=None, cls= :param access: Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'container', 'blob' - :type access: str or ~blob.models.PublicAccessType + :type access: str or ~azure.storage.blob.models.PublicAccessType + :param default_encryption_scope: Optional. Specifies the default + encryption scope on the container. If not specified, encryption is + performed with the root account encryption key. For more information, + see Encryption at Rest for Azure Storage Services. + :type default_encryption_scope: str + :param deny_encryption_scope_override: Optional. Specifies whether to + deny encryption scope override provided in the request or not. If + true, reject the request with encryption scope. If false, encryption + is performed using encryption scope provided in the request. For more + information, see Encryption at Rest for Azure Storage Services. + :type deny_encryption_scope_override: bool :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. @@ -68,7 +78,7 @@ def create(self, timeout=None, metadata=None, access=None, request_id=None, cls= :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "container" @@ -92,6 +102,10 @@ def create(self, timeout=None, metadata=None, access=None, request_id=None, cls= header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') if access is not None: header_parameters['x-ms-blob-public-access'] = self._serialize.header("access", access, 'str') + if default_encryption_scope is not None: + header_parameters['x-ms-default-encryption-scope'] = self._serialize.header("default_encryption_scope", default_encryption_scope, 'str') + if deny_encryption_scope_override is not None: + header_parameters['x-ms-deny-encryption-scope-override'] = self._serialize.header("deny_encryption_scope_override", deny_encryption_scope_override, 'bool') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -109,6 +123,7 @@ def create(self, timeout=None, metadata=None, access=None, request_id=None, cls= response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -117,13 +132,11 @@ def create(self, timeout=None, metadata=None, access=None, request_id=None, cls= return cls(response, None, response_headers) create.metadata = {'url': '/{containerName}'} - def get_properties(self, comp=None, timeout=None, request_id=None, lease_access_conditions=None, cls=None, **kwargs): + def get_properties(self, timeout=None, request_id=None, lease_access_conditions=None, cls=None, **kwargs): """returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs. - :param comp: Possible values include: 'metadata' - :type comp: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -135,13 +148,14 @@ def get_properties(self, comp=None, timeout=None, request_id=None, lease_access_ :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -159,8 +173,6 @@ def get_properties(self, comp=None, timeout=None, request_id=None, lease_access_ # Construct parameters query_parameters = {} - if comp is not None: - query_parameters['comp'] = self._serialize.query("comp", comp, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) query_parameters['restype'] = self._serialize.query("restype", restype, 'str') @@ -190,10 +202,13 @@ def get_properties(self, comp=None, timeout=None, request_id=None, lease_access_ 'x-ms-lease-duration': self._deserialize(models.LeaseDurationType, response.headers.get('x-ms-lease-duration')), 'x-ms-lease-state': self._deserialize(models.LeaseStateType, response.headers.get('x-ms-lease-state')), 'x-ms-lease-status': self._deserialize(models.LeaseStatusType, response.headers.get('x-ms-lease-status')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-blob-public-access': self._deserialize('str', response.headers.get('x-ms-blob-public-access')), + 'x-ms-default-encryption-scope': self._deserialize('str', response.headers.get('x-ms-default-encryption-scope')), + 'x-ms-deny-encryption-scope-override': self._deserialize('bool', response.headers.get('x-ms-deny-encryption-scope-override')), 'x-ms-has-immutability-policy': self._deserialize('bool', response.headers.get('x-ms-has-immutability-policy')), 'x-ms-has-legal-hold': self._deserialize('bool', response.headers.get('x-ms-has-legal-hold')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -217,17 +232,18 @@ def delete(self, timeout=None, request_id=None, lease_access_conditions=None, mo :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -278,6 +294,7 @@ def delete(self, timeout=None, request_id=None, lease_access_conditions=None, mo if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -311,17 +328,18 @@ def set_metadata(self, timeout=None, metadata=None, request_id=None, lease_acces :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -373,6 +391,7 @@ def set_metadata(self, timeout=None, metadata=None, request_id=None, lease_acces response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -396,13 +415,14 @@ def get_access_policy(self, timeout=None, request_id=None, lease_access_conditio :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~blob.models.SignedIdentifier] + :rtype: list[~azure.storage.blob.models.SignedIdentifier] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -428,7 +448,7 @@ def get_access_policy(self, timeout=None, request_id=None, lease_access_conditio # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -452,6 +472,7 @@ def get_access_policy(self, timeout=None, request_id=None, lease_access_conditio 'x-ms-blob-public-access': self._deserialize('str', response.headers.get('x-ms-blob-public-access')), 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -469,7 +490,7 @@ def set_access_policy(self, container_acl=None, timeout=None, access=None, reque indicate whether blobs in a container may be accessed publicly. :param container_acl: the acls for the container - :type container_acl: list[~blob.models.SignedIdentifier] + :type container_acl: list[~azure.storage.blob.models.SignedIdentifier] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -478,24 +499,25 @@ def set_access_policy(self, container_acl=None, timeout=None, access=None, reque :param access: Specifies whether data in the container may be accessed publicly and the level of access. Possible values include: 'container', 'blob' - :type access: str or ~blob.models.PublicAccessType + :type access: str or ~azure.storage.blob.models.PublicAccessType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -541,10 +563,9 @@ def set_access_policy(self, container_acl=None, timeout=None, access=None, reque header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') # Construct body - serialization_ctxt = {'xml': {'name': 'SignedIdentifiers', 'itemsName': 'SignedIdentifier', 'wrapped': True}} + serialization_ctxt = {'xml': {'name': 'SignedIdentifiers', 'itemsName': 'SignedIdentifiers', 'wrapped': True}} if container_acl is not None: - body_content = self._serialize.serialize_iter(container_acl, 'SignedIdentifier', - serialization_ctxt=serialization_ctxt) + body_content = self._serialize.body(container_acl, '[SignedIdentifier]', serialization_ctxt=serialization_ctxt) else: body_content = None @@ -561,6 +582,7 @@ def set_access_policy(self, container_acl=None, timeout=None, access=None, reque response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -596,13 +618,13 @@ def acquire_lease(self, timeout=None, duration=None, proposed_lease_id=None, req :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -659,6 +681,7 @@ def acquire_lease(self, timeout=None, duration=None, proposed_lease_id=None, req 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -686,13 +709,13 @@ def release_lease(self, lease_id, timeout=None, request_id=None, modified_access :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -745,6 +768,7 @@ def release_lease(self, lease_id, timeout=None, request_id=None, modified_access response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -772,13 +796,13 @@ def renew_lease(self, lease_id, timeout=None, request_id=None, modified_access_c :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -832,6 +856,7 @@ def renew_lease(self, lease_id, timeout=None, request_id=None, modified_access_c 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -867,13 +892,13 @@ def break_lease(self, timeout=None, break_period=None, request_id=None, modified :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -928,6 +953,7 @@ def break_lease(self, timeout=None, break_period=None, request_id=None, modified 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-time': self._deserialize('int', response.headers.get('x-ms-lease-time')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -960,13 +986,13 @@ def change_lease(self, lease_id, proposed_lease_id, timeout=None, request_id=Non :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1021,6 +1047,7 @@ def change_lease(self, lease_id, proposed_lease_id, timeout=None, request_id=Non 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-lease-id': self._deserialize('str', response.headers.get('x-ms-lease-id')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1055,7 +1082,8 @@ def list_blob_flat_segment(self, prefix=None, marker=None, maxresults=None, incl :type maxresults: int :param include: Include this parameter to specify one or more datasets to include in the response. - :type include: list[str or ~blob.models.ListBlobsIncludeItem] + :type include: list[str or + ~azure.storage.blob.models.ListBlobsIncludeItem] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -1068,9 +1096,9 @@ def list_blob_flat_segment(self, prefix=None, marker=None, maxresults=None, incl :param callable cls: A custom type or function that will be passed the direct response :return: ListBlobsFlatSegmentResponse or the result of cls(response) - :rtype: ~blob.models.ListBlobsFlatSegmentResponse + :rtype: ~azure.storage.blob.models.ListBlobsFlatSegmentResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "container" @@ -1100,7 +1128,7 @@ def list_blob_flat_segment(self, prefix=None, marker=None, maxresults=None, incl # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -1120,6 +1148,7 @@ def list_blob_flat_segment(self, prefix=None, marker=None, maxresults=None, incl deserialized = self._deserialize('ListBlobsFlatSegmentResponse', response) header_dict = { 'Content-Type': self._deserialize('str', response.headers.get('Content-Type')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1164,7 +1193,8 @@ def list_blob_hierarchy_segment(self, delimiter, prefix=None, marker=None, maxre :type maxresults: int :param include: Include this parameter to specify one or more datasets to include in the response. - :type include: list[str or ~blob.models.ListBlobsIncludeItem] + :type include: list[str or + ~azure.storage.blob.models.ListBlobsIncludeItem] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -1178,9 +1208,9 @@ def list_blob_hierarchy_segment(self, delimiter, prefix=None, marker=None, maxre direct response :return: ListBlobsHierarchySegmentResponse or the result of cls(response) - :rtype: ~blob.models.ListBlobsHierarchySegmentResponse + :rtype: ~azure.storage.blob.models.ListBlobsHierarchySegmentResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "container" @@ -1211,7 +1241,7 @@ def list_blob_hierarchy_segment(self, delimiter, prefix=None, marker=None, maxre # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -1231,6 +1261,7 @@ def list_blob_hierarchy_segment(self, delimiter, prefix=None, marker=None, maxre deserialized = self._deserialize('ListBlobsHierarchySegmentResponse', response) header_dict = { 'Content-Type': self._deserialize('str', response.headers.get('Content-Type')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -1251,7 +1282,7 @@ def get_account_info(self, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "account" @@ -1284,6 +1315,7 @@ def get_account_info(self, cls=None, **kwargs): if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_directory_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_directory_operations.py new file mode 100644 index 000000000000..35a0b5946c3c --- /dev/null +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_directory_operations.py @@ -0,0 +1,508 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import map_error + +from .. import models + + +class DirectoryOperations(object): + """DirectoryOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar resource: . Constant value: "directory". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self._config = config + self.resource = "directory" + + def create(self, timeout=None, directory_properties=None, posix_permissions=None, posix_umask=None, request_id=None, directory_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + """Create a directory. By default, the destination is overwritten and if + the destination already exists and has a lease the lease is broken. + This operation supports conditional HTTP requests. For more + information, see [Specifying Conditional Headers for Blob Service + Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). + To fail if the destination already exists, use a conditional request + with If-None-Match: "*". + + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param directory_properties: Optional. User-defined properties to be + stored with the file or directory, in the format of a comma-separated + list of name and value pairs "n1=v1, n2=v2, ...", where each value is + base64 encoded. + :type directory_properties: str + :param posix_permissions: Optional and only valid if Hierarchical + Namespace is enabled for the account. Sets POSIX access permissions + for the file owner, the file owning group, and others. Each class may + be granted read, write, or execute permission. The sticky bit is also + supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. + 0766) are supported. + :type posix_permissions: str + :param posix_umask: Only valid if Hierarchical Namespace is enabled + for the account. This umask restricts permission settings for file and + directory, and will only be applied when default Acl does not exist in + parent directory. If the umask bit has set, it means that the + corresponding permission will be disabled. Otherwise the corresponding + permission will be determined by the permission. A 4-digit octal + notation (e.g. 0022) is supported here. If no umask was specified, a + default umask - 0027 will be used. + :type posix_umask: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param directory_http_headers: Additional parameters for the operation + :type directory_http_headers: + ~azure.storage.blob.models.DirectoryHttpHeaders + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`DataLakeStorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + cache_control = None + if directory_http_headers is not None: + cache_control = directory_http_headers.cache_control + content_type = None + if directory_http_headers is not None: + content_type = directory_http_headers.content_type + content_encoding = None + if directory_http_headers is not None: + content_encoding = directory_http_headers.content_encoding + content_language = None + if directory_http_headers is not None: + content_language = directory_http_headers.content_language + content_disposition = None + if directory_http_headers is not None: + content_disposition = directory_http_headers.content_disposition + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['resource'] = self._serialize.query("self.resource", self.resource, 'str') + + # Construct headers + header_parameters = {} + if directory_properties is not None: + header_parameters['x-ms-properties'] = self._serialize.header("directory_properties", directory_properties, 'str') + if posix_permissions is not None: + header_parameters['x-ms-permissions'] = self._serialize.header("posix_permissions", posix_permissions, 'str') + if posix_umask is not None: + header_parameters['x-ms-umask'] = self._serialize.header("posix_umask", posix_umask, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if cache_control is not None: + header_parameters['x-ms-cache-control'] = self._serialize.header("cache_control", cache_control, 'str') + if content_type is not None: + header_parameters['x-ms-content-type'] = self._serialize.header("content_type", content_type, 'str') + if content_encoding is not None: + header_parameters['x-ms-content-encoding'] = self._serialize.header("content_encoding", content_encoding, 'str') + if content_language is not None: + header_parameters['x-ms-content-language'] = self._serialize.header("content_language", content_language, 'str') + if content_disposition is not None: + header_parameters['x-ms-content-disposition'] = self._serialize.header("content_disposition", content_disposition, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.DataLakeStorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Content-Length': self._deserialize('long', response.headers.get('Content-Length')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + } + return cls(response, None, response_headers) + create.metadata = {'url': '/{filesystem}/{path}'} + + def rename(self, rename_source, timeout=None, marker=None, path_rename_mode=None, directory_properties=None, posix_permissions=None, posix_umask=None, source_lease_id=None, request_id=None, directory_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, source_modified_access_conditions=None, cls=None, **kwargs): + """Rename a directory. By default, the destination is overwritten and if + the destination already exists and has a lease the lease is broken. + This operation supports conditional HTTP requests. For more + information, see [Specifying Conditional Headers for Blob Service + Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). + To fail if the destination already exists, use a conditional request + with If-None-Match: "*". + + :param rename_source: The file or directory to be renamed. The value + must have the following format: "/{filesysystem}/{path}". If + "x-ms-properties" is specified, the properties will overwrite the + existing properties; otherwise, the existing properties will be + preserved. + :type rename_source: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param marker: When renaming a directory, the number of paths that are + renamed with each invocation is limited. If the number of paths to be + renamed exceeds this limit, a continuation token is returned in this + response header. When a continuation token is returned in the + response, it must be specified in a subsequent invocation of the + rename operation to continue renaming the directory. + :type marker: str + :param path_rename_mode: Determines the behavior of the rename + operation. Possible values include: 'legacy', 'posix' + :type path_rename_mode: str or + ~azure.storage.blob.models.PathRenameMode + :param directory_properties: Optional. User-defined properties to be + stored with the file or directory, in the format of a comma-separated + list of name and value pairs "n1=v1, n2=v2, ...", where each value is + base64 encoded. + :type directory_properties: str + :param posix_permissions: Optional and only valid if Hierarchical + Namespace is enabled for the account. Sets POSIX access permissions + for the file owner, the file owning group, and others. Each class may + be granted read, write, or execute permission. The sticky bit is also + supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. + 0766) are supported. + :type posix_permissions: str + :param posix_umask: Only valid if Hierarchical Namespace is enabled + for the account. This umask restricts permission settings for file and + directory, and will only be applied when default Acl does not exist in + parent directory. If the umask bit has set, it means that the + corresponding permission will be disabled. Otherwise the corresponding + permission will be determined by the permission. A 4-digit octal + notation (e.g. 0022) is supported here. If no umask was specified, a + default umask - 0027 will be used. + :type posix_umask: str + :param source_lease_id: A lease ID for the source path. If specified, + the source path must have an active lease and the leaase ID must + match. + :type source_lease_id: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param directory_http_headers: Additional parameters for the operation + :type directory_http_headers: + ~azure.storage.blob.models.DirectoryHttpHeaders + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`DataLakeStorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + cache_control = None + if directory_http_headers is not None: + cache_control = directory_http_headers.cache_control + content_type = None + if directory_http_headers is not None: + content_type = directory_http_headers.content_type + content_encoding = None + if directory_http_headers is not None: + content_encoding = directory_http_headers.content_encoding + content_language = None + if directory_http_headers is not None: + content_language = directory_http_headers.content_language + content_disposition = None + if directory_http_headers is not None: + content_disposition = directory_http_headers.content_disposition + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + + # Construct URL + url = self.rename.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if marker is not None: + query_parameters['continuation'] = self._serialize.query("marker", marker, 'str') + if path_rename_mode is not None: + query_parameters['mode'] = self._serialize.query("path_rename_mode", path_rename_mode, 'PathRenameMode') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-rename-source'] = self._serialize.header("rename_source", rename_source, 'str') + if directory_properties is not None: + header_parameters['x-ms-properties'] = self._serialize.header("directory_properties", directory_properties, 'str') + if posix_permissions is not None: + header_parameters['x-ms-permissions'] = self._serialize.header("posix_permissions", posix_permissions, 'str') + if posix_umask is not None: + header_parameters['x-ms-umask'] = self._serialize.header("posix_umask", posix_umask, 'str') + if source_lease_id is not None: + header_parameters['x-ms-source-lease-id'] = self._serialize.header("source_lease_id", source_lease_id, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if cache_control is not None: + header_parameters['x-ms-cache-control'] = self._serialize.header("cache_control", cache_control, 'str') + if content_type is not None: + header_parameters['x-ms-content-type'] = self._serialize.header("content_type", content_type, 'str') + if content_encoding is not None: + header_parameters['x-ms-content-encoding'] = self._serialize.header("content_encoding", content_encoding, 'str') + if content_language is not None: + header_parameters['x-ms-content-language'] = self._serialize.header("content_language", content_language, 'str') + if content_disposition is not None: + header_parameters['x-ms-content-disposition'] = self._serialize.header("content_disposition", content_disposition, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.DataLakeStorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'x-ms-continuation': self._deserialize('str', response.headers.get('x-ms-continuation')), + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Content-Length': self._deserialize('long', response.headers.get('Content-Length')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + } + return cls(response, None, response_headers) + rename.metadata = {'url': '/{filesystem}/{path}'} + + def delete(self, recursive_directory_delete, timeout=None, marker=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + """Deletes the directory. + + :param recursive_directory_delete: If "true", all paths beneath the + directory will be deleted. If "false" and the directory is non-empty, + an error occurs. + :type recursive_directory_delete: bool + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param marker: When renaming a directory, the number of paths that are + renamed with each invocation is limited. If the number of paths to be + renamed exceeds this limit, a continuation token is returned in this + response header. When a continuation token is returned in the + response, it must be specified in a subsequent invocation of the + rename operation to continue renaming the directory. + :type marker: str + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`DataLakeStorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['recursive'] = self._serialize.query("recursive_directory_delete", recursive_directory_delete, 'bool') + if marker is not None: + query_parameters['continuation'] = self._serialize.query("marker", marker, 'str') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.DataLakeStorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'x-ms-continuation': self._deserialize('str', response.headers.get('x-ms-continuation')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + } + return cls(response, None, response_headers) + delete.metadata = {'url': '/{filesystem}/{path}'} diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_page_blob_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_page_blob_operations.py index ad53a6b56cd5..ea2eeb29bbc1 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_page_blob_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_page_blob_operations.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -38,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._config = config self.x_ms_blob_type = "PageBlob" - def create(self, content_length, blob_content_length, timeout=None, metadata=None, blob_sequence_number=0, request_id=None, blob_http_headers=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def create(self, content_length, blob_content_length, timeout=None, metadata=None, tags=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, blob_sequence_number=0, request_id=None, blob_http_headers=None, lease_access_conditions=None, customer_provided_key_info=None, modified_access_conditions=None, cls=None, **kwargs): """The Create operation creates a new page blob. :param content_length: The length of the request. @@ -62,6 +61,26 @@ def create(self, content_length, blob_content_length, timeout=None, metadata=Non C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information. :type metadata: str + :param tags: Optional. A URL encoded query param string which + specifies the tags to be created with the Blob object. e.g. + TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may + contain up to 2kb of tags. + :type tags: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param blob_sequence_number: Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. @@ -71,20 +90,25 @@ def create(self, content_length, blob_content_length, timeout=None, metadata=Non analytics logging is enabled. :type request_id: str :param blob_http_headers: Additional parameters for the operation - :type blob_http_headers: ~blob.models.BlobHTTPHeaders + :type blob_http_headers: ~azure.storage.blob.models.BlobHTTPHeaders :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) blob_content_type = None @@ -108,6 +132,9 @@ def create(self, content_length, blob_content_length, timeout=None, metadata=Non lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_modified_since = None if modified_access_conditions is not None: if_modified_since = modified_access_conditions.if_modified_since @@ -132,12 +159,22 @@ def create(self, content_length, blob_content_length, timeout=None, metadata=Non query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if tags is not None: + header_parameters['x-ms-tags'] = self._serialize.header("tags", tags, 'str') header_parameters['x-ms-blob-content-length'] = self._serialize.header("blob_content_length", blob_content_length, 'long') if blob_sequence_number is not None: header_parameters['x-ms-blob-sequence-number'] = self._serialize.header("blob_sequence_number", blob_sequence_number, 'long') @@ -182,16 +219,20 @@ def create(self, content_length, blob_content_length, timeout=None, metadata=Non 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'x-ms-version-id': self._deserialize('str', response.headers.get('x-ms-version-id')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) create.metadata = {'url': '/{containerName}/{blob}'} - def upload_pages(self, body, content_length, transactional_content_md5=None, timeout=None, range=None, request_id=None, lease_access_conditions=None, sequence_number_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def upload_pages(self, body, content_length, transactional_content_md5=None, transactional_content_crc64=None, timeout=None, range=None, x_ms_encryption_key=None, x_ms_encryption_key_sha256=None, x_ms_encryption_algorithm=None, request_id=None, lease_access_conditions=None, customer_provided_key_info=None, sequence_number_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): """The Upload Pages operation writes a range of pages to a page blob. :param body: Initial data @@ -201,6 +242,9 @@ def upload_pages(self, body, content_length, transactional_content_md5=None, tim :param transactional_content_md5: Specify the transactional md5 for the body, to be validated by the service. :type transactional_content_md5: bytearray + :param transactional_content_crc64: Specify the transactional crc64 + for the body, to be validated by the service. + :type transactional_content_crc64: bytearray :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -209,32 +253,55 @@ def upload_pages(self, body, content_length, transactional_content_md5=None, tim :param range: Return only the bytes of the blob in the specified range. :type range: str + :param x_ms_encryption_key: Optional. Specifies the encryption key to + use to encrypt the data provided in the request. If not specified, + encryption is performed with the root account encryption key. For + more information, see Encryption at Rest for Azure Storage Services. + :type x_ms_encryption_key: str + :param x_ms_encryption_key_sha256: The SHA-256 hash of the provided + encryption key. Must be provided if the x-ms-encryption-key header is + provided. + :type x_ms_encryption_key_sha256: str + :param x_ms_encryption_algorithm: The algorithm used to produce the + encryption key hash. Currently, the only accepted value is "AES256". + Must be provided if the x-ms-encryption-key header is provided. + Possible values include: 'AES256' + :type x_ms_encryption_algorithm: str or + ~azure.storage.blob.models.EncryptionAlgorithmType :param request_id: Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param customer_provided_key_info: Additional parameters for the + operation + :type customer_provided_key_info: + ~azure.storage.blob.models.CustomerProvidedKeyInfo :param sequence_number_access_conditions: Additional parameters for the operation :type sequence_number_access_conditions: - ~blob.models.SequenceNumberAccessConditions + ~azure.storage.blob.models.SequenceNumberAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None if lease_access_conditions is not None: lease_id = lease_access_conditions.lease_id + encryption_scope = None + if customer_provided_key_info is not None: + encryption_scope = customer_provided_key_info.encryption_scope if_sequence_number_less_than_or_equal_to = None if sequence_number_access_conditions is not None: if_sequence_number_less_than_or_equal_to = sequence_number_access_conditions.if_sequence_number_less_than_or_equal_to @@ -271,7 +338,15 @@ def upload_pages(self, body, content_length, transactional_content_md5=None, tim query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + if x_ms_encryption_key is not None: + query_parameters['x-ms-encryption-key'] = self._serialize.query("x_ms_encryption_key", x_ms_encryption_key, 'str') + if x_ms_encryption_key_sha256 is not None: + query_parameters['x-ms-encryption-key-sha256'] = self._serialize.query("x_ms_encryption_key_sha256", x_ms_encryption_key_sha256, 'str') + if x_ms_encryption_algorithm is not None: + query_parameters['x-ms-encryption-algorithm'] = self._serialize.query("x_ms_encryption_algorithm", x_ms_encryption_algorithm, 'EncryptionAlgorithmType') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + if encryption_scope is not None: + query_parameters['x-ms-encryption-scope'] = self._serialize.query("encryption_scope", encryption_scope, 'str') # Construct headers header_parameters = {} @@ -279,6 +354,8 @@ def upload_pages(self, body, content_length, transactional_content_md5=None, tim header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if transactional_content_md5 is not None: header_parameters['Content-MD5'] = self._serialize.header("transactional_content_md5", transactional_content_md5, 'bytearray') + if transactional_content_crc64 is not None: + header_parameters['x-ms-content-crc64'] = self._serialize.header("transactional_content_crc64", transactional_content_crc64, 'bytearray') if range is not None: header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') @@ -318,11 +395,15 @@ def upload_pages(self, body, content_length, transactional_content_md5=None, tim 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-encryption-key-sha256': self._deserialize('str', response.headers.get('x-ms-encryption-key-sha256')), + 'x-ms-encryption-scope': self._deserialize('str', response.headers.get('x-ms-encryption-scope')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -347,21 +428,22 @@ def clear_pages(self, content_length, timeout=None, range=None, request_id=None, :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param sequence_number_access_conditions: Additional parameters for the operation :type sequence_number_access_conditions: - ~blob.models.SequenceNumberAccessConditions + ~azure.storage.blob.models.SequenceNumberAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -445,7 +527,9 @@ def clear_pages(self, content_length, timeout=None, range=None, request_id=None, 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -454,9 +538,180 @@ def clear_pages(self, content_length, timeout=None, range=None, request_id=None, return cls(response, None, response_headers) clear_pages.metadata = {'url': '/{containerName}/{blob}'} - def get_page_ranges(self, snapshot=None, timeout=None, range=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def upload_pages_from_url(self, source_url, source_range, content_length, range, source_content_md5=None, source_contentcrc64=None, timeout=None, request_id=None, lease_access_conditions=None, sequence_number_access_conditions=None, modified_access_conditions=None, source_modified_access_conditions=None, cls=None, **kwargs): + """The Upload Pages operation writes a range of pages to a page blob where + the contents are read from a URL. + + :param source_url: Specify a URL to the copy source. + :type source_url: str + :param source_range: Bytes of source data in the specified range. The + length of this range should match the ContentLength header and + x-ms-range/Range destination range header. + :type source_range: str + :param content_length: The length of the request. + :type content_length: long + :param range: The range of bytes to which the source range would be + written. The range should be 512 aligned and range-end is required. + :type range: str + :param source_content_md5: Specify the md5 calculated for the range of + bytes that must be read from the copy source. + :type source_content_md5: bytearray + :param source_contentcrc64: Specify the crc64 calculated for the range + of bytes that must be read from the copy source. + :type source_contentcrc64: bytearray + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param lease_access_conditions: Additional parameters for the + operation + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions + :param sequence_number_access_conditions: Additional parameters for + the operation + :type sequence_number_access_conditions: + ~azure.storage.blob.models.SequenceNumberAccessConditions + :param modified_access_conditions: Additional parameters for the + operation + :type modified_access_conditions: + ~azure.storage.blob.models.ModifiedAccessConditions + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.blob.models.SourceModifiedAccessConditions + :param callable cls: A custom type or function that will be passed the + direct response + :return: None or the result of cls(response) + :rtype: None + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + lease_id = None + if lease_access_conditions is not None: + lease_id = lease_access_conditions.lease_id + if_sequence_number_less_than_or_equal_to = None + if sequence_number_access_conditions is not None: + if_sequence_number_less_than_or_equal_to = sequence_number_access_conditions.if_sequence_number_less_than_or_equal_to + if_sequence_number_less_than = None + if sequence_number_access_conditions is not None: + if_sequence_number_less_than = sequence_number_access_conditions.if_sequence_number_less_than + if_sequence_number_equal_to = None + if sequence_number_access_conditions is not None: + if_sequence_number_equal_to = sequence_number_access_conditions.if_sequence_number_equal_to + if_modified_since = None + if modified_access_conditions is not None: + if_modified_since = modified_access_conditions.if_modified_since + if_unmodified_since = None + if modified_access_conditions is not None: + if_unmodified_since = modified_access_conditions.if_unmodified_since + if_match = None + if modified_access_conditions is not None: + if_match = modified_access_conditions.if_match + if_none_match = None + if modified_access_conditions is not None: + if_none_match = modified_access_conditions.if_none_match + source_if_modified_since = None + if source_modified_access_conditions is not None: + source_if_modified_since = source_modified_access_conditions.source_if_modified_since + source_if_unmodified_since = None + if source_modified_access_conditions is not None: + source_if_unmodified_since = source_modified_access_conditions.source_if_unmodified_since + source_if_match = None + if source_modified_access_conditions is not None: + source_if_match = source_modified_access_conditions.source_if_match + source_if_none_match = None + if source_modified_access_conditions is not None: + source_if_none_match = source_modified_access_conditions.source_if_none_match + + comp = "page" + page_write = "update" + + # Construct URL + url = self.upload_pages_from_url.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-copy-source'] = self._serialize.header("source_url", source_url, 'str') + header_parameters['x-ms-source-range'] = self._serialize.header("source_range", source_range, 'str') + if source_content_md5 is not None: + header_parameters['x-ms-source-content-md5'] = self._serialize.header("source_content_md5", source_content_md5, 'bytearray') + if source_contentcrc64 is not None: + header_parameters['x-ms-source-content-crc64'] = self._serialize.header("source_contentcrc64", source_contentcrc64, 'bytearray') + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + header_parameters['x-ms-page-write'] = self._serialize.header("page_write", page_write, 'str') + if lease_id is not None: + header_parameters['x-ms-lease-id'] = self._serialize.header("lease_id", lease_id, 'str') + if if_sequence_number_less_than_or_equal_to is not None: + header_parameters['x-ms-if-sequence-number-le'] = self._serialize.header("if_sequence_number_less_than_or_equal_to", if_sequence_number_less_than_or_equal_to, 'long') + if if_sequence_number_less_than is not None: + header_parameters['x-ms-if-sequence-number-lt'] = self._serialize.header("if_sequence_number_less_than", if_sequence_number_less_than, 'long') + if if_sequence_number_equal_to is not None: + header_parameters['x-ms-if-sequence-number-eq'] = self._serialize.header("if_sequence_number_equal_to", if_sequence_number_equal_to, 'long') + if if_modified_since is not None: + header_parameters['If-Modified-Since'] = self._serialize.header("if_modified_since", if_modified_since, 'rfc-1123') + if if_unmodified_since is not None: + header_parameters['If-Unmodified-Since'] = self._serialize.header("if_unmodified_since", if_unmodified_since, 'rfc-1123') + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if if_none_match is not None: + header_parameters['If-None-Match'] = self._serialize.header("if_none_match", if_none_match, 'str') + if source_if_modified_since is not None: + header_parameters['x-ms-source-if-modified-since'] = self._serialize.header("source_if_modified_since", source_if_modified_since, 'rfc-1123') + if source_if_unmodified_since is not None: + header_parameters['x-ms-source-if-unmodified-since'] = self._serialize.header("source_if_unmodified_since", source_if_unmodified_since, 'rfc-1123') + if source_if_match is not None: + header_parameters['x-ms-source-if-match'] = self._serialize.header("source_if_match", source_if_match, 'str') + if source_if_none_match is not None: + header_parameters['x-ms-source-if-none-match'] = self._serialize.header("source_if_none_match", source_if_none_match, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + if cls: + response_headers = { + 'ETag': self._deserialize('str', response.headers.get('ETag')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'Content-MD5': self._deserialize('bytearray', response.headers.get('Content-MD5')), + 'x-ms-content-crc64': self._deserialize('bytearray', response.headers.get('x-ms-content-crc64')), + 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-request-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-request-server-encrypted')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + upload_pages_from_url.metadata = {'url': '/{containerName}/{blob}'} + + def get_page_ranges(self, snapshot=None, version_id=None, timeout=None, range=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): """The Get Page Ranges operation returns the list of valid page ranges for - a page blob or snapshot of a page blob. + a page blob, version or snapshot of a page blob. :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more @@ -464,6 +719,9 @@ def get_page_ranges(self, snapshot=None, timeout=None, range=None, request_id=No href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -478,17 +736,18 @@ def get_page_ranges(self, snapshot=None, timeout=None, range=None, request_id=No :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: PageList or the result of cls(response) - :rtype: ~blob.models.PageList + :rtype: ~azure.storage.blob.models.PageList :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -520,13 +779,15 @@ def get_page_ranges(self, snapshot=None, timeout=None, range=None, request_id=No query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) query_parameters['comp'] = self._serialize.query("comp", comp, 'str') # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' if range is not None: header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') @@ -560,6 +821,7 @@ def get_page_ranges(self, snapshot=None, timeout=None, range=None, request_id=No 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'ETag': self._deserialize('str', response.headers.get('ETag')), 'x-ms-blob-content-length': self._deserialize('long', response.headers.get('x-ms-blob-content-length')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -572,10 +834,10 @@ def get_page_ranges(self, snapshot=None, timeout=None, range=None, request_id=No return deserialized get_page_ranges.metadata = {'url': '/{containerName}/{blob}'} - def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=None, range=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): + def get_page_ranges_diff(self, snapshot=None, version_id=None, timeout=None, prevsnapshot=None, range=None, request_id=None, lease_access_conditions=None, modified_access_conditions=None, cls=None, **kwargs): """[Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were changed between target blob and - previous snapshot. + previous snapshot or version. :param snapshot: The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more @@ -583,6 +845,9 @@ def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=None, r href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating a Snapshot of a Blob. :type snapshot: str + :param version_id: The version ID parameter is an opaque DateTime + value that, when present, specifies the blob version to retrieve. + :type version_id: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -606,17 +871,18 @@ def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=None, r :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: PageList or the result of cls(response) - :rtype: ~blob.models.PageList + :rtype: ~azure.storage.blob.models.PageList :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -648,6 +914,8 @@ def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=None, r query_parameters = {} if snapshot is not None: query_parameters['snapshot'] = self._serialize.query("snapshot", snapshot, 'str') + if version_id is not None: + query_parameters['versionid'] = self._serialize.query("version_id", version_id, 'str') if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) if prevsnapshot is not None: @@ -656,7 +924,7 @@ def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=None, r # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' if range is not None: header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') @@ -690,6 +958,7 @@ def get_page_ranges_diff(self, snapshot=None, timeout=None, prevsnapshot=None, r 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'ETag': self._deserialize('str', response.headers.get('ETag')), 'x-ms-blob-content-length': self._deserialize('long', response.headers.get('x-ms-blob-content-length')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -720,17 +989,18 @@ def resize(self, blob_content_length, timeout=None, request_id=None, lease_acces :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -795,6 +1065,7 @@ def resize(self, blob_content_length, timeout=None, request_id=None, lease_acces 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -812,7 +1083,7 @@ def update_sequence_number(self, sequence_number_action, timeout=None, blob_sequ should modify the blob's sequence number. Possible values include: 'max', 'update', 'increment' :type sequence_number_action: str or - ~blob.models.SequenceNumberActionType + ~azure.storage.blob.models.SequenceNumberActionType :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -828,17 +1099,18 @@ def update_sequence_number(self, sequence_number_action, timeout=None, blob_sequ :type request_id: str :param lease_access_conditions: Additional parameters for the operation - :type lease_access_conditions: ~blob.models.LeaseAccessConditions + :type lease_access_conditions: + ~azure.storage.blob.models.LeaseAccessConditions :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) lease_id = None @@ -905,6 +1177,7 @@ def update_sequence_number(self, sequence_number_action, timeout=None, blob_sequ 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), 'x-ms-blob-sequence-number': self._deserialize('long', response.headers.get('x-ms-blob-sequence-number')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -939,13 +1212,13 @@ def copy_incremental(self, copy_source, timeout=None, request_id=None, modified_ :param modified_access_conditions: Additional parameters for the operation :type modified_access_conditions: - ~blob.models.ModifiedAccessConditions + ~azure.storage.blob.models.ModifiedAccessConditions :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) if_modified_since = None @@ -1004,6 +1277,7 @@ def copy_incremental(self, copy_source, timeout=None, request_id=None, modified_ response_headers = { 'ETag': self._deserialize('str', response.headers.get('ETag')), 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py index 1ef90f16a57b..50ca1e443185 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/operations/_service_operations.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -43,7 +42,7 @@ def set_properties(self, storage_service_properties, timeout=None, request_id=No :param storage_service_properties: The StorageService properties. :type storage_service_properties: - ~blob.models.StorageServiceProperties + ~azure.storage.blob.models.StorageServiceProperties :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -58,7 +57,7 @@ def set_properties(self, storage_service_properties, timeout=None, request_id=No :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "service" @@ -87,7 +86,7 @@ def set_properties(self, storage_service_properties, timeout=None, request_id=No # Construct body body_content = self._serialize.body(storage_service_properties, 'StorageServiceProperties') - + # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -99,6 +98,7 @@ def set_properties(self, storage_service_properties, timeout=None, request_id=No if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -123,9 +123,9 @@ def get_properties(self, timeout=None, request_id=None, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: StorageServiceProperties or the result of cls(response) - :rtype: ~blob.models.StorageServiceProperties + :rtype: ~azure.storage.blob.models.StorageServiceProperties :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "service" @@ -147,7 +147,7 @@ def get_properties(self, timeout=None, request_id=None, cls=None, **kwargs): # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -166,6 +166,7 @@ def get_properties(self, timeout=None, request_id=None, cls=None, **kwargs): if response.status_code == 200: deserialized = self._deserialize('StorageServiceProperties', response) header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -194,9 +195,9 @@ def get_statistics(self, timeout=None, request_id=None, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: StorageServiceStats or the result of cls(response) - :rtype: ~blob.models.StorageServiceStats + :rtype: ~azure.storage.blob.models.StorageServiceStats :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "service" @@ -218,7 +219,7 @@ def get_statistics(self, timeout=None, request_id=None, cls=None, **kwargs): # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -237,6 +238,7 @@ def get_statistics(self, timeout=None, request_id=None, cls=None, **kwargs): if response.status_code == 200: deserialized = self._deserialize('StorageServiceStats', response) header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -276,7 +278,8 @@ def list_containers_segment(self, prefix=None, marker=None, maxresults=None, inc :param include: Include this parameter to specify that the container's metadata be returned as part of the response body. Possible values include: 'metadata' - :type include: str or ~blob.models.ListContainersIncludeType + :type include: str or + ~azure.storage.blob.models.ListContainersIncludeType :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -289,9 +292,9 @@ def list_containers_segment(self, prefix=None, marker=None, maxresults=None, inc :param callable cls: A custom type or function that will be passed the direct response :return: ListContainersSegmentResponse or the result of cls(response) - :rtype: ~blob.models.ListContainersSegmentResponse + :rtype: ~azure.storage.blob.models.ListContainersSegmentResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "list" @@ -319,7 +322,7 @@ def list_containers_segment(self, prefix=None, marker=None, maxresults=None, inc # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/xml' + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if request_id is not None: header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') @@ -338,6 +341,7 @@ def list_containers_segment(self, prefix=None, marker=None, maxresults=None, inc if response.status_code == 200: deserialized = self._deserialize('ListContainersSegmentResponse', response) header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), @@ -349,6 +353,84 @@ def list_containers_segment(self, prefix=None, marker=None, maxresults=None, inc return deserialized list_containers_segment.metadata = {'url': '/'} + def get_user_delegation_key(self, key_info, timeout=None, request_id=None, cls=None, **kwargs): + """Retrieves a user delgation key for the Blob service. This is only a + valid operation when using bearer token authentication. + + :param key_info: + :type key_info: ~azure.storage.blob.models.KeyInfo + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param callable cls: A custom type or function that will be passed the + direct response + :return: UserDelegationKey or the result of cls(response) + :rtype: ~azure.storage.blob.models.UserDelegationKey + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + restype = "service" + comp = "userdelegationkey" + + # Construct URL + url = self.get_user_delegation_key.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['restype'] = self._serialize.query("restype", restype, 'str') + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' + header_parameters['Content-Type'] = 'application/xml; charset=utf-8' + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + + # Construct body + body_content = self._serialize.body(key_info, 'KeyInfo') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('UserDelegationKey', response) + header_dict = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + + if cls: + return cls(response, deserialized, header_dict) + + return deserialized + get_user_delegation_key.metadata = {'url': '/'} + def get_account_info(self, cls=None, **kwargs): """Returns the sku name and account kind . @@ -357,7 +439,7 @@ def get_account_info(self, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) restype = "account" @@ -390,6 +472,7 @@ def get_account_info(self, cls=None, **kwargs): if cls: response_headers = { + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), @@ -399,3 +482,100 @@ def get_account_info(self, cls=None, **kwargs): } return cls(response, None, response_headers) get_account_info.metadata = {'url': '/'} + + def filter_blobs(self, filter, marker=None, maxresults=None, timeout=None, request_id=None, cls=None, **kwargs): + """The Filter Blobs operation enables callers to list blobs in an account + whose tags match a given search expression. + + :param filter: The filter parameter enables the caller to query blobs + whose tags match a given expression. The given expression must + evaluate to true for a blob to be returned in the results. + :type filter: str + :param marker: A string value that identifies the portion of the list + of containers to be returned with the next listing operation. The + operation returns the NextMarker value within the response body if the + listing operation did not return all containers remaining to be listed + with the current page. The NextMarker value can be used as the value + for the marker parameter in a subsequent call to request the next page + of list items. The marker value is opaque to the client. + :type marker: str + :param maxresults: Specifies the maximum number of containers to + return. If the request does not specify maxresults, or specifies a + value greater than 5000, the server will return up to 5000 items. Note + that if the listing operation crosses a partition boundary, then the + service will return a continuation token for retrieving the remainder + of the results. For this reason, it is possible that the service will + return fewer results than specified by maxresults, or than the default + of 5000. + :type maxresults: int + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for Blob Service Operations. + :type timeout: int + :param request_id: Provides a client-generated, opaque value with a 1 + KB character limit that is recorded in the analytics logs when storage + analytics logging is enabled. + :type request_id: str + :param callable cls: A custom type or function that will be passed the + direct response + :return: FilterBlobsResponse or the result of cls(response) + :rtype: ~azure.storage.blob.models.FilterBlobsResponse + :raises: + :class:`StorageErrorException` + """ + error_map = kwargs.pop('error_map', None) + comp = "blobs" + + # Construct URL + url = self.filter_blobs.metadata['url'] + path_format_arguments = { + 'url': self._serialize.url("self._config.url", self._config.url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if marker is not None: + query_parameters['marker'] = self._serialize.query("marker", marker, 'str') + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', minimum=1) + query_parameters['filter'] = self._serialize.query("filter", filter, 'str') + if timeout is not None: + query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/xml, application/octet-stream, text/plain' + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if request_id is not None: + header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise models.StorageErrorException(response, self._deserialize) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FilterBlobsResponse', response) + header_dict = { + 'Content-Type': self._deserialize('str', response.headers.get('Content-Type')), + 'x-ms-client-request-id': self._deserialize('str', response.headers.get('x-ms-client-request-id')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + + if cls: + return cls(response, deserialized, header_dict) + + return deserialized + filter_blobs.metadata = {'url': '/'} diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/version.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/version.py index 343937d5bd70..9c89a27c160c 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/version.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_generated/version.py @@ -8,7 +8,6 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -VERSION = "2018-03-28" +VERSION = "2019-02-02" diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/models.py b/sdk/storage/azure-storage-blob/azure/storage/blob/models.py index d7c037d40931..9b9614dfa111 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/models.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/models.py @@ -413,6 +413,7 @@ def __init__(self, **kwargs): self.snapshot = kwargs.get('x-ms-snapshot') self.blob_type = BlobType(kwargs['x-ms-blob-type']) if kwargs.get('x-ms-blob-type') else None self.metadata = kwargs.get('metadata') + self.encrypted_metadata = kwargs.get('encrypted_metadata') self.last_modified = kwargs.get('Last-Modified') self.etag = kwargs.get('ETag') self.size = kwargs.get('Content-Length') @@ -441,7 +442,8 @@ def _from_generated(cls, generated): blob.etag = generated.properties.etag blob.deleted = generated.deleted blob.snapshot = generated.snapshot - blob.metadata = generated.metadata + blob.metadata = generated.metadata.additional_properties if generated.metadata else {} + blob.encrypted_metadata = generated.metadata.encrypted if generated.metadata else None blob.lease = LeaseProperties._from_generated(generated) # pylint: disable=protected-access blob.copy = CopyProperties._from_generated(generated) # pylint: disable=protected-access blob.last_modified = generated.properties.last_modified diff --git a/sdk/storage/azure-storage-blob/swagger/README.md b/sdk/storage/azure-storage-blob/swagger/README.md new file mode 100644 index 000000000000..eb41f44209f3 --- /dev/null +++ b/sdk/storage/azure-storage-blob/swagger/README.md @@ -0,0 +1,102 @@ +# Azure Blob Storage for Python + +> see https://aka.ms/autorest + +### Setup +```ps +cd C:\work +git clone --recursive https://github.com/Azure/autorest.python.git +cd autorest.python +git checkout azure-core +npm install +``` + +### Generation +```ps +cd +autorest --use=C:/work/autorest.python --version=2.0.4280 +``` + +### Settings +``` yaml +input-file: ./blob-2019-02-02.json +output-folder: ../azure/storage/blob/_generated +namespace: azure.storage.blob +no-namespace-folders: true +license-header: MICROSOFT_MIT_NO_VERSION +enable-xml: true +vanilla: true +clear-output-folder: true +python: true +``` + +### Remove x-ms-pageable +Currently breaking the latest version of autorest.python +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]..get + transform: > + if ($["x-ms-pageable"]) { delete $["x-ms-pageable"]; } +``` + +### Use strings for dates when python doesn't have enough precision +``` yaml +directive: +- from: swagger-document + where: $.definitions.AccessPolicy.properties + transform: > + $.Start.format = "str"; + $.Expiry.format = "str"; +``` + +### BlobTagFilter +``` yaml +directive: +- from: swagger-document + where: $.parameters.BlobTagFilter + transform: > + $["x-ms-parameter-location"] = "method"; +``` + +### PathRenameMode +``` yaml +directive: +- from: swagger-document + where: $.parameters.PathRenameMode + transform: > + $["x-ms-parameter-location"] = "method"; +``` + +### BlobHierarchyListSegment +``` yaml +directive: +- from: swagger-document + where: $.definitions.BlobHierarchyListSegment + transform: > + $.properties.BlobPrefixes.xml = { "name": "BlobPrefix" }; + $.properties.BlobItems.xml = { "name": "Blob" }; +``` + +### SignedIdentifier shouldn't require an AccessPolicy, only ID +``` yaml +directive: +- from: swagger-document + where: $.definitions.SignedIdentifier + transform: > + $.required = [ "Id" ]; +``` + +### Make AccessTier Unique +autorest.python complains that the same enum has different values +``` yaml +directive: +- from: swagger-document + where: $.parameters.AccessTierRequired + transform: > + $["x-ms-enum"].name = "AccessTierRequired"; +- from: swagger-document + where: $.parameters.AccessTierOptional + transform: > + $["x-ms-enum"].name = "AccessTierOptional"; +``` diff --git a/sdk/storage/azure-storage-blob/swagger/blob.json b/sdk/storage/azure-storage-blob/swagger/blob-2018-03-28.json similarity index 99% rename from sdk/storage/azure-storage-blob/swagger/blob.json rename to sdk/storage/azure-storage-blob/swagger/blob-2018-03-28.json index 6bb7a58c0d61..6f3758061fc7 100644 --- a/sdk/storage/azure-storage-blob/swagger/blob.json +++ b/sdk/storage/azure-storage-blob/swagger/blob-2018-03-28.json @@ -487,15 +487,6 @@ "operationId": "Container_GetProperties", "description": "returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs", "parameters": [ - { - "name": "comp", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "metadata" - ] - }, { "$ref": "#/parameters/Timeout" }, @@ -2290,15 +2281,6 @@ "operationId": "Blob_GetProperties", "description": "The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.", "parameters": [ - { - "name": "comp", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "metadata" - ] - }, { "$ref": "#/parameters/Snapshot" }, @@ -5765,12 +5747,12 @@ "Start": { "description": "the date-time the policy is active", "type": "string", - "format": "str" + "format": "date-time" }, "Expiry": { "description": "the date-time the policy expires", "type": "string", - "format": "str" + "format": "date-time" }, "Permission": { "description": "the permissions for the acl policy", diff --git a/sdk/storage/azure-storage-blob/swagger/blob-2018-11-09.json b/sdk/storage/azure-storage-blob/swagger/blob-2018-11-09.json new file mode 100644 index 000000000000..0c15ff232003 --- /dev/null +++ b/sdk/storage/azure-storage-blob/swagger/blob-2018-11-09.json @@ -0,0 +1,8010 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Blob Storage", + "version": "2018-11-09", + "x-ms-code-generation-settings": { + "header": "MIT", + "strictSpecAdherence": false + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{url}", + "useSchemePrefix": false, + "positionInOperation": "first", + "parameters": [ + { + "$ref": "#/parameters/Url" + } + ] + }, + "securityDefinitions": { + "blob_shared_key": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "schemes": [ + "https" + ], + "consumes": [ + "application/xml" + ], + "produces": [ + "application/xml" + ], + "paths": {}, + "x-ms-paths": { + "/?restype=service&comp=properties": { + "put": { + "tags": [ + "service" + ], + "operationId": "Service_SetProperties", + "description": "Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules", + "parameters": [ + { + "$ref": "#/parameters/StorageServiceProperties" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Success (Accepted)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetProperties", + "description": "gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/?restype=service&comp=stats": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetStatistics", + "description": "Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceStats" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "stats" + ] + } + ] + }, + "/?comp=list": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_ListContainersSegment", + "description": "The List Containers Segment operation returns a list of the containers under the specified account", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListContainersInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/ListContainersSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/?restype=service&comp=userdelegationkey": { + "post": { + "tags": [ + "service" + ], + "operationId": "Service_GetUserDelegationKey", + "description": "Retrieves a user delgation key for the Blob service. This is only a valid operation when using bearer token authentication.", + "parameters": [ + { + "$ref": "#/parameters/KeyInfo" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/UserDelegationKey" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "userdelegationkey" + ] + } + ] + }, + "/?restype=account&comp=properties": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}?restype=container": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_Create", + "description": "creates a new container under the specified account. If the container with the same name already exists, the operation fails", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/BlobPublicAccess" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "Success, Container created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetProperties", + "description": "returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-public-access": { + "x-ms-client-name": "BlobPublicAccess", + "description": "Indicated whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "x-ms-has-immutability-policy": { + "x-ms-client-name": "HasImmutabilityPolicy", + "description": "Indicates whether the container has an immutability policy set on it.", + "type": "boolean" + }, + "x-ms-has-legal-hold": { + "x-ms-client-name": "HasLegalHold", + "description": "Indicates whether the container has a legal hold.", + "type": "boolean" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "container" + ], + "operationId": "Container_Delete", + "description": "operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Accepted", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + } + ] + }, + "/{containerName}?restype=container&comp=metadata": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_SetMetadata", + "description": "operation sets one or more user-defined name-value pairs for the specified container.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{containerName}?restype=container&comp=acl": { + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetAccessPolicy", + "description": "gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-blob-public-access": { + "x-ms-client-name": "BlobPublicAccess", + "description": "Indicated whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "put": { + "tags": [ + "container" + ], + "operationId": "Container_SetAccessPolicy", + "description": "sets the permissions for the specified container. The permissions indicate whether blobs in a container may be accessed publicly.", + "parameters": [ + { + "$ref": "#/parameters/ContainerAcl" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobPublicAccess" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "acl" + ] + } + ] + }, + "/{containerName}?comp=lease&restype=container&acquire": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_AcquireLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseDuration" + }, + { + "$ref": "#/parameters/ProposedLeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The Acquire operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "acquire" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&release": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_ReleaseLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Release operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "release" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&renew": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_RenewLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Renew operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "renew" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&break": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_BreakLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseBreakPeriod" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The Break operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-time": { + "x-ms-client-name": "LeaseTime", + "type": "integer", + "description": "Approximate time remaining in the lease period, in seconds." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "break" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&change": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_ChangeLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/ProposedLeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Change operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "change" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?restype=container&comp=list&flat": { + "get": { + "tags": [ + "containers" + ], + "operationId": "Container_ListBlobFlatSegment", + "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListBlobsInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListBlobsFlatSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{containerName}?restype=container&comp=list&hierarchy": { + "get": { + "tags": [ + "containers" + ], + "operationId": "Container_ListBlobHierarchySegment", + "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Delimiter" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListBlobsInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListBlobsHierarchySegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{containerName}?restype=account&comp=properties": { + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}": { + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_Download", + "description": "The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/GetRangeContentMD5" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the content of the entire blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-blob-content-md5": { + "x-ms-client-name": "BlobContentMD5", + "type": "string", + "format": "byte", + "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" + } + }, + "schema": { + "type": "object", + "format": "file" + } + }, + "206": { + "description": "Returns the content of a specified range of the blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-blob-content-md5": { + "x-ms-client-name": "BlobContentMD5", + "type": "string", + "format": "byte", + "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" + } + }, + "schema": { + "type": "object", + "format": "file" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "head": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetProperties", + "description": "The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the properties of the blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-creation-time": { + "x-ms-client-name": "CreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was created." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-incremental-copy": { + "x-ms-client-name": "IsIncrementalCopy", + "type": "boolean", + "description": "Included if the blob is incremental copy blob." + }, + "x-ms-copy-destination-snapshot": { + "x-ms-client-name": "DestinationSnapshot", + "type": "string", + "description": "Included if the blob is incremental copy blob or incremental copy snapshot, if x-ms-copy-status is success. Snapshot time of the last successful incremental copy snapshot for this blob." + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The content type specified for the blob. The default content type is 'application/octet-stream'" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-access-tier": { + "x-ms-client-name": "AccessTier", + "type": "string", + "description": "The tier of page blob on a premium storage account or tier of block blob on blob storage LRS accounts. For a list of allowed premium page blob tiers, see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage#features. For blob storage LRS accounts, valid values are Hot/Cool/Archive." + }, + "x-ms-access-tier-inferred": { + "x-ms-client-name": "AccessTierInferred", + "type": "boolean", + "description": "For page blobs on a premium storage account only. If the access tier is not explicitly set on the blob, the tier is inferred based on its content length and this header will be returned with true value." + }, + "x-ms-archive-status": { + "x-ms-client-name": "ArchiveStatus", + "type": "string", + "description": "For blob storage LRS accounts, valid values are rehydrate-pending-to-hot/rehydrate-pending-to-cool. If the blob is being rehydrated and is not complete then this header is returned indicating that rehydrate is pending and also tells the destination tier." + }, + "x-ms-access-tier-change-time": { + "x-ms-client-name": "AccessTierChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the tier was changed on the object. This is only returned if the tier on the block blob was ever set." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "blob" + ], + "operationId": "Blob_Delete", + "description": "If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the \"include=deleted\" query parameter to discover which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 (ResourceNotFound).", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/DeleteSnapshots" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The delete request was accepted and the blob will be deleted.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + } + }, + "/{containerName}/{blob}?PageBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "PageBlob_Create", + "description": "The Create operation creates a new page blob.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentLengthRequired" + }, + { + "$ref": "#/parameters/BlobSequenceNumber" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "PageBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?AppendBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "AppendBlob_Create", + "description": "The Create Append Blob operation creates a new append blob.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?BlockBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "BlockBlob_Upload", + "description": "The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use the Put Block List operation.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was updated.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "BlockBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=undelete": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_Undelete", + "description": "Undelete a blob that was previously soft deleted", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The blob was undeleted successfully.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "undelete" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&SetHTTPHeaders": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetHTTPHeaders", + "description": "The Set HTTP Headers operation sets system properties on the blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The properties were set successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=metadata": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetMetadata", + "description": "The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value pairs", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The metadata was set successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{containerName}/{blob}?comp=lease&acquire": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_AcquireLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseDuration" + }, + { + "$ref": "#/parameters/ProposedLeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The Acquire operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "acquire" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&release": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_ReleaseLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Release operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "release" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&renew": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_RenewLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Renew operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "renew" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&change": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_ChangeLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/ProposedLeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Change operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "change" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&break": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_BreakLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseBreakPeriod" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The Break operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-time": { + "x-ms-client-name": "LeaseTime", + "type": "integer", + "description": "Approximate time remaining in the lease period, in seconds." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "break" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=snapshot": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_CreateSnapshot", + "description": "The Create Snapshot operation creates a read-only snapshot of a blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The snaptshot was taken successfully.", + "headers": { + "x-ms-snapshot": { + "x-ms-client-name": "Snapshot", + "type": "string", + "description": "Uniquely identifies the snapshot and indicates the snapshot version. It may be used in subsequent requests to access the snapshot" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "snapshot" + ] + } + ] + }, + "/{containerName}/{blob}?comp=copy": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_StartCopyFromURL", + "description": "The Start Copy From URL operation copies a blob or an internet resource to a new blob.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The copy blob has been accepted with the specified copy status.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{containerName}/{blob}?comp=copy&sync": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_CopyFromURL", + "description": "The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The copy has completed.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "success" + ], + "x-ms-enum": { + "name": "SyncCopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-requires-sync", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "true" + ] + } + ] + }, + "/{containerName}/{blob}?comp=copy©id={CopyId}": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_AbortCopyFromURL", + "description": "The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with zero length and full metadata.", + "parameters": [ + { + "$ref": "#/parameters/CopyId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "The delete request was accepted and the blob will be deleted.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "copy" + ] + }, + { + "name": "x-ms-copy-action", + "x-ms-client-name": "copyActionAbortConstant", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "abort" + ], + "x-ms-parameter-location": "method" + } + ] + }, + "/{containerName}/{blob}?comp=tier": { + "put": { + "tags": [ + "blobs" + ], + "operationId": "Blob_SetTier", + "description": "The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/AccessTier" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + } + ], + "responses": { + "200": { + "description": "The new tier will take effect immediately.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." + } + } + }, + "202": { + "description": "The transition to the new tier is pending.", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "tier" + ] + } + ] + }, + "/{containerName}/{blob}?restype=account&comp=properties": { + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=block": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_StageBlock", + "description": "The Stage Block operation creates a new block to be committed as part of a blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/BlockId" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "/{containerName}/{blob}?comp=block&fromURL": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_StageBlockFromURL", + "description": "The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL.", + "parameters": [ + { + "$ref": "#/parameters/BlockId" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRange" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "/{containerName}/{blob}?comp=blocklist": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_CommitBlockList", + "description": "The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. You can do this by specifying whether to commit a block from the committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong to.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "name": "blocks", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BlockLookupList" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block list was recorded.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_GetBlockList", + "description": "The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/BlockListType" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The page range was written.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Get Block List this is 'application/xml'" + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/BlockList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "blocklist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=page&update": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UploadPages", + "description": "The Upload Pages operation writes a range of pages to a page blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was written.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "update" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=page&clear": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_ClearPages", + "description": "The Clear Pages operation clears a set of pages from a page blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was cleared.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "clear" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=page&update&fromUrl": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UploadPagesFromURL", + "description": "The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRangeRequiredPutPageFromUrl" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/RangeRequiredPutPageFromUrl" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was written.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "update" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=pagelist": { + "get": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_GetPageRanges", + "description": "The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a page blob", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Information on the page blob was found.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "pagelist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=pagelist&diff": { + "get": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_GetPageRangesDiff", + "description": "The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were changed between target blob and previous snapshot.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/PrevSnapshot" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Information on the page blob was found.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "pagelist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&Resize": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_Resize", + "description": "Resize the Blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentLengthRequired" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Blob was resized successfully", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&UpdateSequenceNumber": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UpdateSequenceNumber", + "description": "Update the sequence number of the blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SequenceNumberAction" + }, + { + "$ref": "#/parameters/BlobSequenceNumber" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The sequence numbers were updated successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=incrementalcopy": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_CopyIncremental", + "description": "The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot is copied such that only the differential changes between the previously copied snapshot are transferred to the destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. This API is supported since REST version 2016-05-31.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The blob was copied.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "incrementalcopy" + ] + } + ] + }, + "/{containerName}/{blob}?comp=appendblock": { + "put": { + "tags": [ + "appendblob" + ], + "consumes": [ + "application/octet-stream" + ], + "operationId": "AppendBlob_AppendBlock", + "description": "The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobConditionMaxSize" + }, + { + "$ref": "#/parameters/BlobConditionAppendPos" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-append-offset": { + "x-ms-client-name": "BlobAppendOffset", + "type": "string", + "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "appendblock" + ] + } + ] + }, + "/{containerName}/{blob}?comp=appendblock&fromUrl": { + "put": { + "tags": [ + "appendblob" + ], + "operationId": "AppendBlob_AppendBlockFromUrl", + "description": "The Append Block operation commits a new block of data to the end of an existing append blob where the contents are read from a source url. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", + "parameters": [ + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRange" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobConditionMaxSize" + }, + { + "$ref": "#/parameters/BlobConditionAppendPos" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-append-offset": { + "x-ms-client-name": "BlobAppendOffset", + "type": "string", + "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "appendblock" + ] + } + ] + } + }, + "definitions": { + "KeyInfo": { + "type": "object", + "required": [ + "Start", + "Expiry" + ], + "description": "Key information", + "properties": { + "Start": { + "description": "The date-time the key is active in ISO 8601 UTC time", + "type": "string" + }, + "Expiry": { + "description": "The date-time the key expires in ISO 8601 UTC time", + "type": "string" + } + } + }, + "UserDelegationKey": { + "type": "object", + "required": [ + "SignedOid", + "SignedTid", + "SignedStart", + "SignedExpiry", + "SignedService", + "SignedVersion", + "Value" + ], + "description": "A user delegation key", + "properties": { + "SignedOid": { + "description": "The Azure Active Directory object ID in GUID format.", + "type": "string" + }, + "SignedTid": { + "description": "The Azure Active Directory tenant ID in GUID format", + "type": "string" + }, + "SignedStart": { + "description": "The date-time the key is active", + "type": "string", + "format": "date-time" + }, + "SignedExpiry": { + "description": "The date-time the key expires", + "type": "string", + "format": "date-time" + }, + "SignedService": { + "description": "Abbreviation of the Azure Storage service that accepts the key", + "type": "string" + }, + "SignedVersion": { + "description": "The service version that created the key", + "type": "string" + }, + "Value": { + "description": "The key as a base64 string", + "type": "string" + } + } + }, + "PublicAccessType": { + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "CopyStatus": { + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "LeaseDuration": { + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "LeaseState": { + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "LeaseStatus": { + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "StorageError": { + "type": "object", + "properties": { + "Code": { + "type": "string" + }, + "Message": { + "type": "string" + } + } + }, + "AccessPolicy": { + "type": "object", + "required": [ + "Start", + "Expiry", + "Permission" + ], + "description": "An Access policy", + "properties": { + "Start": { + "description": "the date-time the policy is active", + "type": "string", + "format": "date-time" + }, + "Expiry": { + "description": "the date-time the policy expires", + "type": "string", + "format": "date-time" + }, + "Permission": { + "description": "the permissions for the acl policy", + "type": "string" + } + } + }, + "AccessTier": { + "type": "string", + "enum": [ + "P4", + "P6", + "P10", + "P20", + "P30", + "P40", + "P50", + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + } + }, + "ArchiveStatus": { + "type": "string", + "enum": [ + "rehydrate-pending-to-hot", + "rehydrate-pending-to-cool" + ], + "x-ms-enum": { + "name": "ArchiveStatus", + "modelAsString": true + } + }, + "BlobItem": { + "xml": { + "name": "Blob" + }, + "description": "An Azure Storage blob", + "type": "object", + "required": [ + "Name", + "Deleted", + "Snapshot", + "Properties" + ], + "properties": { + "Name": { + "type": "string" + }, + "Deleted": { + "type": "boolean" + }, + "Snapshot": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/BlobProperties" + }, + "Metadata": { + "$ref": "#/definitions/Metadata" + } + } + }, + "BlobProperties": { + "xml": { + "name": "Properties" + }, + "description": "Properties of a blob", + "type": "object", + "required": [ + "Etag", + "Last-Modified" + ], + "properties": { + "Creation-Time": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Etag": { + "type": "string", + "format": "etag" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "Size in bytes" + }, + "Content-Type": { + "type": "string" + }, + "Content-Encoding": { + "type": "string" + }, + "Content-Language": { + "type": "string" + }, + "Content-MD5": { + "type": "string", + "format": "byte" + }, + "Content-Disposition": { + "type": "string" + }, + "Cache-Control": { + "type": "string" + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "blobSequenceNumber", + "type": "integer", + "format": "int64" + }, + "BlobType": { + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "LeaseStatus": { + "$ref": "#/definitions/LeaseStatus" + }, + "LeaseState": { + "$ref": "#/definitions/LeaseState" + }, + "LeaseDuration": { + "$ref": "#/definitions/LeaseDuration" + }, + "CopyId": { + "type": "string" + }, + "CopyStatus": { + "$ref": "#/definitions/CopyStatus" + }, + "CopySource": { + "type": "string" + }, + "CopyProgress": { + "type": "string" + }, + "CopyCompletionTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "CopyStatusDescription": { + "type": "string" + }, + "ServerEncrypted": { + "type": "boolean" + }, + "IncrementalCopy": { + "type": "boolean" + }, + "DestinationSnapshot": { + "type": "string" + }, + "DeletedTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "RemainingRetentionDays": { + "type": "integer" + }, + "AccessTier": { + "$ref": "#/definitions/AccessTier" + }, + "AccessTierInferred": { + "type": "boolean" + }, + "ArchiveStatus": { + "$ref": "#/definitions/ArchiveStatus" + }, + "AccessTierChangeTime": { + "type": "string", + "format": "date-time-rfc1123" + } + } + }, + "ListBlobsFlatSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerName", + "Segment" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ContainerName": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Delimiter": { + "type": "string" + }, + "Segment": { + "$ref": "#/definitions/BlobFlatListSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "ListBlobsHierarchySegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerName", + "Segment" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ContainerName": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Delimiter": { + "type": "string" + }, + "Segment": { + "$ref": "#/definitions/BlobHierarchyListSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "BlobFlatListSegment": { + "xml": { + "name": "Blobs" + }, + "required": [ + "BlobItems" + ], + "type": "object", + "properties": { + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobItem" + } + } + } + }, + "BlobHierarchyListSegment": { + "xml": { + "name": "Blobs" + }, + "type": "object", + "required": [ + "BlobItems" + ], + "properties": { + "BlobPrefixes": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobPrefix" + } + }, + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobItem" + } + } + } + }, + "BlobPrefix": { + "type": "object", + "required": [ + "Name" + ], + "properties": { + "Name": { + "type": "string" + } + } + }, + "Block": { + "type": "object", + "required": [ + "Name", + "Size" + ], + "description": "Represents a single block in a block blob. It describes the block's ID and size.", + "properties": { + "Name": { + "description": "The base64 encoded block ID.", + "type": "string" + }, + "Size": { + "description": "The block size in bytes.", + "type": "integer" + } + } + }, + "BlockList": { + "type": "object", + "properties": { + "CommittedBlocks": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Block" + } + }, + "UncommittedBlocks": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Block" + } + } + } + }, + "BlockLookupList": { + "type": "object", + "properties": { + "Committed": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Committed" + } + } + }, + "Uncommitted": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Uncommitted" + } + } + }, + "Latest": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Latest" + } + } + } + }, + "xml": { + "name": "BlockList" + } + }, + "ContainerItem": { + "xml": { + "name": "Container" + }, + "type": "object", + "required": [ + "Name", + "Properties" + ], + "description": "An Azure Storage container", + "properties": { + "Name": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/ContainerProperties" + }, + "Metadata": { + "$ref": "#/definitions/Metadata" + } + } + }, + "ContainerProperties": { + "type": "object", + "required": [ + "Last-Modified", + "Etag" + ], + "description": "Properties of a container", + "properties": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Etag": { + "type": "string", + "format": "etag" + }, + "LeaseStatus": { + "$ref": "#/definitions/LeaseStatus" + }, + "LeaseState": { + "$ref": "#/definitions/LeaseState" + }, + "LeaseDuration": { + "$ref": "#/definitions/LeaseDuration" + }, + "PublicAccess": { + "$ref": "#/definitions/PublicAccessType" + }, + "HasImmutabilityPolicy": { + "type": "boolean" + }, + "HasLegalHold": { + "type": "boolean" + } + } + }, + "ListContainersSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of containers", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerItems" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "ContainerItems": { + "xml": { + "wrapped": true, + "name": "Containers" + }, + "type": "array", + "items": { + "$ref": "#/definitions/ContainerItem" + } + }, + "NextMarker": { + "type": "string" + } + } + }, + "CorsRule": { + "description": "CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain", + "type": "object", + "required": [ + "AllowedOrigins", + "AllowedMethods", + "AllowedHeaders", + "ExposedHeaders", + "MaxAgeInSeconds" + ], + "properties": { + "AllowedOrigins": { + "description": "The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.", + "type": "string" + }, + "AllowedMethods": { + "description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated)", + "type": "string" + }, + "AllowedHeaders": { + "description": "the request headers that the origin domain may specify on the CORS request.", + "type": "string" + }, + "ExposedHeaders": { + "description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer", + "type": "string" + }, + "MaxAgeInSeconds": { + "description": "The maximum amount time that a browser should cache the preflight OPTIONS request.", + "type": "integer", + "minimum": 0 + } + } + }, + "ErrorCode": { + "description": "Error codes returned by the service", + "type": "string", + "enum": [ + "AccountAlreadyExists", + "AccountBeingCreated", + "AccountIsDisabled", + "AuthenticationFailed", + "AuthorizationFailure", + "ConditionHeadersNotSupported", + "ConditionNotMet", + "EmptyMetadataKey", + "InsufficientAccountPermissions", + "InternalError", + "InvalidAuthenticationInfo", + "InvalidHeaderValue", + "InvalidHttpVerb", + "InvalidInput", + "InvalidMd5", + "InvalidMetadata", + "InvalidQueryParameterValue", + "InvalidRange", + "InvalidResourceName", + "InvalidUri", + "InvalidXmlDocument", + "InvalidXmlNodeValue", + "Md5Mismatch", + "MetadataTooLarge", + "MissingContentLengthHeader", + "MissingRequiredQueryParameter", + "MissingRequiredHeader", + "MissingRequiredXmlNode", + "MultipleConditionHeadersNotSupported", + "OperationTimedOut", + "OutOfRangeInput", + "OutOfRangeQueryParameterValue", + "RequestBodyTooLarge", + "ResourceTypeMismatch", + "RequestUrlFailedToParse", + "ResourceAlreadyExists", + "ResourceNotFound", + "ServerBusy", + "UnsupportedHeader", + "UnsupportedXmlNode", + "UnsupportedQueryParameter", + "UnsupportedHttpVerb", + "AppendPositionConditionNotMet", + "BlobAlreadyExists", + "BlobNotFound", + "BlobOverwritten", + "BlobTierInadequateForContentLength", + "BlockCountExceedsLimit", + "BlockListTooLong", + "CannotChangeToLowerTier", + "CannotVerifyCopySource", + "ContainerAlreadyExists", + "ContainerBeingDeleted", + "ContainerDisabled", + "ContainerNotFound", + "ContentLengthLargerThanTierLimit", + "CopyAcrossAccountsNotSupported", + "CopyIdMismatch", + "FeatureVersionMismatch", + "IncrementalCopyBlobMismatch", + "IncrementalCopyOfEralierVersionSnapshotNotAllowed", + "IncrementalCopySourceMustBeSnapshot", + "InfiniteLeaseDurationRequired", + "InvalidBlobOrBlock", + "InvalidBlobTier", + "InvalidBlobType", + "InvalidBlockId", + "InvalidBlockList", + "InvalidOperation", + "InvalidPageRange", + "InvalidSourceBlobType", + "InvalidSourceBlobUrl", + "InvalidVersionForPageBlobOperation", + "LeaseAlreadyPresent", + "LeaseAlreadyBroken", + "LeaseIdMismatchWithBlobOperation", + "LeaseIdMismatchWithContainerOperation", + "LeaseIdMismatchWithLeaseOperation", + "LeaseIdMissing", + "LeaseIsBreakingAndCannotBeAcquired", + "LeaseIsBreakingAndCannotBeChanged", + "LeaseIsBrokenAndCannotBeRenewed", + "LeaseLost", + "LeaseNotPresentWithBlobOperation", + "LeaseNotPresentWithContainerOperation", + "LeaseNotPresentWithLeaseOperation", + "MaxBlobSizeConditionNotMet", + "NoPendingCopyOperation", + "OperationNotAllowedOnIncrementalCopyBlob", + "PendingCopyOperation", + "PreviousSnapshotCannotBeNewer", + "PreviousSnapshotNotFound", + "PreviousSnapshotOperationNotSupported", + "SequenceNumberConditionNotMet", + "SequenceNumberIncrementTooLarge", + "SnapshotCountExceeded", + "SnaphotOperationRateExceeded", + "SnapshotsPresent", + "SourceConditionNotMet", + "SystemInUse", + "TargetConditionNotMet", + "UnauthorizedBlobOverwrite", + "BlobBeingRehydrated", + "BlobArchived", + "BlobNotArchived" + ], + "x-ms-enum": { + "name": "StorageErrorCode", + "modelAsString": true + } + }, + "GeoReplication": { + "description": "Geo-Replication information for the Secondary Storage Service", + "type": "object", + "required": [ + "Status", + "LastSyncTime" + ], + "properties": { + "Status": { + "description": "The status of the secondary location", + "type": "string", + "enum": [ + "live", + "bootstrap", + "unavailable" + ], + "x-ms-enum": { + "name": "GeoReplicationStatusType", + "modelAsString": true + } + }, + "LastSyncTime": { + "description": "A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time may or may not be available for reads.", + "type": "string", + "format": "date-time-rfc1123" + } + } + }, + "Logging": { + "description": "Azure Analytics Logging settings.", + "type": "object", + "required": [ + "Version", + "Delete", + "Read", + "Write", + "RetentionPolicy" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Delete": { + "description": "Indicates whether all delete requests should be logged.", + "type": "boolean" + }, + "Read": { + "description": "Indicates whether all read requests should be logged.", + "type": "boolean" + }, + "Write": { + "description": "Indicates whether all write requests should be logged.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "Metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Metrics": { + "description": "a summary of request statistics grouped by API in hour or minute aggregates for blobs", + "required": [ + "Enabled" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Enabled": { + "description": "Indicates whether metrics are enabled for the Blob service.", + "type": "boolean" + }, + "IncludeAPIs": { + "description": "Indicates whether metrics should generate summary statistics for called API operations.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "PageList": { + "description": "the list of pages", + "type": "object", + "properties": { + "PageRange": { + "type": "array", + "items": { + "$ref": "#/definitions/PageRange" + } + }, + "ClearRange": { + "type": "array", + "items": { + "$ref": "#/definitions/ClearRange" + } + } + } + }, + "PageRange": { + "type": "object", + "required": [ + "Start", + "End" + ], + "properties": { + "Start": { + "type": "integer", + "format": "int64", + "xml": { + "name": "Start" + } + }, + "End": { + "type": "integer", + "format": "int64", + "xml": { + "name": "End" + } + } + }, + "xml": { + "name": "PageRange" + } + }, + "ClearRange": { + "type": "object", + "required": [ + "Start", + "End" + ], + "properties": { + "Start": { + "type": "integer", + "format": "int64", + "xml": { + "name": "Start" + } + }, + "End": { + "type": "integer", + "format": "int64", + "xml": { + "name": "End" + } + } + }, + "xml": { + "name": "ClearRange" + } + }, + "RetentionPolicy": { + "description": "the retention policy which determines how long the associated data should persist", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether a retention policy is enabled for the storage service", + "type": "boolean" + }, + "Days": { + "description": "Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted", + "type": "integer", + "minimum": 1 + } + } + }, + "SignedIdentifier": { + "xml": { + "name": "SignedIdentifier" + }, + "description": "signed identifier", + "type": "object", + "required": [ + "Id", + "AccessPolicy" + ], + "properties": { + "Id": { + "type": "string", + "description": "a unique id" + }, + "AccessPolicy": { + "$ref": "#/definitions/AccessPolicy" + } + } + }, + "SignedIdentifiers": { + "description": "a collection of signed identifiers", + "type": "array", + "items": { + "$ref": "#/definitions/SignedIdentifier" + }, + "xml": { + "wrapped": true, + "name": "SignedIdentifiers" + } + }, + "StaticWebsite": { + "description": "The properties that enable an account to host a static website", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether this account is hosting a static website", + "type": "boolean" + }, + "IndexDocument": { + "description": "The default name of the index page under each directory", + "type": "string" + }, + "ErrorDocument404Path": { + "description": "The absolute path of the custom 404 page", + "type": "string" + } + } + }, + "StorageServiceProperties": { + "description": "Storage Service Properties.", + "type": "object", + "properties": { + "Logging": { + "$ref": "#/definitions/Logging" + }, + "HourMetrics": { + "$ref": "#/definitions/Metrics" + }, + "MinuteMetrics": { + "$ref": "#/definitions/Metrics" + }, + "Cors": { + "description": "The set of CORS rules.", + "type": "array", + "items": { + "$ref": "#/definitions/CorsRule" + }, + "xml": { + "wrapped": true + } + }, + "DefaultServiceVersion": { + "description": "The default version to use for requests to the Blob service if an incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent versions", + "type": "string" + }, + "DeleteRetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + }, + "StaticWebsite": { + "$ref": "#/definitions/StaticWebsite" + } + } + }, + "StorageServiceStats": { + "description": "Stats for the storage service.", + "type": "object", + "properties": { + "GeoReplication": { + "$ref": "#/definitions/GeoReplication" + } + } + } + }, + "parameters": { + "Url": { + "name": "url", + "description": "The URL of the service account, container, or blob that is the targe of the desired operation.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "ApiVersionParameter": { + "name": "x-ms-version", + "x-ms-client-name": "version", + "in": "header", + "required": true, + "type": "string", + "description": "Specifies the version of the operation to use for this request.", + "enum": [ + "2018-11-09" + ] + }, + "Blob": { + "name": "blob", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9]+(?:/[a-zA-Z0-9]+)*(?:\\.[a-zA-Z0-9]+){0,1}$", + "minLength": 1, + "maxLength": 1024, + "x-ms-parameter-location": "method", + "description": "The blob name." + }, + "BlobCacheControl": { + "name": "x-ms-blob-cache-control", + "x-ms-client-name": "blobCacheControl", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's cache control. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobConditionAppendPos": { + "name": "x-ms-blob-condition-appendpos", + "x-ms-client-name": "appendPosition", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "append-position-access-conditions" + }, + "description": "Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed)." + }, + "BlobConditionMaxSize": { + "name": "x-ms-blob-condition-maxsize", + "x-ms-client-name": "maxSize", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "append-position-access-conditions" + }, + "description": "Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed)." + }, + "BlobPublicAccess": { + "name": "x-ms-blob-public-access", + "x-ms-client-name": "access", + "in": "header", + "required": false, + "x-ms-parameter-location": "method", + "description": "Specifies whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "AccessTier": { + "name": "x-ms-access-tier", + "x-ms-client-name": "tier", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "P4", + "P6", + "P10", + "P20", + "P30", + "P40", + "P50", + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + }, + "x-ms-parameter-location": "method", + "description": "Indicates the tier to be set on the blob." + }, + "BlobContentDisposition": { + "name": "x-ms-blob-content-disposition", + "x-ms-client-name": "blobContentDisposition", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's Content-Disposition header." + }, + "BlobContentEncoding": { + "name": "x-ms-blob-content-encoding", + "x-ms-client-name": "blobContentEncoding", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's content encoding. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobContentLanguage": { + "name": "x-ms-blob-content-language", + "x-ms-client-name": "blobContentLanguage", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Set the blob's content language. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobContentLengthOptional": { + "name": "x-ms-blob-content-length", + "x-ms-client-name": "blobContentLength", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." + }, + "BlobContentLengthRequired": { + "name": "x-ms-blob-content-length", + "x-ms-client-name": "blobContentLength", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." + }, + "BlobContentMD5": { + "name": "x-ms-blob-content-md5", + "x-ms-client-name": "blobContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. An MD5 hash of the blob content. Note that this hash is not validated, as the hashes for the individual blocks were validated when each was uploaded." + }, + "BlobContentType": { + "name": "x-ms-blob-content-type", + "x-ms-client-name": "blobContentType", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's content type. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobSequenceNumber": { + "name": "x-ms-blob-sequence-number", + "x-ms-client-name": "blobSequenceNumber", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "default": 0, + "x-ms-parameter-location": "method", + "description": "Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1." + }, + "BlockId": { + "name": "blockid", + "x-ms-client-name": "blockId", + "in": "query", + "type": "string", + "required": true, + "x-ms-parameter-location": "method", + "description": "A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block." + }, + "BlockListType": { + "name": "blocklisttype", + "x-ms-client-name": "listType", + "in": "query", + "required": true, + "default": "committed", + "x-ms-parameter-location": "method", + "description": "Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together.", + "type": "string", + "enum": [ + "committed", + "uncommitted", + "all" + ], + "x-ms-enum": { + "name": "BlockListType", + "modelAsString": false + } + }, + "Body": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "format": "file" + }, + "x-ms-parameter-location": "method", + "description": "Initial data" + }, + "ContainerAcl": { + "name": "containerAcl", + "in": "body", + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + }, + "x-ms-parameter-location": "method", + "description": "the acls for the container" + }, + "CopyId": { + "name": "copyid", + "x-ms-client-name": "copyId", + "in": "query", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation." + }, + "ClientRequestId": { + "name": "x-ms-client-request-id", + "x-ms-client-name": "requestId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled." + }, + "ContainerName": { + "name": "containerName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The container name." + }, + + "ContentLength": { + "name": "Content-Length", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "The length of the request." + }, + "ContentMD5": { + "name": "Content-MD5", + "x-ms-client-name": "transactionalContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the transactional md5 for the body, to be validated by the service." + }, + "CopySource": { + "name": "x-ms-copy-source", + "x-ms-client-name": "copySource", + "in": "header", + "required": true, + "type": "string", + "format": "url", + "x-ms-parameter-location": "method", + "description": "Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature." + }, + "DeleteSnapshots": { + "name": "x-ms-delete-snapshots", + "x-ms-client-name": "deleteSnapshots", + "description": "Required if the blob has associated snapshots. Specify one of the following two options: include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob itself", + "x-ms-parameter-location": "method", + "in": "header", + "required": false, + "type": "string", + "enum": [ + "include", + "only" + ], + "x-ms-enum": { + "name": "DeleteSnapshotsOptionType", + "modelAsString": false + } + }, + "Delimiter": { + "name": "delimiter", + "description": "When the request includes this parameter, the operation returns a BlobPrefix element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string.", + "type": "string", + "x-ms-parameter-location": "method", + "in": "query", + "required": true + }, + "GetRangeContentMD5": { + "name": "x-ms-range-get-content-md5", + "x-ms-client-name": "rangeGetContentMD5", + "in": "header", + "required": false, + "type": "boolean", + "x-ms-parameter-location": "method", + "description": "When set to true and specified together with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size." + }, + "IfMatch": { + "name": "If-Match", + "x-ms-client-name": "ifMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs with a matching value." + }, + "IfModifiedSince": { + "name": "If-Modified-Since", + "x-ms-client-name": "ifModifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." + }, + "IfNoneMatch": { + "name": "If-None-Match", + "x-ms-client-name": "ifNoneMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs without a matching value." + }, + "IfUnmodifiedSince": { + "name": "If-Unmodified-Since", + "x-ms-client-name": "ifUnmodifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." + }, + "IfSequenceNumberEqualTo": { + "name": "x-ms-if-sequence-number-eq", + "x-ms-client-name": "ifSequenceNumberEqualTo", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has the specified sequence number." + }, + "IfSequenceNumberLessThan": { + "name": "x-ms-if-sequence-number-lt", + "x-ms-client-name": "ifSequenceNumberLessThan", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has a sequence number less than the specified." + }, + "IfSequenceNumberLessThanOrEqualTo": { + "name": "x-ms-if-sequence-number-le", + "x-ms-client-name": "ifSequenceNumberLessThanOrEqualTo", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has a sequence number less than or equal to the specified." + }, + "KeyInfo": { + "name": "KeyInfo", + "in": "body", + "x-ms-parameter-location": "method", + "required": true, + "schema": { + "$ref": "#/definitions/KeyInfo" + } + }, + "ListBlobsInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "array", + "collectionFormat": "csv", + "items": { + "type": "string", + "enum": [ + "copy", + "deleted", + "metadata", + "snapshots", + "uncommittedblobs" + ], + "x-ms-enum": { + "name": "ListBlobsIncludeItem", + "modelAsString": false + } + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify one or more datasets to include in the response." + }, + "ListContainersInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "metadata" + ], + "x-ms-enum": { + "name": "ListContainersIncludeType", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify that the container's metadata be returned as part of the response body." + }, + "LeaseBreakPeriod": { + "name": "x-ms-lease-break-period", + "x-ms-client-name": "breakPeriod", + "in": "header", + "required": false, + "type": "integer", + "x-ms-parameter-location": "method", + "description": "For a break operation, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. If longer, the time remaining on the lease is used. A new lease will not be available before the break period has expired, but the lease may be held for longer than the break period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks immediately." + }, + "LeaseDuration": { + "name": "x-ms-lease-duration", + "x-ms-client-name": "duration", + "in": "header", + "required": false, + "type": "integer", + "x-ms-parameter-location": "method", + "description": "Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change." + }, + "LeaseIdOptional": { + "name": "x-ms-lease-id", + "x-ms-client-name": "leaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "lease-access-conditions" + }, + "description": "If specified, the operation only succeeds if the resource's lease is active and matches this ID." + }, + "LeaseIdRequired": { + "name": "x-ms-lease-id", + "x-ms-client-name": "leaseId", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Specifies the current lease ID on the resource." + }, + "Marker": { + "name": "marker", + "in": "query", + "required": false, + "type": "string", + "description": "A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client.", + "x-ms-parameter-location": "method" + }, + "MaxResults": { + "name": "maxresults", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method", + "description": "Specifies the maximum number of containers to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000." + }, + "Metadata": { + "name": "x-ms-meta", + "x-ms-client-name": "metadata", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information.", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Prefix": { + "name": "prefix", + "in": "query", + "required": false, + "type": "string", + "description": "Filters the results to return only containers whose name begins with the specified prefix.", + "x-ms-parameter-location": "method" + }, + "PrevSnapshot": { + "name": "prevsnapshot", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional in version 2015-07-08 and newer. The prevsnapshot parameter is a DateTime value that specifies that the response will contain only pages that were changed between target blob and previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot specified by prevsnapshot is the older of the two. Note that incremental snapshots are currently supported only for blobs created on or after January 1, 2016." + }, + "ProposedLeaseIdOptional": { + "name": "x-ms-proposed-lease-id", + "x-ms-client-name": "proposedLeaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." + }, + "ProposedLeaseIdRequired": { + "name": "x-ms-proposed-lease-id", + "x-ms-client-name": "proposedLeaseId", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." + }, + "Range": { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Return only the bytes of the blob in the specified range." + }, + "RangeRequiredPutPageFromUrl": { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The range of bytes to which the source range would be written. The range should be 512 aligned and range-end is required." + }, + "SequenceNumberAction": { + "name": "x-ms-sequence-number-action", + "x-ms-client-name": "sequenceNumberAction", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required if the x-ms-blob-sequence-number header is set for the request. This property applies to page blobs only. This property indicates how the service should modify the blob's sequence number", + "type": "string", + "enum": [ + "max", + "update", + "increment" + ], + "x-ms-enum": { + "name": "SequenceNumberActionType", + "modelAsString": false + } + }, + "Snapshot": { + "name": "snapshot", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see Creating a Snapshot of a Blob." + }, + "SourceContentMD5": { + "name": "x-ms-source-content-md5", + "x-ms-client-name": "sourceContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the md5 calculated for the range of bytes that must be read from the copy source." + }, + "SourceRange": { + "name": "x-ms-source-range", + "x-ms-client-name": "sourceRange", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Bytes of source data in the specified range." + }, + "SourceRangeRequiredPutPageFromUrl": { + "name": "x-ms-source-range", + "x-ms-client-name": "sourceRange", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Bytes of source data in the specified range. The length of this range should match the ContentLength header and x-ms-range/Range destination range header." + }, + "SourceIfMatch": { + "name": "x-ms-source-if-match", + "x-ms-client-name": "sourceIfMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs with a matching value." + }, + "SourceIfModifiedSince": { + "name": "x-ms-source-if-modified-since", + "x-ms-client-name": "sourceIfModifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." + }, + "SourceIfNoneMatch": { + "name": "x-ms-source-if-none-match", + "x-ms-client-name": "sourceIfNoneMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs without a matching value." + }, + "SourceIfUnmodifiedSince": { + "name": "x-ms-source-if-unmodified-since", + "x-ms-client-name": "sourceIfUnmodifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." + }, + "SourceLeaseId": { + "name": "x-ms-source-lease-id", + "x-ms-client-name": "sourceLeaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match." + }, + "SourceUrl": { + "name": "x-ms-copy-source", + "x-ms-client-name": "sourceUrl", + "in": "header", + "required": true, + "type": "string", + "format": "url", + "x-ms-parameter-location": "method", + "description": "Specify a URL to the copy source." + }, + "StorageServiceProperties": { + "name": "StorageServiceProperties", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + }, + "x-ms-parameter-location": "method", + "description": "The StorageService properties." + }, + "Timeout": { + "name": "timeout", + "in": "query", + "required": false, + "type": "integer", + "minimum": 0, + "x-ms-parameter-location": "method", + "description": "The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations." + } + } + } + \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/swagger/blob-2019-02-02.json b/sdk/storage/azure-storage-blob/swagger/blob-2019-02-02.json new file mode 100644 index 000000000000..18ae16c45ec5 --- /dev/null +++ b/sdk/storage/azure-storage-blob/swagger/blob-2019-02-02.json @@ -0,0 +1,9974 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Blob Storage", + "version": "2019-02-02", + "x-ms-code-generation-settings": { + "header": "MIT", + "strictSpecAdherence": false + } + }, + "x-ms-parameterized-host": { + "hostTemplate": "{url}", + "useSchemePrefix": false, + "positionInOperation": "first", + "parameters": [ + { + "$ref": "#/parameters/Url" + } + ] + }, + "securityDefinitions": { + "blob_shared_key": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "schemes": [ + "https" + ], + "consumes": [ + "application/xml", + "application/octet-stream", + "text/plain" + ], + "produces": [ + "application/xml", + "application/octet-stream", + "text/plain" + ], + "paths": {}, + "x-ms-paths": { + "/?restype=service&comp=properties": { + "put": { + "tags": [ + "service" + ], + "operationId": "Service_SetProperties", + "description": "Sets properties for a storage account's Blob service endpoint, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules", + "parameters": [ + { + "$ref": "#/parameters/StorageServiceProperties" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Success (Accepted)", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetProperties", + "description": "gets the properties of a storage account's Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/?restype=service&comp=stats": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetStatistics", + "description": "Retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication is enabled for the storage account.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/StorageServiceStats" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "stats" + ] + } + ] + }, + "/?comp=list": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_ListContainersSegment", + "description": "The List Containers Segment operation returns a list of the containers under the specified account", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListContainersInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + } + }, + "schema": { + "$ref": "#/definitions/ListContainersSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/?restype=service&comp=userdelegationkey": { + "post": { + "tags": [ + "service" + ], + "operationId": "Service_GetUserDelegationKey", + "description": "Retrieves a user delgation key for the Blob service. This is only a valid operation when using bearer token authentication.", + "parameters": [ + { + "$ref": "#/parameters/KeyInfo" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/UserDelegationKey" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "service" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "userdelegationkey" + ] + } + ] + }, + "/?restype=account&comp=properties": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/?comp=blobs": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_FilterBlobs", + "description": "The Filter Blobs operation enables callers to list blobs in an account whose tags match a given search expression.", + "parameters": [ + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/BlobTagFilter" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Filter Blobs this is 'application/xml'" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/FilterBlobsResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "blobs" + ] + } + ] + }, + "/{containerName}?restype=container": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_Create", + "description": "creates a new container under the specified account. If the container with the same name already exists, the operation fails", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/BlobPublicAccess" + }, + { + "$ref": "#/parameters/DefaultEncryptionScope" + }, + { + "$ref": "#/parameters/DenyEncryptionScopeOverride" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "Success, Container created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetProperties", + "description": "returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-public-access": { + "x-ms-client-name": "BlobPublicAccess", + "description": "Indicated whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "x-ms-default-encryption-scope": { + "x-ms-client-name": "DefaultEncryptionScope", + "type": "string", + "description": "Default encryption scope on this container" + }, + "x-ms-deny-encryption-scope-override": { + "x-ms-client-name": "DenyEncryptionScopeOverride", + "type": "boolean", + "description": "Whether to reject the write request with encryption scope" + }, + "x-ms-has-immutability-policy": { + "x-ms-client-name": "HasImmutabilityPolicy", + "description": "Indicates whether the container has an immutability policy set on it.", + "type": "boolean" + }, + "x-ms-has-legal-hold": { + "x-ms-client-name": "HasLegalHold", + "description": "Indicates whether the container has a legal hold.", + "type": "boolean" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "container" + ], + "operationId": "Container_Delete", + "description": "operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "Accepted", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + } + ] + }, + "/{containerName}?restype=container&comp=metadata": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_SetMetadata", + "description": "operation sets one or more user-defined name-value pairs for the specified container.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{containerName}?restype=container&comp=acl": { + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetAccessPolicy", + "description": "gets the permissions for the specified container. The permissions indicate whether container data may be accessed publicly.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-blob-public-access": { + "x-ms-client-name": "BlobPublicAccess", + "description": "Indicated whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "put": { + "tags": [ + "container" + ], + "operationId": "Container_SetAccessPolicy", + "description": "sets the permissions for the specified container. The permissions indicate whether blobs in a container may be accessed publicly.", + "parameters": [ + { + "$ref": "#/parameters/ContainerAcl" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobPublicAccess" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "acl" + ] + } + ] + }, + "/{containerName}?comp=lease&restype=container&acquire": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_AcquireLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseDuration" + }, + { + "$ref": "#/parameters/ProposedLeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The Acquire operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "acquire" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&release": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_ReleaseLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Release operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "release" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&renew": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_RenewLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Renew operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "renew" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&break": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_BreakLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseBreakPeriod" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The Break operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-time": { + "x-ms-client-name": "LeaseTime", + "type": "integer", + "description": "Approximate time remaining in the lease period, in seconds." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "break" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?comp=lease&restype=container&change": { + "put": { + "tags": [ + "container" + ], + "operationId": "Container_ChangeLease", + "description": "[Update] establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/ProposedLeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Change operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a container's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "change" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}?restype=container&comp=list&flat": { + "get": { + "tags": [ + "containers" + ], + "operationId": "Container_ListBlobFlatSegment", + "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListBlobsInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListBlobsFlatSegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{containerName}?restype=container&comp=list&hierarchy": { + "get": { + "tags": [ + "containers" + ], + "operationId": "Container_ListBlobHierarchySegment", + "description": "[Update] The List Blobs operation returns a list of the blobs under the specified container", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Delimiter" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListBlobsInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For List Blobs this is 'application/xml'" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/ListBlobsHierarchySegmentResponse" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "NextMarker" + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "container" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{containerName}?restype=account&comp=properties": { + "get": { + "tags": [ + "container" + ], + "operationId": "Container_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{filesystem}/{path}?resource=directory&Create": { + "put": { + "tags": [ + "directory" + ], + "operationId": "Directory_Create", + "description": "Create a directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: \"*\".", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/DirectoryProperties" + }, + { + "$ref": "#/parameters/PosixPermissions" + }, + { + "$ref": "#/parameters/PosixUmask" + }, + { + "$ref": "#/parameters/XMsCacheControl" + }, + { + "$ref": "#/parameters/XMsContentType" + }, + { + "$ref": "#/parameters/XMsContentEncoding" + }, + { + "$ref": "#/parameters/XMsContentLanguage" + }, + { + "$ref": "#/parameters/XMsContentDisposition" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The file or directory was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "An HTTP entity tag associated with the file or directory." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The data and time the file or directory was last modified. Write operations on the file or directory update the last modified time." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The size of the resource in bytes." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + } + }, + "schema": { + "$ref": "#/definitions/DataLakeStorageError" + } + } + } + }, + "parameters": [ + { + "name": "resource", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "directory" + ] + } + ] + }, + "/{filesystem}/{path}?DirectoryRename": { + "put": { + "tags": [ + "directory" + ], + "operationId": "Directory_Rename", + "description": "Rename a directory. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: \"*\".", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Continuation" + }, + { + "$ref": "#/parameters/PathRenameMode" + }, + { + "$ref": "#/parameters/FileRenameSource" + }, + { + "$ref": "#/parameters/DirectoryProperties" + }, + { + "$ref": "#/parameters/PosixPermissions" + }, + { + "$ref": "#/parameters/PosixUmask" + }, + { + "$ref": "#/parameters/XMsCacheControl" + }, + { + "$ref": "#/parameters/XMsContentType" + }, + { + "$ref": "#/parameters/XMsContentEncoding" + }, + { + "$ref": "#/parameters/XMsContentLanguage" + }, + { + "$ref": "#/parameters/XMsContentDisposition" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/SourceLeaseId" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The directory was renamed.", + "headers": { + "x-ms-continuation": { + "x-ms-client-name": "marker", + "type": "string", + "description": "When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "An HTTP entity tag associated with the file or directory." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The data and time the file or directory was last modified. Write operations on the file or directory update the last modified time." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The size of the resource in bytes." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + } + }, + "schema": { + "$ref": "#/definitions/DataLakeStorageError" + } + } + } + } + }, + "/{filesystem}/{path}?DirectoryDelete": { + "delete": { + "tags": [ + "directory" + ], + "operationId": "Directory_Delete", + "description": "Deletes the directory", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/RecursiveDirectoryDelete" + }, + { + "$ref": "#/parameters/Continuation" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The directory was deleted.", + "headers": { + "x-ms-continuation": { + "x-ms-client-name": "marker", + "type": "string", + "description": "When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + } + }, + "schema": { + "$ref": "#/definitions/DataLakeStorageError" + } + } + } + } + }, + "/{containerName}/{blob}": { + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_Download", + "description": "The Download operation reads or downloads a blob from the system, including its metadata and properties. You can also call Download to read a snapshot or verison.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/GetRangeContentMD5" + }, + { + "$ref": "#/parameters/GetRangeContentCRC64" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the content of the entire blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + }, + "x-ms-blob-content-md5": { + "x-ms-client-name": "BlobContentMD5", + "type": "string", + "format": "byte", + "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" + }, + "x-ms-tag-count": { + "x-ms-client-name": "TagCount", + "type": "integer", + "description": "The number of tags corresponding to the blob." + } + }, + "schema": { + "type": "object", + "format": "file" + } + }, + "206": { + "description": "Returns the content of a specified range of the blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Download Blob this is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-content-crc64": { + "x-ms-client-name": "ContentCrc64", + "type": "string", + "format": "byte", + "description": "If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to true, then the request returns a crc64 for the range, as long as the range size is less than or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is specified in the same request, it will fail with 400(Bad Request)" + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-blob-content-md5": { + "x-ms-client-name": "BlobContentMD5", + "type": "string", + "format": "byte", + "description": "If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range" + }, + "x-ms-tag-count": { + "x-ms-client-name": "TagCount", + "type": "integer", + "description": "The number of tags corresponding to the blob." + } + }, + "schema": { + "type": "object", + "format": "file" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "head": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetProperties", + "description": "The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the properties of the blob.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-creation-time": { + "x-ms-client-name": "CreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was created." + }, + "x-ms-meta": { + "type": "string", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "x-ms-blob-type": { + "x-ms-client-name": "BlobType", + "description": "The blob's type.", + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status-description": { + "x-ms-client-name": "CopyStatusDescription", + "type": "string", + "description": "Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-progress": { + "x-ms-client-name": "CopyProgress", + "type": "string", + "description": "Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List" + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "x-ms-incremental-copy": { + "x-ms-client-name": "IsIncrementalCopy", + "type": "boolean", + "description": "Included if the blob is incremental copy blob." + }, + "x-ms-copy-destination-snapshot": { + "x-ms-client-name": "DestinationSnapshot", + "type": "string", + "description": "Included if the blob is incremental copy blob or incremental copy snapshot, if x-ms-copy-status is success. Snapshot time of the last successful incremental copy snapshot for this blob." + }, + "x-ms-lease-duration": { + "x-ms-client-name": "LeaseDuration", + "description": "When a blob is leased, specifies whether the lease is of infinite or fixed duration.", + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "x-ms-lease-state": { + "x-ms-client-name": "LeaseState", + "description": "Lease state of the blob.", + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "x-ms-lease-status": { + "x-ms-client-name": "LeaseStatus", + "description": "The current lease status of the blob.", + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The number of bytes present in the response body." + }, + "Content-Type": { + "type": "string", + "description": "The content type specified for the blob. The default content type is 'application/octet-stream'" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Encoding request header" + }, + "Content-Disposition": { + "type": "string", + "description": "This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified." + }, + "Content-Language": { + "type": "string", + "description": "This header returns the value that was specified for the Content-Language request header." + }, + "Cache-Control": { + "type": "string", + "description": "This header is returned if it was previously specified for the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial blob content." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted)." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the metadata. This header is only returned when the metadata was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the metadata. This header is only returned when the metadata was encrypted with customer specified encryption." + }, + "x-ms-access-tier": { + "x-ms-client-name": "AccessTier", + "type": "string", + "description": "The tier of page blob on a premium storage account or tier of block blob on blob storage LRS accounts. For a list of allowed premium page blob tiers, see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage#features. For blob storage LRS accounts, valid values are Hot/Cool/Archive." + }, + "x-ms-access-tier-inferred": { + "x-ms-client-name": "AccessTierInferred", + "type": "boolean", + "description": "For page blobs on a premium storage account only. If the access tier is not explicitly set on the blob, the tier is inferred based on its content length and this header will be returned with true value." + }, + "x-ms-archive-status": { + "x-ms-client-name": "ArchiveStatus", + "type": "string", + "description": "For blob storage LRS accounts, valid values are rehydrate-pending-to-hot/rehydrate-pending-to-cool. If the blob is being rehydrated and is not complete then this header is returned indicating that rehydrate is pending and also tells the destination tier." + }, + "x-ms-access-tier-change-time": { + "x-ms-client-name": "AccessTierChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "The time the tier was changed on the object. This is only returned if the tier on the block blob was ever set." + }, + "x-ms-tag-count": { + "x-ms-client-name": "TagCount", + "type": "integer", + "description": "The number of tags corresponding to the blob." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "blob" + ], + "operationId": "Blob_Delete", + "description": "If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently removed from the storage account. If the storage account's soft delete feature is enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible immediately. However, the blob service retains the blob or snapshot for the number of days specified by the DeleteRetentionPolicy section of [Storage service properties] (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is permanently removed from the storage account. Note that you continue to be charged for the soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the \"include=deleted\" query parameter to discover which blobs and snapshots have been soft deleted. You can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 (ResourceNotFound). If the storage account's automatic snapshot feature is enabled, then, when a blob is deleted, an automatic snapshot is created. The blob becomes inaccessible immediately. All other operations on the blob causes the service to return an HTTP status code of 404 (ResourceNotFound). You can access automatic snapshot using snapshot timestamp or version id. You can restore the blob by calling Put or Copy Blob API with automatic snapshot as source. Deleting automatic snapshot requires shared key or special SAS/RBAC permissions.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/DeleteSnapshots" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The delete request was accepted and the blob will be deleted.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + } + }, + "/{filesystem}/{path}?FileRename": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_Rename", + "description": "Rename a blob/file. By default, the destination is overwritten and if the destination already exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For more information, see [Specifying Conditional Headers for Blob Service Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). To fail if the destination already exists, use a conditional request with If-None-Match: \"*\".", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/PathRenameMode" + }, + { + "$ref": "#/parameters/FileRenameSource" + }, + { + "$ref": "#/parameters/DirectoryProperties" + }, + { + "$ref": "#/parameters/PosixPermissions" + }, + { + "$ref": "#/parameters/PosixUmask" + }, + { + "$ref": "#/parameters/XMsCacheControl" + }, + { + "$ref": "#/parameters/XMsContentType" + }, + { + "$ref": "#/parameters/XMsContentEncoding" + }, + { + "$ref": "#/parameters/XMsContentLanguage" + }, + { + "$ref": "#/parameters/XMsContentDisposition" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/SourceLeaseId" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The file was renamed.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "An HTTP entity tag associated with the file or directory." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The data and time the file or directory was last modified. Write operations on the file or directory update the last modified time." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The size of the resource in bytes." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "A UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "A server-generated UUID recorded in the analytics logs for troubleshooting and correlation." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "The version of the REST protocol used to process the request." + } + }, + "schema": { + "$ref": "#/definitions/DataLakeStorageError" + } + } + } + } + }, + "/{containerName}/{blob}?PageBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "PageBlob_Create", + "description": "The Create operation creates a new page blob.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentLengthRequired" + }, + { + "$ref": "#/parameters/BlobSequenceNumber" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "PageBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?AppendBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "AppendBlob_Create", + "description": "The Create Append Blob operation creates a new append blob.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?BlockBlob": { + "put": { + "tags": [ + "blob" + ], + "operationId": "BlockBlob_Upload", + "description": "The Upload Block Blob operation updates the content of an existing block blob. Updating an existing block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a partial update of the content of a block blob, use the Put Block List operation.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/AccessTierOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The blob was updated.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-blob-type", + "x-ms-client-name": "blobType", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Specifies the type of blob to create: block blob, page blob, or append blob.", + "type": "string", + "enum": [ + "BlockBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=undelete": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_Undelete", + "description": "Undelete a blob that was previously soft deleted", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The blob was undeleted successfully.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "undelete" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&SetHTTPHeaders": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetHTTPHeaders", + "description": "The Set HTTP Headers operation sets system properties on the blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The properties were set successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=metadata": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetMetadata", + "description": "The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more name-value pairs", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The metadata was set successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the metadata. This header is only returned when the metadata was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the metadata. This header is only returned when the when the metadata was with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{containerName}/{blob}?comp=lease&acquire": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_AcquireLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseDuration" + }, + { + "$ref": "#/parameters/ProposedLeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The Acquire operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "acquire" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&release": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_ReleaseLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Release operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "release" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&renew": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_RenewLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Renew operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "renew" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&change": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_ChangeLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdRequired" + }, + { + "$ref": "#/parameters/ProposedLeaseIdRequired" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Change operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-lease-id": { + "x-ms-client-name": "LeaseId", + "type": "string", + "description": "Uniquely identifies a blobs's lease" + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "change" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=lease&break": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_BreakLease", + "description": "[Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseBreakPeriod" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The Break operation completed successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the blob was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-lease-time": { + "x-ms-client-name": "LeaseTime", + "type": "integer", + "description": "Approximate time remaining in the lease period, in seconds." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "lease" + ] + }, + { + "name": "x-ms-lease-action", + "x-ms-client-name": "action", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "break" + ], + "x-ms-enum": { + "name": "LeaseAction", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Describes what lease action to take." + } + ] + }, + "/{containerName}/{blob}?comp=snapshot": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_CreateSnapshot", + "description": "The Create Snapshot operation creates a read-only snapshot of a blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The snaptshot was taken successfully.", + "headers": { + "x-ms-snapshot": { + "x-ms-client-name": "Snapshot", + "type": "string", + "description": "Uniquely identifies the snapshot and indicates the snapshot version. It may be used in subsequent requests to access the snapshot" + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "True if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise. For a snapshot request, this header is set to true when metadata was provided in the request and encrypted with a customer-provided key." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the source blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the source blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "snapshot" + ] + } + ] + }, + "/{containerName}/{blob}?comp=copy": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_StartCopyFromURL", + "description": "The Start Copy From URL operation copies a blob or an internet resource to a new blob.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/AccessTierOptional" + }, + { + "$ref": "#/parameters/RehydratePriority" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The copy blob has been accepted with the specified copy status.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [] + }, + "/{containerName}/{blob}?comp=copy&sync": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_CopyFromURL", + "description": "The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/AccessTierOptional" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The copy has completed.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies the version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "success" + ], + "x-ms-enum": { + "name": "SyncCopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "x-ms-requires-sync", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "true" + ] + } + ] + }, + "/{containerName}/{blob}?comp=copy©id={CopyId}": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_AbortCopyFromURL", + "description": "The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination blob with zero length and full metadata.", + "parameters": [ + { + "$ref": "#/parameters/CopyId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "The delete request was accepted and the blob will be deleted.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "copy" + ] + }, + { + "name": "x-ms-copy-action", + "x-ms-client-name": "copyActionAbortConstant", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "abort" + ], + "x-ms-parameter-location": "method" + } + ] + }, + "/{containerName}/{blob}?comp=tier": { + "put": { + "tags": [ + "blobs" + ], + "operationId": "Blob_SetTier", + "description": "The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/AccessTierRequired" + }, + { + "$ref": "#/parameters/RehydratePriority" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + } + ], + "responses": { + "200": { + "description": "The new tier will take effect immediately.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." + } + } + }, + "202": { + "description": "The transition to the new tier is pending.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and newer." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "tier" + ] + } + ] + }, + "/{containerName}/{blob}?restype=account&comp=properties": { + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetAccountInfo", + "description": "Returns the sku name and account kind ", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK)", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-sku-name": { + "x-ms-client-name": "SkuName", + "type": "string", + "enum": [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + }, + "description": "Identifies the sku name of the account" + }, + "x-ms-account-kind": { + "x-ms-client-name": "AccountKind", + "type": "string", + "enum": [ + "Storage", + "BlobStorage", + "StorageV2" + ], + "x-ms-enum": { + "name": "AccountKind", + "modelAsString": false + }, + "description": "Identifies the account kind" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "account" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=tags": { + "put": { + "tags": [ + "blob" + ], + "operationId": "Blob_SetTags", + "description": "The Set Blob Tags operation sets tags for the specified blob. This API is only supported in version 2018-11-09 and later.", + "parameters": [ + { + "$ref": "#/parameters/BlobTagsBody" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "204": { + "description": "The tags were set.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "blob" + ], + "operationId": "Blob_GetTags", + "description": "The Get Blob Tags operation returns all tags for the specified blob, snapshot, or version. This API is only supported in version 2018-11-09 and later.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Returns the tags.", + "headers": { + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/BlobTags" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "tags" + ] + } + ] + }, + "/{containerName}/{blob}?comp=block": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_StageBlock", + "description": "The Stage Block operation creates a new block to be committed as part of a blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/BlockId" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the block. This header is only returned when the block was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "/{containerName}/{blob}?comp=block&fromURL": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_StageBlockFromURL", + "description": "The Stage Block operation creates a new block to be committed as part of a blob where the contents are read from a URL.", + "parameters": [ + { + "$ref": "#/parameters/BlockId" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRange" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/SourceContentCRC64" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the block. This header is only returned when the block was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "block" + ] + } + ] + }, + "/{containerName}/{blob}?comp=blocklist": { + "put": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_CommitBlockList", + "description": "The Commit Block List operation writes a blob by specifying the list of block IDs that make up the blob. In order to be written as part of a blob, a block must have been successfully written to the server in a prior Put Block operation. You can call Put Block List to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. You can do this by specifying whether to commit a block from the committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong to.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/BlobCacheControl" + }, + { + "$ref": "#/parameters/BlobContentType" + }, + { + "$ref": "#/parameters/BlobContentEncoding" + }, + { + "$ref": "#/parameters/BlobContentLanguage" + }, + { + "$ref": "#/parameters/BlobContentMD5" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobContentDisposition" + }, + { + "$ref": "#/parameters/BlobTagsHeader" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/AccessTierOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "name": "blocks", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BlockLookupList" + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block list was recorded.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. This header refers to the content of the request, meaning, in this case, the list of blocks, and not the content of the blob itself." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. This header refers to the content of the request, meaning, in this case, the list of blocks, and not the content of the blob itself." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "x-ms-version-id": { + "x-ms-client-name": "VersionId", + "type": "string", + "description": "UTC date/time value generated by the service that identifies a version of the blob. This header is returned for requests made against version 2018-11-09 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the blob. This header is only returned when the blob was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "blockblob" + ], + "operationId": "BlockBlob_GetBlockList", + "description": "The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/BlockListType" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The page range was written.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Content-Type": { + "type": "string", + "description": "The media type of the body of the response. For Get Block List this is 'application/xml'" + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/BlockList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "blocklist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=page&update": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UploadPages", + "description": "The Upload Pages operation writes a range of pages to a page blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was written.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the pages. This header is only returned when the pages were encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the pages. This header is only returned when the pages were encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "update" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=page&clear": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_ClearPages", + "description": "The Clear Pages operation clears a set of pages from a page blob", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was cleared.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "clear" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=page&update&fromUrl": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UploadPagesFromURL", + "description": "The Upload Pages operation writes a range of pages to a page blob where the contents are read from a URL", + "consumes": [ + "application/octet-stream" + ], + "parameters": [ + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRangeRequiredPutPageFromUrl" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/SourceContentCRC64" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/RangeRequiredPutPageFromUrl" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThanOrEqualTo" + }, + { + "$ref": "#/parameters/IfSequenceNumberLessThan" + }, + { + "$ref": "#/parameters/IfSequenceNumberEqualTo" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The page range was written.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for the page blob." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "page" + ] + }, + { + "name": "x-ms-page-write", + "x-ms-client-name": "pageWrite", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required. You may specify one of the following options:\n - Update: Writes the bytes specified by the request body into the specified range. The Range and Content-Length headers must match to perform the update.\n - Clear: Clears the specified range and releases the space used in storage for that range. To clear a range, set the Content-Length header to zero, and the Range header to a value that indicates the range to clear, up to maximum blob size.", + "type": "string", + "enum": [ + "update" + ], + "x-ms-enum": { + "name": "PageWriteType", + "modelAsString": false + } + } + ] + }, + "/{containerName}/{blob}?comp=pagelist": { + "get": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_GetPageRanges", + "description": "The Get Page Ranges operation returns the list of valid page ranges for a page blob, version or snapshot of a page blob", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Information on the page blob was found.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "pagelist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=pagelist&diff": { + "get": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_GetPageRangesDiff", + "description": "[Update] The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were changed between target blob and previous snapshot or version.", + "parameters": [ + { + "$ref": "#/parameters/Snapshot" + }, + { + "$ref": "#/parameters/VersionId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/PrevSnapshot" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "Information on the page blob was found.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "x-ms-blob-content-length": { + "x-ms-client-name": "BlobContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the blob in bytes." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + }, + "schema": { + "$ref": "#/definitions/PageList" + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "pagelist" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&Resize": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_Resize", + "description": "Resize the Blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/BlobContentLengthRequired" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The Blob was resized successfully", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=properties&UpdateSequenceNumber": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_UpdateSequenceNumber", + "description": "Update the sequence number of the blob", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SequenceNumberAction" + }, + { + "$ref": "#/parameters/BlobSequenceNumber" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "200": { + "description": "The sequence numbers were updated successfully.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "BlobSequenceNumber", + "type": "integer", + "format": "int64", + "description": "The current sequence number for a page blob. This header is not returned for block blobs or append blobs" + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{containerName}/{blob}?comp=incrementalcopy": { + "put": { + "tags": [ + "pageblob" + ], + "operationId": "PageBlob_CopyIncremental", + "description": "The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. The snapshot is copied such that only the differential changes between the previously copied snapshot are transferred to the destination. The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual. This API is supported since REST version 2016-05-31.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "202": { + "description": "The blob was copied.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy." + }, + "x-ms-copy-status": { + "x-ms-client-name": "CopyStatus", + "description": "State of the copy operation identified by x-ms-copy-id.", + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "incrementalcopy" + ] + } + ] + }, + "/{containerName}/{blob}?comp=appendblock": { + "put": { + "tags": [ + "appendblob" + ], + "operationId": "AppendBlob_AppendBlock", + "description": "The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", + "parameters": [ + { + "$ref": "#/parameters/Body" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ContentCrc64" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobConditionMaxSize" + }, + { + "$ref": "#/parameters/BlobConditionAppendPos" + }, + { + "$ref": "#/parameters/EncryptionKey" + }, + { + "$ref": "#/parameters/EncryptionKeySha256" + }, + { + "$ref": "#/parameters/EncryptionAlgorithm" + }, + { + "$ref": "#/parameters/EncryptionScope" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-client-request-id": { + "x-ms-client-name": "ClientRequestId", + "type": "string", + "description": "If a client request id header is sent in the request, this header will be present in the response with the same value." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-append-offset": { + "x-ms-client-name": "BlobAppendOffset", + "type": "string", + "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + }, + "x-ms-request-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the contents of the request are successfully encrypted using the specified algorithm, and false otherwise." + }, + "x-ms-encryption-key-sha256": { + "x-ms-client-name": "EncryptionKeySha256", + "type": "string", + "description": "The SHA-256 hash of the encryption key used to encrypt the block. This header is only returned when the block was encrypted with a customer-provided key." + }, + "x-ms-encryption-scope": { + "x-ms-client-name": "EncryptionScope", + "type": "string", + "description": "The encryption scope used to encrypt the block. This header is only returned when the block was encrypted with customer specified encryption." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "appendblock" + ] + } + ] + }, + "/{containerName}/{blob}?comp=appendblock&fromUrl": { + "put": { + "tags": [ + "appendblob" + ], + "operationId": "AppendBlob_AppendBlockFromUrl", + "description": "The Append Block operation commits a new block of data to the end of an existing append blob where the contents are read from a source url. The Append Block operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.", + "parameters": [ + { + "$ref": "#/parameters/SourceUrl" + }, + { + "$ref": "#/parameters/SourceRange" + }, + { + "$ref": "#/parameters/SourceContentMD5" + }, + { + "$ref": "#/parameters/SourceContentCRC64" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/LeaseIdOptional" + }, + { + "$ref": "#/parameters/BlobConditionMaxSize" + }, + { + "$ref": "#/parameters/BlobConditionAppendPos" + }, + { + "$ref": "#/parameters/IfModifiedSince" + }, + { + "$ref": "#/parameters/IfUnmodifiedSince" + }, + { + "$ref": "#/parameters/IfMatch" + }, + { + "$ref": "#/parameters/IfNoneMatch" + }, + { + "$ref": "#/parameters/SourceIfModifiedSince" + }, + { + "$ref": "#/parameters/SourceIfUnmodifiedSince" + }, + { + "$ref": "#/parameters/SourceIfMatch" + }, + { + "$ref": "#/parameters/SourceIfNoneMatch" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ClientRequestId" + } + ], + "responses": { + "201": { + "description": "The block was created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity." + }, + "x-ms-content-crc64": { + "type": "string", + "format": "byte", + "description": "This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers." + }, + "x-ms-request-id": { + "x-ms-client-name": "RequestId", + "type": "string", + "description": "This header uniquely identifies the request that was made and can be used for troubleshooting the request." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above." + }, + "Date": { + "type": "string", + "format": "date-time-rfc1123", + "description": "UTC date/time value generated by the service that indicates the time at which the response was initiated" + }, + "x-ms-blob-append-offset": { + "x-ms-client-name": "BlobAppendOffset", + "type": "string", + "description": "This response header is returned only for append operations. It returns the offset at which the block was committed, in bytes." + }, + "x-ms-blob-committed-block-count": { + "x-ms-client-name": "BlobCommittedBlockCount", + "type": "integer", + "description": "The number of committed blocks present in the blob. This header is returned only for append blobs." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "appendblock" + ] + } + ] + } + }, + "definitions": { + "KeyInfo": { + "type": "object", + "required": [ + "Start", + "Expiry" + ], + "description": "Key information", + "properties": { + "Start": { + "description": "The date-time the key is active in ISO 8601 UTC time", + "type": "string" + }, + "Expiry": { + "description": "The date-time the key expires in ISO 8601 UTC time", + "type": "string" + } + } + }, + "UserDelegationKey": { + "type": "object", + "required": [ + "SignedOid", + "SignedTid", + "SignedStart", + "SignedExpiry", + "SignedService", + "SignedVersion", + "Value" + ], + "description": "A user delegation key", + "properties": { + "SignedOid": { + "description": "The Azure Active Directory object ID in GUID format.", + "type": "string" + }, + "SignedTid": { + "description": "The Azure Active Directory tenant ID in GUID format", + "type": "string" + }, + "SignedStart": { + "description": "The date-time the key is active", + "type": "string", + "format": "date-time" + }, + "SignedExpiry": { + "description": "The date-time the key expires", + "type": "string", + "format": "date-time" + }, + "SignedService": { + "description": "Abbreviation of the Azure Storage service that accepts the key", + "type": "string" + }, + "SignedVersion": { + "description": "The service version that created the key", + "type": "string" + }, + "Value": { + "description": "The key as a base64 string", + "type": "string" + } + } + }, + "PublicAccessType": { + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "CopyStatus": { + "type": "string", + "enum": [ + "pending", + "success", + "aborted", + "failed" + ], + "x-ms-enum": { + "name": "CopyStatusType", + "modelAsString": false + } + }, + "LeaseDuration": { + "type": "string", + "enum": [ + "infinite", + "fixed" + ], + "x-ms-enum": { + "name": "LeaseDurationType", + "modelAsString": false + } + }, + "LeaseState": { + "type": "string", + "enum": [ + "available", + "leased", + "expired", + "breaking", + "broken" + ], + "x-ms-enum": { + "name": "LeaseStateType", + "modelAsString": false + } + }, + "LeaseStatus": { + "type": "string", + "enum": [ + "locked", + "unlocked" + ], + "x-ms-enum": { + "name": "LeaseStatusType", + "modelAsString": false + } + }, + "StorageError": { + "type": "object", + "properties": { + "Message": { + "type": "string" + } + } + }, + "DataLakeStorageError": { + "type": "object", + "properties": { + "error": { + "description": "The service error response object.", + "properties": { + "code": { + "description": "The service error code.", + "type": "string" + }, + "message": { + "description": "The service error message.", + "type": "string" + } + } + } + } + }, + "AccessPolicy": { + "type": "object", + "required": [ + "Start", + "Expiry", + "Permission" + ], + "description": "An Access policy", + "properties": { + "Start": { + "description": "the date-time the policy is active", + "type": "string", + "format": "date-time" + }, + "Expiry": { + "description": "the date-time the policy expires", + "type": "string", + "format": "date-time" + }, + "Permission": { + "description": "the permissions for the acl policy", + "type": "string" + } + } + }, + "AccessTier": { + "type": "string", + "enum": [ + "P4", + "P6", + "P10", + "P20", + "P30", + "P40", + "P50", + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + } + }, + "ArchiveStatus": { + "type": "string", + "enum": [ + "rehydrate-pending-to-hot", + "rehydrate-pending-to-cool" + ], + "x-ms-enum": { + "name": "ArchiveStatus", + "modelAsString": true + } + }, + "BlobItem": { + "xml": { + "name": "Blob" + }, + "description": "An Azure Storage blob", + "type": "object", + "required": [ + "Name", + "Deleted", + "Snapshot", + "VersionId", + "Properties" + ], + "properties": { + "Name": { + "type": "string" + }, + "Deleted": { + "type": "boolean" + }, + "Snapshot": { + "type": "string" + }, + "VersionId": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/BlobProperties" + }, + "Metadata": { + "$ref": "#/definitions/BlobMetadata" + }, + "Tags": { + "$ref": "#/definitions/BlobTags" + } + } + }, + "BlobProperties": { + "xml": { + "name": "Properties" + }, + "description": "Properties of a blob", + "type": "object", + "required": [ + "Etag", + "Last-Modified", + "TagCount" + ], + "properties": { + "Creation-Time": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Etag": { + "type": "string", + "format": "etag" + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "Size in bytes" + }, + "Content-Type": { + "type": "string" + }, + "Content-Encoding": { + "type": "string" + }, + "Content-Language": { + "type": "string" + }, + "Content-MD5": { + "type": "string", + "format": "byte" + }, + "Content-Disposition": { + "type": "string" + }, + "Cache-Control": { + "type": "string" + }, + "x-ms-blob-sequence-number": { + "x-ms-client-name": "blobSequenceNumber", + "type": "integer", + "format": "int64" + }, + "BlobType": { + "type": "string", + "enum": [ + "BlockBlob", + "PageBlob", + "AppendBlob" + ], + "x-ms-enum": { + "name": "BlobType", + "modelAsString": false + } + }, + "LeaseStatus": { + "$ref": "#/definitions/LeaseStatus" + }, + "LeaseState": { + "$ref": "#/definitions/LeaseState" + }, + "LeaseDuration": { + "$ref": "#/definitions/LeaseDuration" + }, + "CopyId": { + "type": "string" + }, + "CopyStatus": { + "$ref": "#/definitions/CopyStatus" + }, + "CopySource": { + "type": "string" + }, + "CopyProgress": { + "type": "string" + }, + "CopyCompletionTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "CopyStatusDescription": { + "type": "string" + }, + "ServerEncrypted": { + "type": "boolean" + }, + "IncrementalCopy": { + "type": "boolean" + }, + "DestinationSnapshot": { + "type": "string" + }, + "DeletedTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "RemainingRetentionDays": { + "type": "integer" + }, + "AccessTier": { + "$ref": "#/definitions/AccessTier" + }, + "AccessTierInferred": { + "type": "boolean" + }, + "ArchiveStatus": { + "$ref": "#/definitions/ArchiveStatus" + }, + "CustomerProvidedKeySha256": { + "type": "string" + }, + "EncryptionScope": { + "type": "string" + }, + "AccessTierChangeTime": { + "type": "string", + "format": "date-time-rfc1123" + }, + "TagCount": { + "type": "integer", + "description": "The number of tags corresponding to the blob." + } + } + }, + "ListBlobsFlatSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerName", + "Segment" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ContainerName": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Delimiter": { + "type": "string" + }, + "Segment": { + "$ref": "#/definitions/BlobFlatListSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "ListBlobsHierarchySegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerName", + "Segment" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ContainerName": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Delimiter": { + "type": "string" + }, + "Segment": { + "$ref": "#/definitions/BlobHierarchyListSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "BlobFlatListSegment": { + "xml": { + "name": "Blobs" + }, + "required": [ + "BlobItems" + ], + "type": "object", + "properties": { + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobItem" + } + } + } + }, + "BlobHierarchyListSegment": { + "xml": { + "name": "Blobs" + }, + "type": "object", + "required": [ + "BlobItems" + ], + "properties": { + "BlobPrefixes": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobPrefix" + } + }, + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/BlobItem" + } + } + } + }, + "BlobPrefix": { + "type": "object", + "required": [ + "Name" + ], + "properties": { + "Name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "required": [ + "Key", + "Value" + ], + "description": "Represents a single user-provided tag.", + "properties": { + "Key": { + "description": "The tag name.", + "type": "string" + }, + "Value": { + "description": "The tag value.", + "type": "string" + } + } + }, + "BlobTags": { + "xml": { + "name": "Tags" + }, + "description": "XML containing key/value pairs representing the tags for the blob.", + "properties": { + "TagSet": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Tag" + } + } + } + }, + "Block": { + "type": "object", + "required": [ + "Name", + "Size" + ], + "description": "Represents a single block in a block blob. It describes the block's ID and size.", + "properties": { + "Name": { + "description": "The base64 encoded block ID.", + "type": "string" + }, + "Size": { + "description": "The block size in bytes.", + "type": "integer" + } + } + }, + "BlockList": { + "type": "object", + "properties": { + "CommittedBlocks": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Block" + } + }, + "UncommittedBlocks": { + "xml": { + "wrapped": true + }, + "type": "array", + "items": { + "$ref": "#/definitions/Block" + } + } + } + }, + "BlockLookupList": { + "type": "object", + "properties": { + "Committed": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Committed" + } + } + }, + "Uncommitted": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Uncommitted" + } + } + }, + "Latest": { + "type": "array", + "items": { + "type": "string", + "xml": { + "name": "Latest" + } + } + } + }, + "xml": { + "name": "BlockList" + } + }, + "ContainerItem": { + "xml": { + "name": "Container" + }, + "type": "object", + "required": [ + "Name", + "Properties" + ], + "description": "An Azure Storage container", + "properties": { + "Name": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/ContainerProperties" + }, + "Metadata": { + "$ref": "#/definitions/ContainerMetadata" + } + } + }, + "ContainerProperties": { + "type": "object", + "required": [ + "Last-Modified", + "Etag" + ], + "description": "Properties of a container", + "properties": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Etag": { + "type": "string", + "format": "etag" + }, + "LeaseStatus": { + "$ref": "#/definitions/LeaseStatus" + }, + "LeaseState": { + "$ref": "#/definitions/LeaseState" + }, + "LeaseDuration": { + "$ref": "#/definitions/LeaseDuration" + }, + "PublicAccess": { + "$ref": "#/definitions/PublicAccessType" + }, + "HasImmutabilityPolicy": { + "type": "boolean" + }, + "HasLegalHold": { + "type": "boolean" + } + } + }, + "ListContainersSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of containers", + "type": "object", + "required": [ + "ServiceEndpoint", + "ContainerItems" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "ContainerItems": { + "xml": { + "wrapped": true, + "name": "Containers" + }, + "type": "array", + "items": { + "$ref": "#/definitions/ContainerItem" + } + }, + "NextMarker": { + "type": "string" + } + } + }, + "CorsRule": { + "description": "CORS is an HTTP feature that enables a web application running under one domain to access resources in another domain. Web browsers implement a security restriction known as same-origin policy that prevents a web page from calling APIs in a different domain; CORS provides a secure way to allow one domain (the origin domain) to call APIs in another domain", + "type": "object", + "required": [ + "AllowedOrigins", + "AllowedMethods", + "AllowedHeaders", + "ExposedHeaders", + "MaxAgeInSeconds" + ], + "properties": { + "AllowedOrigins": { + "description": "The origin domains that are permitted to make a request against the storage service via CORS. The origin domain is the domain from which the request originates. Note that the origin must be an exact case-sensitive match with the origin that the user age sends to the service. You can also use the wildcard character '*' to allow all origin domains to make requests via CORS.", + "type": "string" + }, + "AllowedMethods": { + "description": "The methods (HTTP request verbs) that the origin domain may use for a CORS request. (comma separated)", + "type": "string" + }, + "AllowedHeaders": { + "description": "the request headers that the origin domain may specify on the CORS request.", + "type": "string" + }, + "ExposedHeaders": { + "description": "The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer", + "type": "string" + }, + "MaxAgeInSeconds": { + "description": "The maximum amount time that a browser should cache the preflight OPTIONS request.", + "type": "integer", + "minimum": 0 + } + } + }, + "ErrorCode": { + "description": "Error codes returned by the service", + "type": "string", + "enum": [ + "AccountAlreadyExists", + "AccountBeingCreated", + "AccountIsDisabled", + "AuthenticationFailed", + "ConditionHeadersNotSupported", + "ConditionNotMet", + "EmptyMetadataKey", + "InsufficientAccountPermissions", + "InternalError", + "InvalidAuthenticationInfo", + "InvalidHeaderValue", + "InvalidHttpVerb", + "InvalidInput", + "InvalidMd5", + "InvalidMetadata", + "InvalidQueryParameterValue", + "InvalidRange", + "InvalidResourceName", + "InvalidUri", + "InvalidXmlDocument", + "InvalidXmlNodeValue", + "Md5Mismatch", + "MetadataTooLarge", + "MissingContentLengthHeader", + "MissingRequiredQueryParameter", + "MissingRequiredHeader", + "MissingRequiredXmlNode", + "MultipleConditionHeadersNotSupported", + "OperationTimedOut", + "OutOfRangeInput", + "OutOfRangeQueryParameterValue", + "RequestBodyTooLarge", + "ResourceTypeMismatch", + "RequestUrlFailedToParse", + "ResourceAlreadyExists", + "ResourceNotFound", + "ServerBusy", + "UnsupportedHeader", + "UnsupportedXmlNode", + "UnsupportedQueryParameter", + "UnsupportedHttpVerb", + "AppendPositionConditionNotMet", + "BlobAlreadyExists", + "BlobNotFound", + "BlobOverwritten", + "BlobTierInadequateForContentLength", + "BlockCountExceedsLimit", + "BlockListTooLong", + "CannotChangeToLowerTier", + "CannotVerifyCopySource", + "ContainerAlreadyExists", + "ContainerBeingDeleted", + "ContainerDisabled", + "ContainerNotFound", + "ContentLengthLargerThanTierLimit", + "CopyAcrossAccountsNotSupported", + "CopyIdMismatch", + "FeatureVersionMismatch", + "IncrementalCopyBlobMismatch", + "IncrementalCopyOfEralierVersionSnapshotNotAllowed", + "IncrementalCopySourceMustBeSnapshot", + "InfiniteLeaseDurationRequired", + "InvalidBlobOrBlock", + "InvalidBlobTier", + "InvalidBlobType", + "InvalidBlockId", + "InvalidBlockList", + "InvalidOperation", + "InvalidPageRange", + "InvalidSourceBlobType", + "InvalidSourceBlobUrl", + "InvalidVersionForPageBlobOperation", + "LeaseAlreadyPresent", + "LeaseAlreadyBroken", + "LeaseIdMismatchWithBlobOperation", + "LeaseIdMismatchWithContainerOperation", + "LeaseIdMismatchWithLeaseOperation", + "LeaseIdMissing", + "LeaseIsBreakingAndCannotBeAcquired", + "LeaseIsBreakingAndCannotBeChanged", + "LeaseIsBrokenAndCannotBeRenewed", + "LeaseLost", + "LeaseNotPresentWithBlobOperation", + "LeaseNotPresentWithContainerOperation", + "LeaseNotPresentWithLeaseOperation", + "MaxBlobSizeConditionNotMet", + "NoPendingCopyOperation", + "OperationNotAllowedOnIncrementalCopyBlob", + "PendingCopyOperation", + "PreviousSnapshotCannotBeNewer", + "PreviousSnapshotNotFound", + "PreviousSnapshotOperationNotSupported", + "SequenceNumberConditionNotMet", + "SequenceNumberIncrementTooLarge", + "SnapshotCountExceeded", + "SnaphotOperationRateExceeded", + "SnapshotsPresent", + "SourceConditionNotMet", + "SystemInUse", + "TargetConditionNotMet", + "UnauthorizedBlobOverwrite", + "BlobBeingRehydrated", + "BlobArchived", + "BlobNotArchived" + ], + "x-ms-enum": { + "name": "StorageErrorCode", + "modelAsString": true + } + }, + "FilterBlobsItem": { + "xml": { + "name": "Blob" + }, + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "ContainerName": { + "type": "string" + }, + "TagValue": { + "type": "string" + } + } + }, + "FilterBlobsSegment": { + "xml": { + "name": "Blobs" + }, + "type": "object", + "properties": { + "BlobItems": { + "type": "array", + "items": { + "$ref": "#/definitions/FilterBlobsItem" + } + } + } + }, + "FilterBlobsResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of blobs which matched the filter.", + "type": "object", + "required": [ + "ServiceEndpoint", + "Filter", + "Segment", + "NextMarker" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Filter": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Segment": { + "$ref": "#/definitions/FilterBlobsSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "GeoReplication": { + "description": "Geo-Replication information for the Secondary Storage Service", + "type": "object", + "required": [ + "Status", + "LastSyncTime" + ], + "properties": { + "Status": { + "description": "The status of the secondary location", + "type": "string", + "enum": [ + "live", + "bootstrap", + "unavailable" + ], + "x-ms-enum": { + "name": "GeoReplicationStatusType", + "modelAsString": true + } + }, + "LastSyncTime": { + "description": "A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time may or may not be available for reads.", + "type": "string", + "format": "date-time-rfc1123" + } + } + }, + "Logging": { + "description": "Azure Analytics Logging settings.", + "type": "object", + "required": [ + "Version", + "Delete", + "Read", + "Write", + "RetentionPolicy" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Delete": { + "description": "Indicates whether all delete requests should be logged.", + "type": "boolean" + }, + "Read": { + "description": "Indicates whether all read requests should be logged.", + "type": "boolean" + }, + "Write": { + "description": "Indicates whether all write requests should be logged.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "ContainerMetadata": { + "type": "object", + "xml": { + "name": "Metadata" + }, + "additionalProperties": { + "type": "string" + } + }, + "BlobMetadata": { + "type": "object", + "xml": { + "name": "Metadata" + }, + "properties": { + "Encrypted": { + "type": "string", + "xml": { + "attribute": true + } + } + }, + "additionalProperties": { + "type": "string" + } + }, + "Metrics": { + "description": "a summary of request statistics grouped by API in hour or minute aggregates for blobs", + "required": [ + "Enabled" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Enabled": { + "description": "Indicates whether metrics are enabled for the Blob service.", + "type": "boolean" + }, + "IncludeAPIs": { + "description": "Indicates whether metrics should generate summary statistics for called API operations.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "PageList": { + "description": "the list of pages", + "type": "object", + "properties": { + "PageRange": { + "type": "array", + "items": { + "$ref": "#/definitions/PageRange" + } + }, + "ClearRange": { + "type": "array", + "items": { + "$ref": "#/definitions/ClearRange" + } + } + } + }, + "PageRange": { + "type": "object", + "required": [ + "Start", + "End" + ], + "properties": { + "Start": { + "type": "integer", + "format": "int64", + "xml": { + "name": "Start" + } + }, + "End": { + "type": "integer", + "format": "int64", + "xml": { + "name": "End" + } + } + }, + "xml": { + "name": "PageRange" + } + }, + "ClearRange": { + "type": "object", + "required": [ + "Start", + "End" + ], + "properties": { + "Start": { + "type": "integer", + "format": "int64", + "xml": { + "name": "Start" + } + }, + "End": { + "type": "integer", + "format": "int64", + "xml": { + "name": "End" + } + } + }, + "xml": { + "name": "ClearRange" + } + }, + "RetentionPolicy": { + "description": "the retention policy which determines how long the associated data should persist", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether a retention policy is enabled for the storage service", + "type": "boolean" + }, + "Days": { + "description": "Indicates the number of days that metrics or logging or soft-deleted data should be retained. All data older than this value will be deleted", + "type": "integer", + "minimum": 1 + } + } + }, + "SignedIdentifier": { + "xml": { + "name": "SignedIdentifier" + }, + "description": "signed identifier", + "type": "object", + "required": [ + "Id", + "AccessPolicy" + ], + "properties": { + "Id": { + "type": "string", + "description": "a unique id" + }, + "AccessPolicy": { + "$ref": "#/definitions/AccessPolicy" + } + } + }, + "SignedIdentifiers": { + "description": "a collection of signed identifiers", + "type": "array", + "items": { + "$ref": "#/definitions/SignedIdentifier" + }, + "xml": { + "wrapped": true, + "name": "SignedIdentifiers" + } + }, + "StaticWebsite": { + "description": "The properties that enable an account to host a static website", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether this account is hosting a static website", + "type": "boolean" + }, + "IndexDocument": { + "description": "The default name of the index page under each directory", + "type": "string" + }, + "ErrorDocument404Path": { + "description": "The absolute path of the custom 404 page", + "type": "string" + } + } + }, + "StorageServiceProperties": { + "description": "Storage Service Properties.", + "type": "object", + "properties": { + "Logging": { + "$ref": "#/definitions/Logging" + }, + "HourMetrics": { + "$ref": "#/definitions/Metrics" + }, + "MinuteMetrics": { + "$ref": "#/definitions/Metrics" + }, + "Cors": { + "description": "The set of CORS rules.", + "type": "array", + "items": { + "$ref": "#/definitions/CorsRule" + }, + "xml": { + "wrapped": true + } + }, + "DefaultServiceVersion": { + "description": "The default version to use for requests to the Blob service if an incoming request's version is not specified. Possible values include version 2008-10-27 and all more recent versions", + "type": "string" + }, + "DeleteRetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + }, + "StaticWebsite": { + "$ref": "#/definitions/StaticWebsite" + } + } + }, + "StorageServiceStats": { + "description": "Stats for the storage service.", + "type": "object", + "properties": { + "GeoReplication": { + "$ref": "#/definitions/GeoReplication" + } + } + } + }, + "parameters": { + "Url": { + "name": "url", + "description": "The URL of the service account, container, or blob that is the targe of the desired operation.", + "required": true, + "type": "string", + "in": "path", + "x-ms-skip-url-encoding": true + }, + "ApiVersionParameter": { + "name": "x-ms-version", + "x-ms-client-name": "version", + "in": "header", + "required": true, + "type": "string", + "description": "Specifies the version of the operation to use for this request.", + "enum": [ + "2019-02-02" + ] + }, + "Blob": { + "name": "blob", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9]+(?:/[a-zA-Z0-9]+)*(?:\\.[a-zA-Z0-9]+){0,1}$", + "minLength": 1, + "maxLength": 1024, + "x-ms-parameter-location": "method", + "description": "The blob name." + }, + "Filesystem": { + "name": "filesystem", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The filesystem name." + }, + "Path": { + "name": "path", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The namespace path to a file or directory." + }, + "BlobCacheControl": { + "name": "x-ms-blob-cache-control", + "x-ms-client-name": "blobCacheControl", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's cache control. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobConditionAppendPos": { + "name": "x-ms-blob-condition-appendpos", + "x-ms-client-name": "appendPosition", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "append-position-access-conditions" + }, + "description": "Optional conditional header, used only for the Append Block operation. A number indicating the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition Failed)." + }, + "BlobConditionMaxSize": { + "name": "x-ms-blob-condition-maxsize", + "x-ms-client-name": "maxSize", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "append-position-access-conditions" + }, + "description": "Optional conditional header. The max length in bytes permitted for the append blob. If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 - Precondition Failed)." + }, + "BlobPublicAccess": { + "name": "x-ms-blob-public-access", + "x-ms-client-name": "access", + "in": "header", + "required": false, + "x-ms-parameter-location": "method", + "description": "Specifies whether data in the container may be accessed publicly and the level of access", + "type": "string", + "enum": [ + "container", + "blob" + ], + "x-ms-enum": { + "name": "PublicAccessType", + "modelAsString": true + } + }, + "AccessTierRequired": { + "name": "x-ms-access-tier", + "x-ms-client-name": "tier", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "P4", + "P6", + "P10", + "P20", + "P30", + "P40", + "P50", + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + }, + "x-ms-parameter-location": "method", + "description": "Indicates the tier to be set on the blob." + }, + "AccessTierOptional": { + "name": "x-ms-access-tier", + "x-ms-client-name": "tier", + "in": "header", + "required": false, + "type": "string", + "enum": [ + "Hot", + "Cool", + "Archive" + ], + "x-ms-enum": { + "name": "AccessTier", + "modelAsString": true + }, + "x-ms-parameter-location": "method", + "description": "Optional. Indicates the tier to be set on the blob." + }, + "RehydratePriority": { + "name": "x-ms-rehydrate-priority", + "x-ms-client-name": "rehydratePriority", + "in": "header", + "required": false, + "type": "string", + "enum": [ + "High", + "Standard" + ], + "x-ms-enum": { + "name": "RehydratePriority", + "modelAsString": true + }, + "x-ms-parameter-location": "method", + "description": "Optional: Indicates the priority with which to rehydrate an archived blob." + }, + "BlobContentDisposition": { + "name": "x-ms-blob-content-disposition", + "x-ms-client-name": "blobContentDisposition", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's Content-Disposition header." + }, + "BlobContentEncoding": { + "name": "x-ms-blob-content-encoding", + "x-ms-client-name": "blobContentEncoding", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's content encoding. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobContentLanguage": { + "name": "x-ms-blob-content-language", + "x-ms-client-name": "blobContentLanguage", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Set the blob's content language. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobContentLengthOptional": { + "name": "x-ms-blob-content-length", + "x-ms-client-name": "blobContentLength", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." + }, + "BlobContentLengthRequired": { + "name": "x-ms-blob-content-length", + "x-ms-client-name": "blobContentLength", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned to a 512-byte boundary." + }, + "BlobContentMD5": { + "name": "x-ms-blob-content-md5", + "x-ms-client-name": "blobContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. An MD5 hash of the blob content. Note that this hash is not validated, as the hashes for the individual blocks were validated when each was uploaded." + }, + "BlobContentType": { + "name": "x-ms-blob-content-type", + "x-ms-client-name": "blobContentType", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "blob-HTTP-headers" + }, + "description": "Optional. Sets the blob's content type. If specified, this property is stored with the blob and returned with a read request." + }, + "BlobSequenceNumber": { + "name": "x-ms-blob-sequence-number", + "x-ms-client-name": "blobSequenceNumber", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "default": 0, + "x-ms-parameter-location": "method", + "description": "Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1." + }, + "BlobTagsBody": { + "name": "Tags", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/BlobTags" + }, + "x-ms-parameter-location": "method" + }, + "BlobTagsHeader": { + "name": "x-ms-tags", + "x-ms-client-name": "tags", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional. A URL encoded query param string which specifies the tags to be created with the Blob object. e.g. TagName1=TagValue1&TagName2=TagValue2. The x-ms-tags header may contain up to 2kb of tags." + }, + "BlobTagFilter": { + "name": "filter", + "in": "query", + "required": true, + "type": "string", + "x-m-parameter-location": "method", + "description": "The filter parameter enables the caller to query blobs whose tags match a given expression. The given expression must evaluate to true for a blob to be returned in the results." + }, + "BlockId": { + "name": "blockid", + "x-ms-client-name": "blockId", + "in": "query", + "type": "string", + "required": true, + "x-ms-parameter-location": "method", + "description": "A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockid parameter must be the same size for each block." + }, + "BlockListType": { + "name": "blocklisttype", + "x-ms-client-name": "listType", + "in": "query", + "required": true, + "default": "committed", + "x-ms-parameter-location": "method", + "description": "Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together.", + "type": "string", + "enum": [ + "committed", + "uncommitted", + "all" + ], + "x-ms-enum": { + "name": "BlockListType", + "modelAsString": false + } + }, + "Body": { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "format": "file" + }, + "x-ms-parameter-location": "method", + "description": "Initial data" + }, + "Continuation": { + "name": "continuation", + "x-ms-client-name": "marker", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory." + }, + "ContainerAcl": { + "name": "containerAcl", + "in": "body", + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + }, + "x-ms-parameter-location": "method", + "description": "the acls for the container" + }, + "CopyId": { + "name": "copyid", + "x-ms-client-name": "copyId", + "in": "query", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation." + }, + "ClientRequestId": { + "name": "x-ms-client-request-id", + "x-ms-client-name": "requestId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled." + }, + "ContainerName": { + "name": "containerName", + "in": "path", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The container name." + }, + "ContentCrc64": { + "name": "x-ms-content-crc64", + "x-ms-client-name": "transactionalContentCrc64", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the transactional crc64 for the body, to be validated by the service." + }, + "ContentLength": { + "name": "Content-Length", + "in": "header", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "description": "The length of the request." + }, + "ContentMD5": { + "name": "Content-MD5", + "x-ms-client-name": "transactionalContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the transactional md5 for the body, to be validated by the service." + }, + "CopySource": { + "name": "x-ms-copy-source", + "x-ms-client-name": "copySource", + "in": "header", + "required": true, + "type": "string", + "format": "url", + "x-ms-parameter-location": "method", + "description": "Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would appear in a request URI. The source blob must either be public or must be authenticated via a shared access signature." + }, + "DeleteSnapshots": { + "name": "x-ms-delete-snapshots", + "x-ms-client-name": "deleteSnapshots", + "description": "Required if the blob has associated snapshots. Specify one of the following two options: include: Delete the base blob and all of its snapshots. only: Delete only the blob's snapshots and not the blob itself", + "x-ms-parameter-location": "method", + "in": "header", + "required": false, + "type": "string", + "enum": [ + "include", + "only" + ], + "x-ms-enum": { + "name": "DeleteSnapshotsOptionType", + "modelAsString": false + } + }, + "Delimiter": { + "name": "delimiter", + "description": "When the request includes this parameter, the operation returns a BlobPrefix element in the response body that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string.", + "type": "string", + "x-ms-parameter-location": "method", + "in": "query", + "required": true + }, + "DirectoryProperties": { + "name": "x-ms-properties", + "description": "Optional. User-defined properties to be stored with the file or directory, in the format of a comma-separated list of name and value pairs \"n1=v1, n2=v2, ...\", where each value is base64 encoded.", + "x-ms-client-name": "directoryProperties", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "EncryptionKey": { + "name": "x-ms-encryption-key", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "description": "Optional. Specifies the encryption key to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services." + }, + "EncryptionScope": { + "name": "x-ms-encryption-scope", + "type": "string", + "in": "query", + "required": false, + "x-ms-client-name": "EncryptionScope", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "customer-provided-key-info" + }, + "description": "Optional. Specifies the encryption scope to use to encrypt the data provided in the request. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services." + }, + "EncryptionKeySha256": { + "name": "x-ms-encryption-key-sha256", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "description": "The SHA-256 hash of the provided encryption key. Must be provided if the x-ms-encryption-key header is provided." + }, + "EncryptionAlgorithm": { + "name": "x-ms-encryption-algorithm", + "type": "string", + "in": "query", + "required": false, + "enum": [ + "AES256" + ], + "x-ms-enum": { + "name": "EncryptionAlgorithmType", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "The algorithm used to produce the encryption key hash. Currently, the only accepted value is \"AES256\". Must be provided if the x-ms-encryption-key header is provided." + }, + "DefaultEncryptionScope": { + "name": "x-ms-default-encryption-scope", + "type": "string", + "in": "header", + "required": false, + "x-ms-client-name": "DefaultEncryptionScope", + "x-ms-parameter-location": "method", + "description": "Optional. Specifies the default encryption scope on the container. If not specified, encryption is performed with the root account encryption key. For more information, see Encryption at Rest for Azure Storage Services." + }, + "DenyEncryptionScopeOverride": { + "name": "x-ms-deny-encryption-scope-override", + "type": "boolean", + "in": "header", + "required": false, + "x-ms-client-name": "DenyEncryptionScopeOverride", + "x-ms-parameter-location": "method", + "description": "Optional. Specifies whether to deny encryption scope override provided in the request or not. If true, reject the request with encryption scope. If false, encryption is performed using encryption scope provided in the request. For more information, see Encryption at Rest for Azure Storage Services." + }, + "FileRenameSource": { + "name": "x-ms-rename-source", + "x-ms-client-name": "renameSource", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The file or directory to be renamed. The value must have the following format: \"/{filesysystem}/{path}\". If \"x-ms-properties\" is specified, the properties will overwrite the existing properties; otherwise, the existing properties will be preserved." + }, + "GetRangeContentMD5": { + "name": "x-ms-range-get-content-md5", + "x-ms-client-name": "rangeGetContentMD5", + "in": "header", + "required": false, + "type": "boolean", + "x-ms-parameter-location": "method", + "description": "When set to true and specified together with the Range, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size." + }, + "GetRangeContentCRC64": { + "name": "x-ms-range-get-content-crc64", + "x-ms-client-name": "rangeGetContentCRC64", + "in": "header", + "required": false, + "type": "boolean", + "x-ms-parameter-location": "method", + "description": "When set to true and specified together with the Range, the service returns the CRC64 hash for the range, as long as the range is less than or equal to 4 MB in size." + }, + "IfMatch": { + "name": "If-Match", + "x-ms-client-name": "ifMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs with a matching value." + }, + "IfModifiedSince": { + "name": "If-Modified-Since", + "x-ms-client-name": "ifModifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." + }, + "IfNoneMatch": { + "name": "If-None-Match", + "x-ms-client-name": "ifNoneMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs without a matching value." + }, + "IfUnmodifiedSince": { + "name": "If-Unmodified-Since", + "x-ms-client-name": "ifUnmodifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." + }, + "IfSequenceNumberEqualTo": { + "name": "x-ms-if-sequence-number-eq", + "x-ms-client-name": "ifSequenceNumberEqualTo", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has the specified sequence number." + }, + "IfSequenceNumberLessThan": { + "name": "x-ms-if-sequence-number-lt", + "x-ms-client-name": "ifSequenceNumberLessThan", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has a sequence number less than the specified." + }, + "IfSequenceNumberLessThanOrEqualTo": { + "name": "x-ms-if-sequence-number-le", + "x-ms-client-name": "ifSequenceNumberLessThanOrEqualTo", + "in": "header", + "required": false, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "sequence-number-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has a sequence number less than or equal to the specified." + }, + "KeyInfo": { + "name": "KeyInfo", + "in": "body", + "x-ms-parameter-location": "method", + "required": true, + "schema": { + "$ref": "#/definitions/KeyInfo" + } + }, + "ListBlobsInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "array", + "collectionFormat": "csv", + "items": { + "type": "string", + "enum": [ + "copy", + "deleted", + "metadata", + "snapshots", + "tags", + "uncommittedblobs" + ], + "x-ms-enum": { + "name": "ListBlobsIncludeItem", + "modelAsString": false + } + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify one or more datasets to include in the response." + }, + "ListContainersInclude": { + "name": "include", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "metadata" + ], + "x-ms-enum": { + "name": "ListContainersIncludeType", + "modelAsString": false + }, + "x-ms-parameter-location": "method", + "description": "Include this parameter to specify that the container's metadata be returned as part of the response body." + }, + "LeaseBreakPeriod": { + "name": "x-ms-lease-break-period", + "x-ms-client-name": "breakPeriod", + "in": "header", + "required": false, + "type": "integer", + "x-ms-parameter-location": "method", + "description": "For a break operation, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. This break period is only used if it is shorter than the time remaining on the lease. If longer, the time remaining on the lease is used. A new lease will not be available before the break period has expired, but the lease may be held for longer than the break period. If this header does not appear with a break operation, a fixed-duration lease breaks after the remaining lease period elapses, and an infinite lease breaks immediately." + }, + "LeaseDuration": { + "name": "x-ms-lease-duration", + "x-ms-client-name": "duration", + "in": "header", + "required": false, + "type": "integer", + "x-ms-parameter-location": "method", + "description": "Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change." + }, + "LeaseIdOptional": { + "name": "x-ms-lease-id", + "x-ms-client-name": "leaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "lease-access-conditions" + }, + "description": "If specified, the operation only succeeds if the resource's lease is active and matches this ID." + }, + "LeaseIdRequired": { + "name": "x-ms-lease-id", + "x-ms-client-name": "leaseId", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Specifies the current lease ID on the resource." + }, + "Marker": { + "name": "marker", + "in": "query", + "required": false, + "type": "string", + "description": "A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. The NextMarker value can be used as the value for the marker parameter in a subsequent call to request the next page of list items. The marker value is opaque to the client.", + "x-ms-parameter-location": "method" + }, + "MaxResults": { + "name": "maxresults", + "in": "query", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method", + "description": "Specifies the maximum number of containers to return. If the request does not specify maxresults, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remainder of the results. For this reason, it is possible that the service will return fewer results than specified by maxresults, or than the default of 5000." + }, + "Metadata": { + "name": "x-ms-meta", + "x-ms-client-name": "metadata", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob. If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata for more information.", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "PathRenameMode": { + "name": "mode", + "x-ms-client-name": "pathRenameMode", + "description": "Determines the behavior of the rename operation", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "legacy", + "posix" + ], + "x-ms-enum": { + "name": "PathRenameMode", + "modelAsString": false + } + }, + "PosixPermissions": { + "name": "x-ms-permissions", + "description": "Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported.", + "x-ms-client-name": "posixPermissions", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "PosixUmask": { + "name": "x-ms-umask", + "x-ms-client-name": "posixUmask", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Only valid if Hierarchical Namespace is enabled for the account. This umask restricts permission settings for file and directory, and will only be applied when default Acl does not exist in parent directory. If the umask bit has set, it means that the corresponding permission will be disabled. Otherwise the corresponding permission will be determined by the permission. A 4-digit octal notation (e.g. 0022) is supported here. If no umask was specified, a default umask - 0027 will be used." + }, + "Prefix": { + "name": "prefix", + "in": "query", + "required": false, + "type": "string", + "description": "Filters the results to return only containers whose name begins with the specified prefix.", + "x-ms-parameter-location": "method" + }, + "PrevSnapshot": { + "name": "prevsnapshot", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Optional in version 2015-07-08 and newer. The prevsnapshot parameter is a DateTime value that specifies that the response will contain only pages that were changed between target blob and previous snapshot. Changed pages include both updated and cleared pages. The target blob may be a snapshot, as long as the snapshot specified by prevsnapshot is the older of the two. Note that incremental snapshots are currently supported only for blobs created on or after January 1, 2016." + }, + "ProposedLeaseIdOptional": { + "name": "x-ms-proposed-lease-id", + "x-ms-client-name": "proposedLeaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." + }, + "ProposedLeaseIdRequired": { + "name": "x-ms-proposed-lease-id", + "x-ms-client-name": "proposedLeaseId", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID string formats." + }, + "Range": { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Return only the bytes of the blob in the specified range." + }, + "RecursiveDirectoryDelete": { + "name": "recursive", + "x-ms-client-name": "recursiveDirectoryDelete", + "in": "query", + "required": true, + "type": "boolean", + "x-ms-parameter-location": "method", + "description": "If \"true\", all paths beneath the directory will be deleted. If \"false\" and the directory is non-empty, an error occurs." + }, + "SequenceNumberAction": { + "name": "x-ms-sequence-number-action", + "x-ms-client-name": "sequenceNumberAction", + "in": "header", + "required": true, + "x-ms-parameter-location": "method", + "description": "Required if the x-ms-blob-sequence-number header is set for the request. This property applies to page blobs only. This property indicates how the service should modify the blob's sequence number", + "type": "string", + "enum": [ + "max", + "update", + "increment" + ], + "x-ms-enum": { + "name": "SequenceNumberActionType", + "modelAsString": false + } + }, + "Snapshot": { + "name": "snapshot", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more information on working with blob snapshots, see Creating a Snapshot of a Blob." + }, + "SourceContentMD5": { + "name": "x-ms-source-content-md5", + "x-ms-client-name": "sourceContentMD5", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the md5 calculated for the range of bytes that must be read from the copy source." + }, + "SourceContentCRC64": { + "name": "x-ms-source-content-crc64", + "x-ms-client-name": "sourceContentcrc64", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "description": "Specify the crc64 calculated for the range of bytes that must be read from the copy source." + }, + "SourceRange": { + "name": "x-ms-source-range", + "x-ms-client-name": "sourceRange", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Bytes of source data in the specified range." + }, + "RangeRequiredPutPageFromUrl": { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The range of bytes to which the source range would be written. The range should be 512 aligned and range-end is required." + }, + "SourceRangeRequiredPutPageFromUrl": { + "name": "x-ms-source-range", + "x-ms-client-name": "sourceRange", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Bytes of source data in the specified range. The length of this range should match the ContentLength header and x-ms-range/Range destination range header." + }, + "SourceIfMatch": { + "name": "x-ms-source-if-match", + "x-ms-client-name": "sourceIfMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs with a matching value." + }, + "SourceIfModifiedSince": { + "name": "x-ms-source-if-modified-since", + "x-ms-client-name": "sourceIfModifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has been modified since the specified date/time." + }, + "SourceIfNoneMatch": { + "name": "x-ms-source-if-none-match", + "x-ms-client-name": "sourceIfNoneMatch", + "in": "header", + "required": false, + "type": "string", + "format": "etag", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify an ETag value to operate only on blobs without a matching value." + }, + "SourceIfUnmodifiedSince": { + "name": "x-ms-source-if-unmodified-since", + "x-ms-client-name": "sourceIfUnmodifiedSince", + "in": "header", + "required": false, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify this header value to operate only on a blob if it has not been modified since the specified date/time." + }, + "SourceLeaseId": { + "name": "x-ms-source-lease-id", + "x-ms-client-name": "sourceLeaseId", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match." + }, + "SourceUrl": { + "name": "x-ms-copy-source", + "x-ms-client-name": "sourceUrl", + "in": "header", + "required": true, + "type": "string", + "format": "url", + "x-ms-parameter-location": "method", + "description": "Specify a URL to the copy source." + }, + "StorageServiceProperties": { + "name": "StorageServiceProperties", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + }, + "x-ms-parameter-location": "method", + "description": "The StorageService properties." + }, + "Timeout": { + "name": "timeout", + "in": "query", + "required": false, + "type": "integer", + "minimum": 0, + "x-ms-parameter-location": "method", + "description": "The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations." + }, + "VersionId": { + "name": "versionid", + "x-ms-client-name": "versionId", + "in": "query", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "description": "The version ID parameter is an opaque DateTime value that, when present, specifies the blob version to retrieve." + }, + "XMsCacheControl": { + "name": "x-ms-cache-control", + "x-ms-client-name": "cacheControl", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Cache control for given resource" + }, + "XMsContentType": { + "name": "x-ms-content-type", + "x-ms-client-name": "contentType", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Content type for given resource" + }, + "XMsContentEncoding": { + "name": "x-ms-content-encoding", + "x-ms-client-name": "contentEncoding", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Content encoding for given resource" + }, + "XMsContentLanguage": { + "name": "x-ms-content-language", + "x-ms-client-name": "contentLanguage", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Content language for given resource" + }, + "XMsContentDisposition": { + "name": "x-ms-content-disposition", + "x-ms-client-name": "contentDisposition", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "directory-http-headers" + }, + "description": "Content disposition for given resource" + } + } +} \ No newline at end of file diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_set_container_acl_with_empty_identifiers.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_set_container_acl_with_empty_identifiers.yaml new file mode 100644 index 000000000000..d97173097663 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_set_container_acl_with_empty_identifiers.yaml @@ -0,0 +1,144 @@ +interactions: +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.0.0b2 Python/3.7.4 (Windows-10-10.0.17763-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 8c1085a2-bef4-11e9-bcad-b831b5891408 + x-ms-date: + - Thu, 15 Aug 2019 00:35:14 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/containerf22818cb?restype=container + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Thu, 15 Aug 2019 00:35:15 GMT + ETag: + - '"0x8D721187110842F"' + Last-Modified: + - Thu, 15 Aug 2019 00:35:15 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 8c1085a2-bef4-11e9-bcad-b831b5891408 + x-ms-request-id: + - 098af1ee-a01e-002e-7101-53e4c7000000 + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: ' + + 01' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '172' + Content-Type: + - application/xml; charset=utf-8 + User-Agent: + - azsdk-python-storage-blob/12.0.0b2 Python/3.7.4 (Windows-10-10.0.17763-SP0) + x-ms-client-request-id: + - 8cf0245e-bef4-11e9-ae3c-b831b5891408 + x-ms-date: + - Thu, 15 Aug 2019 00:35:15 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/containerf22818cb?restype=container&comp=acl + response: + body: + string: '' + headers: + Content-Length: + - '0' + Date: + - Thu, 15 Aug 2019 00:35:15 GMT + ETag: + - '"0x8D72118713EA993"' + Last-Modified: + - Thu, 15 Aug 2019 00:35:15 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 8cf0245e-bef4-11e9-ae3c-b831b5891408 + x-ms-request-id: + - 098af281-a01e-002e-7801-53e4c7000000 + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml, application/octet-stream, text/plain + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.0.0b2 Python/3.7.4 (Windows-10-10.0.17763-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 8d2c88be-bef4-11e9-9b0a-b831b5891408 + x-ms-date: + - Thu, 15 Aug 2019 00:35:16 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://storagename.blob.core.windows.net/containerf22818cb?restype=container&comp=acl + response: + body: + string: "\uFEFF01" + headers: + Content-Type: + - application/xml + Date: + - Thu, 15 Aug 2019 00:35:16 GMT + ETag: + - '"0x8D72118713EA993"' + Last-Modified: + - Thu, 15 Aug 2019 00:35:15 GMT + Server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + Transfer-Encoding: + - chunked + Vary: + - Origin + x-ms-client-request-id: + - 8d2c88be-bef4-11e9-9b0a-b831b5891408 + x-ms-request-id: + - 098af300-a01e-002e-6d01-53e4c7000000 + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_set_container_acl_with_three_identifiers.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_set_container_acl_with_three_identifiers.yaml index d707e4773876..7de50e917603 100644 --- a/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_set_container_acl_with_three_identifiers.yaml +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_container.test_set_container_acl_with_three_identifiers.yaml @@ -11,145 +11,15 @@ interactions: Content-Length: - '0' User-Agent: - - python/3.6.5 (Darwin-16.7.0-x86_64-i386-64bit) azure-core/0.0.1 - x-ms-client-request-id: - - d667fc70-8ecb-11e9-81e3-f45c89a7d159 - x-ms-date: - - Fri, 14 Jun 2019 17:42:53 GMT - x-ms-version: - - '2018-03-28' - method: PUT - uri: https://remotestoragename.blob.core.windows.net/containerf11f18b4?restype=container - response: - body: - string: '' - headers: - Content-Length: - - '0' - Date: - - Fri, 14 Jun 2019 17:42:54 GMT - ETag: - - '"0x8D6F0EFBB38033B"' - Last-Modified: - - Fri, 14 Jun 2019 17:42:54 GMT - Server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-request-id: - - d82f9229-301e-006f-3ed8-22ccd4000000 - x-ms-version: - - '2018-03-28' - status: - code: 201 - message: Created -- request: - body: ' - - 012' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '219' - Content-Type: + - azsdk-python-storage-blob/12.0.0b2 Python/3.7.4 (Windows-10-10.0.17763-SP0) + content-type: - application/xml; charset=utf-8 - User-Agent: - - python/3.6.5 (Darwin-16.7.0-x86_64-i386-64bit) azure-core/0.0.1 x-ms-client-request-id: - - d692c8d8-8ecb-11e9-8f56-f45c89a7d159 + - 342854f6-bef5-11e9-92b9-b831b5891408 x-ms-date: - - Fri, 14 Jun 2019 17:42:54 GMT + - Thu, 15 Aug 2019 00:39:56 GMT x-ms-version: - - '2018-03-28' - method: PUT - uri: https://remotestoragename.blob.core.windows.net/containerf11f18b4?restype=container&comp=acl - response: - body: - string: '' - headers: - Content-Length: - - '0' - Date: - - Fri, 14 Jun 2019 17:42:54 GMT - ETag: - - '"0x8D6F0EFBB42221A"' - Last-Modified: - - Fri, 14 Jun 2019 17:42:54 GMT - Server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-request-id: - - d82f9236-301e-006f-49d8-22ccd4000000 - x-ms-version: - - '2018-03-28' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/xml - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.5 (Darwin-16.7.0-x86_64-i386-64bit) azure-core/0.0.1 - x-ms-client-request-id: - - d69c89f4-8ecb-11e9-924b-f45c89a7d159 - x-ms-date: - - Fri, 14 Jun 2019 17:42:54 GMT - x-ms-version: - - '2018-03-28' - method: GET - uri: https://remotestoragename.blob.core.windows.net/containerf11f18b4?restype=container&comp=acl - response: - body: - string: "\uFEFF012" - headers: - Content-Type: - - application/xml - Date: - - Fri, 14 Jun 2019 17:42:54 GMT - ETag: - - '"0x8D6F0EFBB42221A"' - Last-Modified: - - Fri, 14 Jun 2019 17:42:54 GMT - Server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - Transfer-Encoding: - - chunked - Vary: - - Origin - x-ms-request-id: - - d82f9242-301e-006f-53d8-22ccd4000000 - x-ms-version: - - '2018-03-28' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - python/3.6.5 (Darwin-16.7.0-x86_64-i386-64bit) azure-core/0.0.1 - x-ms-client-request-id: - - 26d6b258-8ed5-11e9-aa80-f45c89a7d159 - x-ms-date: - - Fri, 14 Jun 2019 18:49:34 GMT - x-ms-version: - - '2018-03-28' + - '2019-02-02' method: PUT uri: https://storagename.blob.core.windows.net/containerf11f18b4?restype=container response: @@ -159,24 +29,26 @@ interactions: Content-Length: - '0' Date: - - Fri, 14 Jun 2019 18:49:33 GMT + - Thu, 15 Aug 2019 00:39:58 GMT ETag: - - '"0x8D6F0F90B2AFDD4"' + - '"0x8D7211919E2A6A6"' Last-Modified: - - Fri, 14 Jun 2019 18:49:34 GMT + - Thu, 15 Aug 2019 00:39:58 GMT Server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: + - 342854f6-bef5-11e9-92b9-b831b5891408 x-ms-request-id: - - 1f682f4c-701e-0086-47e1-2230d2000000 + - b19b4d01-801e-00b1-7f01-539c7d000000 x-ms-version: - - '2018-03-28' + - '2019-02-02' status: code: 201 message: Created - request: body: ' - 012' + 02019-08-15T00:38:58Z2019-08-15T01:39:58Zr12019-08-15T00:38:58Z2019-08-15T01:39:58Zr22019-08-15T00:38:58Z2019-08-15T01:39:58Zr' headers: Accept: - '*/*' @@ -185,17 +57,17 @@ interactions: Connection: - keep-alive Content-Length: - - '219' + - '600' Content-Type: - application/xml; charset=utf-8 User-Agent: - - python/3.6.5 (Darwin-16.7.0-x86_64-i386-64bit) azure-core/0.0.1 + - azsdk-python-storage-blob/12.0.0b2 Python/3.7.4 (Windows-10-10.0.17763-SP0) x-ms-client-request-id: - - 26fae306-8ed5-11e9-9fb9-f45c89a7d159 + - 35c69968-bef5-11e9-b84c-b831b5891408 x-ms-date: - - Fri, 14 Jun 2019 18:49:34 GMT + - Thu, 15 Aug 2019 00:39:58 GMT x-ms-version: - - '2018-03-28' + - '2019-02-02' method: PUT uri: https://storagename.blob.core.windows.net/containerf11f18b4?restype=container&comp=acl response: @@ -205,61 +77,19 @@ interactions: Content-Length: - '0' Date: - - Fri, 14 Jun 2019 18:49:33 GMT + - Thu, 15 Aug 2019 00:39:58 GMT ETag: - - '"0x8D6F0F90B33AAFC"' + - '"0x8D721191A1A1E9B"' Last-Modified: - - Fri, 14 Jun 2019 18:49:34 GMT + - Thu, 15 Aug 2019 00:39:59 GMT Server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-request-id: - - 1f682f6c-701e-0086-61e1-2230d2000000 - x-ms-version: - - '2018-03-28' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/xml - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.5 (Darwin-16.7.0-x86_64-i386-64bit) azure-core/0.0.1 x-ms-client-request-id: - - 27034898-8ed5-11e9-b352-f45c89a7d159 - x-ms-date: - - Fri, 14 Jun 2019 18:49:34 GMT - x-ms-version: - - '2018-03-28' - method: GET - uri: https://storagename.blob.core.windows.net/containerf11f18b4?restype=container&comp=acl - response: - body: - string: "\uFEFF012" - headers: - Content-Type: - - application/xml - Date: - - Fri, 14 Jun 2019 18:49:33 GMT - ETag: - - '"0x8D6F0F90B33AAFC"' - Last-Modified: - - Fri, 14 Jun 2019 18:49:34 GMT - Server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - Transfer-Encoding: - - chunked - Vary: - - Origin + - 35c69968-bef5-11e9-b84c-b831b5891408 x-ms-request-id: - - 1f682f84-701e-0086-79e1-2230d2000000 + - b19b4d76-801e-00b1-6901-539c7d000000 x-ms-version: - - '2018-03-28' + - '2019-02-02' status: code: 200 message: OK @@ -267,131 +97,47 @@ interactions: body: null headers: Accept: - - '*/*' + - application/xml, application/octet-stream, text/plain Accept-Encoding: - gzip, deflate Connection: - keep-alive - Content-Length: - - '0' User-Agent: - - python/3.6.5 (Darwin-16.7.0-x86_64-i386-64bit) azure-core/0.0.1 - x-ms-client-request-id: - - 2a71f308-8eda-11e9-a00d-f45c89a7d159 - x-ms-date: - - Fri, 14 Jun 2019 19:25:27 GMT - x-ms-version: - - '2018-03-28' - method: PUT - uri: https://storagename.blob.core.windows.net/containerf11f18b4?restype=container - response: - body: - string: '' - headers: - Content-Length: - - '0' - Date: - - Fri, 14 Jun 2019 19:25:27 GMT - ETag: - - '"0x8D6F0FE0EC09509"' - Last-Modified: - - Fri, 14 Jun 2019 19:25:27 GMT - Server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-request-id: - - ab508138-d01e-0065-3de6-22d55d000000 - x-ms-version: - - '2018-03-28' - status: - code: 201 - message: Created -- request: - body: ' - - 012' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '219' - Content-Type: + - azsdk-python-storage-blob/12.0.0b2 Python/3.7.4 (Windows-10-10.0.17763-SP0) + content-type: - application/xml; charset=utf-8 - User-Agent: - - python/3.6.5 (Darwin-16.7.0-x86_64-i386-64bit) azure-core/0.0.1 - x-ms-client-request-id: - - 2a907e36-8eda-11e9-9161-f45c89a7d159 - x-ms-date: - - Fri, 14 Jun 2019 19:25:27 GMT - x-ms-version: - - '2018-03-28' - method: PUT - uri: https://storagename.blob.core.windows.net/containerf11f18b4?restype=container&comp=acl - response: - body: - string: '' - headers: - Content-Length: - - '0' - Date: - - Fri, 14 Jun 2019 19:25:27 GMT - ETag: - - '"0x8D6F0FE0EC944E2"' - Last-Modified: - - Fri, 14 Jun 2019 19:25:27 GMT - Server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-request-id: - - ab508144-d01e-0065-47e6-22d55d000000 - x-ms-version: - - '2018-03-28' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/xml - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.5 (Darwin-16.7.0-x86_64-i386-64bit) azure-core/0.0.1 x-ms-client-request-id: - - 2a990bfa-8eda-11e9-b55a-f45c89a7d159 + - 3601e546-bef5-11e9-ad64-b831b5891408 x-ms-date: - - Fri, 14 Jun 2019 19:25:28 GMT + - Thu, 15 Aug 2019 00:39:59 GMT x-ms-version: - - '2018-03-28' + - '2019-02-02' method: GET uri: https://storagename.blob.core.windows.net/containerf11f18b4?restype=container&comp=acl response: body: - string: "\uFEFF012" + string: "\uFEFF02019-08-15T00:38:58.0000000Z2019-08-15T01:39:58.0000000Zr12019-08-15T00:38:58.0000000Z2019-08-15T01:39:58.0000000Zr22019-08-15T00:38:58.0000000Z2019-08-15T01:39:58.0000000Zr" headers: Content-Type: - application/xml Date: - - Fri, 14 Jun 2019 19:25:27 GMT + - Thu, 15 Aug 2019 00:39:59 GMT ETag: - - '"0x8D6F0FE0EC944E2"' + - '"0x8D721191A1A1E9B"' Last-Modified: - - Fri, 14 Jun 2019 19:25:27 GMT + - Thu, 15 Aug 2019 00:39:59 GMT Server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 Transfer-Encoding: - chunked Vary: - Origin + x-ms-client-request-id: + - 3601e546-bef5-11e9-ad64-b831b5891408 x-ms-request-id: - - ab50815b-d01e-0065-5be6-22d55d000000 + - b19b4ddb-801e-00b1-4901-539c7d000000 x-ms-version: - - '2018-03-28' + - '2019-02-02' status: code: 200 message: OK diff --git a/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_set_container_acl_with_empty_identifiers.yaml b/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_set_container_acl_with_empty_identifiers.yaml new file mode 100644 index 000000000000..d2eb61b9b833 --- /dev/null +++ b/sdk/storage/azure-storage-blob/tests/recordings/test_container_async.test_set_container_acl_with_empty_identifiers.yaml @@ -0,0 +1,158 @@ +interactions: +- request: + body: null + headers: + User-Agent: + - azsdk-python-storage-blob/12.0.0b2 Python/3.7.4 (Windows-10-10.0.17763-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 8e090840-bef4-11e9-8005-b831b5891408 + x-ms-date: + - Thu, 15 Aug 2019 00:35:17 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/container90941b48?restype=container + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Thu, 15 Aug 2019 00:35:18 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7211872F0BB29"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Thu, 15 Aug 2019 00:35:18 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 8e090840-bef4-11e9-8005-b831b5891408 + x-ms-request-id: 3c48e8d0-801e-007d-4601-53f8c8000000 + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - amqptest.blob.core.windows.net + - /container90941b48 + - restype=container + - '' +- request: + body: ' + + 012' + headers: + Content-Length: + - '219' + Content-Type: + - application/xml; charset=utf-8 + User-Agent: + - azsdk-python-storage-blob/12.0.0b2 Python/3.7.4 (Windows-10-10.0.17763-SP0) + x-ms-client-request-id: + - 8ed281c0-bef4-11e9-a0ef-b831b5891408 + x-ms-date: + - Thu, 15 Aug 2019 00:35:18 GMT + x-ms-version: + - '2019-02-02' + method: PUT + uri: https://storagename.blob.core.windows.net/container90941b48?restype=container&comp=acl + response: + body: + string: '' + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Length + : '0' + ? !!python/object/new:multidict._istr.istr + - Date + : Thu, 15 Aug 2019 00:35:18 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7211873179054"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Thu, 15 Aug 2019 00:35:19 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-client-request-id: 8ed281c0-bef4-11e9-a0ef-b831b5891408 + x-ms-request-id: 3c48e913-801e-007d-0401-53f8c8000000 + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - amqptest.blob.core.windows.net + - /container90941b48 + - restype=container&comp=acl + - '' +- request: + body: null + headers: + Accept: + - application/xml, application/octet-stream, text/plain + User-Agent: + - azsdk-python-storage-blob/12.0.0b2 Python/3.7.4 (Windows-10-10.0.17763-SP0) + content-type: + - application/xml; charset=utf-8 + x-ms-client-request-id: + - 8ef5de90-bef4-11e9-a656-b831b5891408 + x-ms-date: + - Thu, 15 Aug 2019 00:35:19 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://storagename.blob.core.windows.net/container90941b48?restype=container&comp=acl + response: + body: + string: "\uFEFF012" + headers: + ? !!python/object/new:multidict._istr.istr + - Content-Type + : application/xml + ? !!python/object/new:multidict._istr.istr + - Date + : Thu, 15 Aug 2019 00:35:18 GMT + ? !!python/object/new:multidict._istr.istr + - Etag + : '"0x8D7211873179054"' + ? !!python/object/new:multidict._istr.istr + - Last-Modified + : Thu, 15 Aug 2019 00:35:19 GMT + ? !!python/object/new:multidict._istr.istr + - Server + : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + ? !!python/object/new:multidict._istr.istr + - Transfer-Encoding + : chunked + ? !!python/object/new:multidict._istr.istr + - Vary + : Origin + x-ms-client-request-id: 8ef5de90-bef4-11e9-a656-b831b5891408 + x-ms-request-id: 3c48e962-801e-007d-4e01-53f8c8000000 + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: !!python/object/new:yarl.URL + state: !!python/tuple + - !!python/object/new:urllib.parse.SplitResult + - https + - amqptest.blob.core.windows.net + - /container90941b48 + - restype=container&comp=acl + - '' +version: 1 diff --git a/sdk/storage/azure-storage-blob/tests/test_container.py b/sdk/storage/azure-storage-blob/tests/test_container.py index 92e9c20942ac..ce0f9c8f9417 100644 --- a/sdk/storage/azure-storage-blob/tests/test_container.py +++ b/sdk/storage/azure-storage-blob/tests/test_container.py @@ -520,7 +520,7 @@ def test_set_container_acl_with_signed_identifiers(self): self.assertIsNone(acl.get('public_access')) @record - def test_set_container_acl_with_three_identifiers(self): + def test_set_container_acl_with_empty_identifiers(self): # Arrange container = self._create_container() identifiers = {i: None for i in range(2)} @@ -531,17 +531,19 @@ def test_set_container_acl_with_three_identifiers(self): # Assert acl = container.get_container_access_policy() self.assertIsNotNone(acl) - self.assertEqual(len(acl.get('signed_identifiers')), 1) - self.assertEqual('testid', acl.get('signed_identifiers')[0].id) - self.assertIsNotNone(acl.get('signed_identifiers')[0].access_policy) + self.assertEqual(len(acl.get('signed_identifiers')), 2) + self.assertEqual('0', acl.get('signed_identifiers')[0].id) + self.assertIsNone(acl.get('signed_identifiers')[0].access_policy) self.assertIsNone(acl.get('public_access')) - @record def test_set_container_acl_with_three_identifiers(self): # Arrange container = self._create_container() - identifiers = {str(i): None for i in range(0, 3)} + access_policy = AccessPolicy(permission=ContainerPermissions.READ, + expiry=datetime.utcnow() + timedelta(hours=1), + start=datetime.utcnow() - timedelta(minutes=1)) + identifiers = {str(i): access_policy for i in range(0, 3)} # Act container.set_container_access_policy(identifiers) @@ -549,6 +551,9 @@ def test_set_container_acl_with_three_identifiers(self): # Assert acl = container.get_container_access_policy() self.assertEqual(3, len(acl.get('signed_identifiers'))) + self.assertEqual('0', acl.get('signed_identifiers')[0].id) + self.assertIsNotNone(acl.get('signed_identifiers')[0].access_policy) + self.assertIsNone(acl.get('public_access')) @record @@ -847,6 +852,7 @@ def test_list_blobs_with_include_snapshots(self): @record def test_list_blobs_with_include_metadata(self): # Arrange + pytest.skip("Waiting on metadata XML fix in msrest") container = self._create_container() data = b'hello world' blob1 = container.get_blob_client('blob1') @@ -974,6 +980,7 @@ def recursive_walk(prefix): @record def test_list_blobs_with_include_multiple(self): # Arrange + pytest.skip("Waiting on metadata XML fix in msrest") container = self._create_container() data = b'hello world' blob1 = container.get_blob_client('blob1') diff --git a/sdk/storage/azure-storage-blob/tests/test_container_async.py b/sdk/storage/azure-storage-blob/tests/test_container_async.py index 872b5748b485..c42b9ff9fd7e 100644 --- a/sdk/storage/azure-storage-blob/tests/test_container_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_container_async.py @@ -640,6 +640,27 @@ def test_set_container_acl_with_signed_identifiers(self): loop = asyncio.get_event_loop() loop.run_until_complete(self._test_set_container_acl_with_signed_identifiers()) + async def _test_set_container_acl_with_empty_identifiers(self): + # Arrange + container = await self._create_container() + identifiers = {i: None for i in range(0, 3)} + + # Act + await container.set_container_access_policy(identifiers) + + # Assert + acl = await container.get_container_access_policy() + self.assertIsNotNone(acl) + self.assertEqual(len(acl.get('signed_identifiers')), 3) + self.assertEqual('0', acl.get('signed_identifiers')[0].id) + self.assertIsNone(acl.get('signed_identifiers')[0].access_policy) + self.assertIsNone(acl.get('public_access')) + + @record + def test_set_container_acl_with_empty_identifiers(self): + loop = asyncio.get_event_loop() + loop.run_until_complete(self._test_set_container_acl_with_empty_identifiers()) + async def _test_set_container_acl_with_three_identifiers(self): # Arrange container = await self._create_container() @@ -1048,6 +1069,7 @@ def test_list_blobs_with_include_snapshots(self): async def _test_list_blobs_with_include_metadata(self): # Arrange + pytest.skip("Waiting on metadata XML fix in msrest") container = await self._create_container() data = b'hello world' blob1 = container.get_blob_client('blob1') @@ -1214,6 +1236,7 @@ def test_walk_blobs_with_delimiter(self): async def _test_list_blobs_with_include_multiple(self): # Arrange + pytest.skip("Waiting on metadata XML fix in msrest") container = await self._create_container() data = b'hello world' blob1 = container.get_blob_client('blob1') diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/__init__.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/__init__.py index a4f632e6894b..22b5762b2752 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/__init__.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/__init__.py @@ -1,14 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -from ._configuration import AzureFileStorageConfiguration from ._azure_file_storage import AzureFileStorage -__all__ = ['AzureFileStorage', 'AzureFileStorageConfiguration'] +__all__ = ['AzureFileStorage'] from .version import VERSION diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/_azure_file_storage.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/_azure_file_storage.py index 27a03fdac53c..e3a814d83f1a 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/_azure_file_storage.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/_azure_file_storage.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core import PipelineClient from msrest import Serializer, Deserializer @@ -23,13 +26,13 @@ class AzureFileStorage(object): :ivar service: Service operations - :vartype service: file.operations.ServiceOperations + :vartype service: azure.storage.file.operations.ServiceOperations :ivar share: Share operations - :vartype share: file.operations.ShareOperations + :vartype share: azure.storage.file.operations.ShareOperations :ivar directory: Directory operations - :vartype directory: file.operations.DirectoryOperations + :vartype directory: azure.storage.file.operations.DirectoryOperations :ivar file: File operations - :vartype file: file.operations.FileOperations + :vartype file: azure.storage.file.operations.FileOperations :param version: Specifies the version of the operation to use for this request. @@ -39,10 +42,10 @@ class AzureFileStorage(object): :type url: str """ - def __init__(self, version, url, config=None, **kwargs): + def __init__(self, version, url, **kwargs): base_url = '{url}' - self._config = config or AzureFileStorageConfiguration(version, url, **kwargs) + self._config = AzureFileStorageConfiguration(version, url, **kwargs) self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/_configuration.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/_configuration.py index bcea3a2303ef..4f5501dfdd09 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/_configuration.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/_configuration.py @@ -1,12 +1,15 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -from azure.core.configuration import Configuration, ConnectionConfiguration +from azure.core.configuration import Configuration from azure.core.pipeline import policies from .version import VERSION @@ -35,19 +38,17 @@ def __init__(self, version, url, **kwargs): super(AzureFileStorageConfiguration, self).__init__(**kwargs) self._configure(**kwargs) - self.user_agent_policy.add_user_agent('azurefilestorage/{}'.format(VERSION)) + self.user_agent_policy.add_user_agent('azsdk-python-azurefilestorage/{}'.format(VERSION)) self.generate_client_request_id = True - self.accept_language = None self.version = version self.url = url def _configure(self, **kwargs): - self.connection = ConnectionConfiguration(**kwargs) - self.user_agent_policy = policies.UserAgentPolicy(**kwargs) - self.headers_policy = policies.HeadersPolicy(**kwargs) - self.proxy_policy = policies.ProxyPolicy(**kwargs) - self.logging_policy = policies.NetworkTraceLoggingPolicy(**kwargs) - self.retry_policy = policies.RetryPolicy(**kwargs) - self.custom_hook_policy = policies.CustomHookPolicy(**kwargs) - self.redirect_policy = policies.RedirectPolicy(**kwargs) + 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.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) diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/__init__.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/__init__.py index 076fe4358cfa..942d3c5dd379 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/__init__.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/__init__.py @@ -1,11 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from ._azure_file_storage_async import AzureFileStorage -from ._configuration_async import AzureFileStorageConfiguration -__all__ = ['AzureFileStorage', 'AzureFileStorageConfiguration'] +__all__ = ['AzureFileStorage'] diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/_azure_file_storage_async.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/_azure_file_storage_async.py index bddb726daed5..dd86db3045cc 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/_azure_file_storage_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/_azure_file_storage_async.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core import AsyncPipelineClient from msrest import Serializer, Deserializer @@ -23,13 +26,13 @@ class AzureFileStorage(object): :ivar service: Service operations - :vartype service: file.aio.operations_async.ServiceOperations + :vartype service: azure.storage.file.aio.operations_async.ServiceOperations :ivar share: Share operations - :vartype share: file.aio.operations_async.ShareOperations + :vartype share: azure.storage.file.aio.operations_async.ShareOperations :ivar directory: Directory operations - :vartype directory: file.aio.operations_async.DirectoryOperations + :vartype directory: azure.storage.file.aio.operations_async.DirectoryOperations :ivar file: File operations - :vartype file: file.aio.operations_async.FileOperations + :vartype file: azure.storage.file.aio.operations_async.FileOperations :param version: Specifies the version of the operation to use for this request. @@ -40,10 +43,10 @@ class AzureFileStorage(object): """ def __init__( - self, version, url, config=None, **kwargs): + self, version, url, **kwargs): base_url = '{url}' - self._config = config or AzureFileStorageConfiguration(version, url, **kwargs) + self._config = AzureFileStorageConfiguration(version, url, **kwargs) self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/_configuration_async.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/_configuration_async.py index 303313225d33..bdb635eadc14 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/_configuration_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/_configuration_async.py @@ -1,12 +1,15 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -from azure.core.configuration import Configuration, ConnectionConfiguration +from azure.core.configuration import Configuration from azure.core.pipeline import policies from ..version import VERSION @@ -35,7 +38,7 @@ def __init__(self, version, url, **kwargs): super(AzureFileStorageConfiguration, self).__init__(**kwargs) self._configure(**kwargs) - self.user_agent_policy.add_user_agent('azurefilestorage/{}'.format(VERSION)) + self.user_agent_policy.add_user_agent('azsdk-python-azurefilestorage/{}'.format(VERSION)) self.generate_client_request_id = True self.accept_language = None @@ -43,10 +46,10 @@ def __init__(self, version, url, **kwargs): self.url = url def _configure(self, **kwargs): - self.connection = ConnectionConfiguration(**kwargs) - self.user_agent_policy = policies.UserAgentPolicy(**kwargs) - self.headers_policy = policies.HeadersPolicy(**kwargs) - self.proxy_policy = policies.ProxyPolicy(**kwargs) - self.logging_policy = policies.NetworkTraceLoggingPolicy(**kwargs) - self.retry_policy = policies.AsyncRetryPolicy(**kwargs) - self.redirect_policy = policies.AsyncRedirectPolicy(**kwargs) + 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.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) diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/__init__.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/__init__.py index 57ab0bdd81de..601c7099d157 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/__init__.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/__init__.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from ._service_operations_async import ServiceOperations from ._share_operations_async import ShareOperations diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_directory_operations_async.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_directory_operations_async.py index d1f0f530695f..17f8a28e4094 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_directory_operations_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_directory_operations_async.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -50,7 +53,7 @@ async def create(self, timeout=None, metadata=None, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -112,7 +115,7 @@ async def get_properties(self, sharesnapshot=None, timeout=None, *, cls=None, ** :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -171,7 +174,7 @@ async def delete(self, timeout=None, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -226,7 +229,7 @@ async def set_metadata(self, timeout=None, metadata=None, *, cls=None, **kwargs) :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -303,9 +306,10 @@ async def list_files_and_directories_segment(self, prefix=None, sharesnapshot=No direct response :return: ListFilesAndDirectoriesSegmentResponse or the result of cls(response) - :rtype: ~file.models.ListFilesAndDirectoriesSegmentResponse + :rtype: + ~azure.storage.file.models.ListFilesAndDirectoriesSegmentResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "list" @@ -392,9 +396,9 @@ async def list_handles(self, marker=None, maxresults=None, timeout=None, sharesn :param callable cls: A custom type or function that will be passed the direct response :return: ListHandlesResponse or the result of cls(response) - :rtype: ~file.models.ListHandlesResponse + :rtype: ~azure.storage.file.models.ListHandlesResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "listhandles" @@ -481,7 +485,7 @@ async def force_close_handles(self, handle_id, timeout=None, marker=None, shares :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "forceclosehandles" diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_file_operations_async.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_file_operations_async.py index d7c358b58c5e..e0f0a0dc847b 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_file_operations_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_file_operations_async.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -52,13 +55,13 @@ async def create(self, file_content_length, timeout=None, metadata=None, file_ht object. :type metadata: str :param file_http_headers: Additional parameters for the operation - :type file_http_headers: ~file.models.FileHTTPHeaders + :type file_http_headers: ~azure.storage.file.models.FileHTTPHeaders :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) file_content_type = None @@ -155,7 +158,7 @@ async def download(self, timeout=None, range=None, range_get_content_md5=None, * :return: object or the result of cls(response) :rtype: Generator :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -205,18 +208,18 @@ async def download(self, timeout=None, range=None, range_get_content_md5=None, * 'Cache-Control': self._deserialize('str', response.headers.get('Cache-Control')), 'Content-Disposition': self._deserialize('str', response.headers.get('Content-Disposition')), 'Content-Language': self._deserialize('str', response.headers.get('Content-Language')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-copy-completion-time': self._deserialize('rfc-1123', response.headers.get('x-ms-copy-completion-time')), 'x-ms-copy-status-description': self._deserialize('str', response.headers.get('x-ms-copy-status-description')), 'x-ms-copy-id': self._deserialize('str', response.headers.get('x-ms-copy-id')), 'x-ms-copy-progress': self._deserialize('str', response.headers.get('x-ms-copy-progress')), 'x-ms-copy-source': self._deserialize('str', response.headers.get('x-ms-copy-source')), 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), - 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), - 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), - 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), - 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), - 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), 'x-ms-content-md5': self._deserialize('bytearray', response.headers.get('x-ms-content-md5')), + 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } if response.status_code == 206: @@ -233,18 +236,18 @@ async def download(self, timeout=None, range=None, range_get_content_md5=None, * 'Cache-Control': self._deserialize('str', response.headers.get('Cache-Control')), 'Content-Disposition': self._deserialize('str', response.headers.get('Content-Disposition')), 'Content-Language': self._deserialize('str', response.headers.get('Content-Language')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-copy-completion-time': self._deserialize('rfc-1123', response.headers.get('x-ms-copy-completion-time')), 'x-ms-copy-status-description': self._deserialize('str', response.headers.get('x-ms-copy-status-description')), 'x-ms-copy-id': self._deserialize('str', response.headers.get('x-ms-copy-id')), 'x-ms-copy-progress': self._deserialize('str', response.headers.get('x-ms-copy-progress')), 'x-ms-copy-source': self._deserialize('str', response.headers.get('x-ms-copy-source')), 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), - 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), - 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), - 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), - 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), - 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), 'x-ms-content-md5': self._deserialize('bytearray', response.headers.get('x-ms-content-md5')), + 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } @@ -271,7 +274,7 @@ async def get_properties(self, sharesnapshot=None, timeout=None, *, cls=None, ** :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -342,7 +345,7 @@ async def delete(self, timeout=None, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -393,13 +396,13 @@ async def set_http_headers(self, timeout=None, file_content_length=None, file_ht then all ranges above the specified byte value are cleared. :type file_content_length: long :param file_http_headers: Additional parameters for the operation - :type file_http_headers: ~file.models.FileHTTPHeaders + :type file_http_headers: ~azure.storage.file.models.FileHTTPHeaders :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) file_content_type = None @@ -492,7 +495,7 @@ async def set_metadata(self, timeout=None, metadata=None, *, cls=None, **kwargs) :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -556,7 +559,8 @@ async def upload_range(self, range, content_length, file_range_write="update", o Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to maximum file size. Possible values include: 'update', 'clear' - :type file_range_write: str or ~file.models.FileRangeWriteType + :type file_range_write: str or + ~azure.storage.file.models.FileRangeWriteType :param content_length: Specifies the number of bytes being transmitted in the request body. When the x-ms-write header is set to clear, the value of this header must be set to zero. @@ -580,7 +584,7 @@ async def upload_range(self, range, content_length, file_range_write="update", o :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "range" @@ -650,9 +654,9 @@ async def get_range_list(self, sharesnapshot=None, timeout=None, range=None, *, :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~file.models.Range] + :rtype: list[~azure.storage.file.models.Range] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "rangelist" @@ -734,7 +738,7 @@ async def start_copy(self, copy_source, timeout=None, metadata=None, *, cls=None :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -796,7 +800,7 @@ async def abort_copy(self, copy_id, timeout=None, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "copy" @@ -864,9 +868,9 @@ async def list_handles(self, marker=None, maxresults=None, timeout=None, sharesn :param callable cls: A custom type or function that will be passed the direct response :return: ListHandlesResponse or the result of cls(response) - :rtype: ~file.models.ListHandlesResponse + :rtype: ~azure.storage.file.models.ListHandlesResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "listhandles" @@ -948,7 +952,7 @@ async def force_close_handles(self, handle_id, timeout=None, marker=None, shares :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "forceclosehandles" diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_service_operations_async.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_service_operations_async.py index b8fb972322ec..4274db7ffb80 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_service_operations_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_service_operations_async.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -41,7 +44,7 @@ async def set_properties(self, storage_service_properties, timeout=None, *, cls= :param storage_service_properties: The StorageService properties. :type storage_service_properties: - ~file.models.StorageServiceProperties + ~azure.storage.file.models.StorageServiceProperties :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -52,7 +55,7 @@ async def set_properties(self, storage_service_properties, timeout=None, *, cls= :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -110,9 +113,9 @@ async def get_properties(self, timeout=None, *, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: StorageServiceProperties or the result of cls(response) - :rtype: ~file.models.StorageServiceProperties + :rtype: ~azure.storage.file.models.StorageServiceProperties :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -181,7 +184,8 @@ async def list_shares_segment(self, prefix=None, marker=None, maxresults=None, i :type maxresults: int :param include: Include this parameter to specify one or more datasets to include in the response. - :type include: list[str or ~file.models.ListSharesIncludeType] + :type include: list[str or + ~azure.storage.file.models.ListSharesIncludeType] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -190,9 +194,9 @@ async def list_shares_segment(self, prefix=None, marker=None, maxresults=None, i :param callable cls: A custom type or function that will be passed the direct response :return: ListSharesResponse or the result of cls(response) - :rtype: ~file.models.ListSharesResponse + :rtype: ~azure.storage.file.models.ListSharesResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "list" diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_share_operations_async.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_share_operations_async.py index 83e81cf64891..14f5d174a496 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_share_operations_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/aio/operations_async/_share_operations_async.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -53,7 +56,7 @@ async def create(self, timeout=None, metadata=None, quota=None, *, cls=None, **k :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -116,7 +119,7 @@ async def get_properties(self, sharesnapshot=None, timeout=None, *, cls=None, ** :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -177,13 +180,14 @@ async def delete(self, sharesnapshot=None, timeout=None, delete_snapshots=None, :param delete_snapshots: Specifies the option include to delete the base share and all of its snapshots. Possible values include: 'include' - :type delete_snapshots: str or ~file.models.DeleteSnapshotsOptionType + :type delete_snapshots: str or + ~azure.storage.file.models.DeleteSnapshotsOptionType :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -242,7 +246,7 @@ async def create_snapshot(self, timeout=None, metadata=None, *, cls=None, **kwar :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "snapshot" @@ -304,7 +308,7 @@ async def set_quota(self, timeout=None, quota=None, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -366,7 +370,7 @@ async def set_metadata(self, timeout=None, metadata=None, *, cls=None, **kwargs) :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -424,9 +428,9 @@ async def get_access_policy(self, timeout=None, *, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~file.models.SignedIdentifier] + :rtype: list[~azure.storage.file.models.SignedIdentifier] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "acl" @@ -482,7 +486,7 @@ async def set_access_policy(self, share_acl=None, timeout=None, *, cls=None, **k """Sets a stored access policy for use with shared access signatures. :param share_acl: The ACL for the share. - :type share_acl: list[~file.models.SignedIdentifier] + :type share_acl: list[~azure.storage.file.models.SignedIdentifier] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -493,7 +497,7 @@ async def set_access_policy(self, share_acl=None, timeout=None, *, cls=None, **k :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "acl" @@ -520,8 +524,7 @@ async def set_access_policy(self, share_acl=None, timeout=None, *, cls=None, **k # Construct body serialization_ctxt = {'xml': {'name': 'SignedIdentifiers', 'itemsName': 'SignedIdentifier', 'wrapped': True}} if share_acl is not None: - body_content = self._serialize.serialize_iter(share_acl, 'SignedIdentifier', - serialization_ctxt=serialization_ctxt) + body_content = self._serialize.body(share_acl, '[SignedIdentifier]', serialization_ctxt=serialization_ctxt) else: body_content = None @@ -557,9 +560,9 @@ async def get_statistics(self, timeout=None, *, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: ShareStats or the result of cls(response) - :rtype: ~file.models.ShareStats + :rtype: ~azure.storage.file.models.ShareStats :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "stats" diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/__init__.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/__init__.py index 06ca9297f8b9..27c92bdded62 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/__init__.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/__init__.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file try: from ._models_py3 import AccessPolicy diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_azure_file_storage_enums.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_azure_file_storage_enums.py index 2e7b3c19a718..e5464dab8d2f 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_azure_file_storage_enums.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_azure_file_storage_enums.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from enum import Enum diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_models.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_models.py index 8906fe4877d4..ac571b71cac9 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_models.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_models.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from msrest.serialization import Model from azure.core import HttpResponseError @@ -14,9 +17,9 @@ class AccessPolicy(Model): """An Access policy. :param start: The date-time the policy is active. - :type start: datetime + :type start: str :param expiry: The date-time the policy expires. - :type expiry: datetime + :type expiry: str :param permission: The permissions for the ACL policy. :type permission: str """ @@ -29,7 +32,6 @@ class AccessPolicy(Model): _xml_map = { } - def __init__(self, **kwargs): super(AccessPolicy, self).__init__(**kwargs) self.start = kwargs.get('start', None) @@ -112,6 +114,7 @@ class DirectoryItem(Model): 'name': {'key': 'Name', 'type': 'str', 'xml': {'name': 'Name'}}, } _xml_map = { + 'name': 'Directory' } def __init__(self, **kwargs): @@ -143,11 +146,11 @@ class FileHTTPHeaders(Model): """ _attribute_map = { - 'file_cache_control': {'key': '', 'type': 'str', 'xml': {'name': 'file_cache_control'}}, 'file_content_type': {'key': '', 'type': 'str', 'xml': {'name': 'file_content_type'}}, - 'file_content_md5': {'key': '', 'type': 'bytearray', 'xml': {'name': 'file_content_md5'}}, 'file_content_encoding': {'key': '', 'type': 'str', 'xml': {'name': 'file_content_encoding'}}, 'file_content_language': {'key': '', 'type': 'str', 'xml': {'name': 'file_content_language'}}, + 'file_cache_control': {'key': '', 'type': 'str', 'xml': {'name': 'file_cache_control'}}, + 'file_content_md5': {'key': '', 'type': 'bytearray', 'xml': {'name': 'file_content_md5'}}, 'file_content_disposition': {'key': '', 'type': 'str', 'xml': {'name': 'file_content_disposition'}}, } _xml_map = { @@ -171,7 +174,7 @@ class FileItem(Model): :param name: Required. :type name: str :param properties: Required. - :type properties: ~file.models.FileProperty + :type properties: ~azure.storage.file.models.FileProperty """ _validation = { @@ -214,7 +217,6 @@ class FileProperty(Model): 'content_length': {'key': 'Content-Length', 'type': 'long', 'xml': {'name': 'Content-Length'}}, } _xml_map = { - 'name': 'Properties' } def __init__(self, **kwargs): @@ -228,9 +230,9 @@ class FilesAndDirectoriesListSegment(Model): All required parameters must be populated in order to send to Azure. :param directory_items: Required. - :type directory_items: list[~file.models.DirectoryItem] + :type directory_items: list[~azure.storage.file.models.DirectoryItem] :param file_items: Required. - :type file_items: list[~file.models.FileItem] + :type file_items: list[~azure.storage.file.models.FileItem] """ _validation = { @@ -239,8 +241,8 @@ class FilesAndDirectoriesListSegment(Model): } _attribute_map = { - 'directory_items': {'key': 'DirectoryItems', 'type': '[DirectoryItem]', 'xml': {'name': 'Directory', 'itemsName': 'Directory'}}, - 'file_items': {'key': 'FileItems', 'type': '[FileItem]', 'xml': {'name': 'File', 'itemsName': 'File'}}, + 'directory_items': {'key': 'DirectoryItems', 'type': '[DirectoryItem]', 'xml': {'name': 'DirectoryItems', 'itemsName': 'Directory'}}, + 'file_items': {'key': 'FileItems', 'type': '[FileItem]', 'xml': {'name': 'FileItems', 'itemsName': 'File'}}, } _xml_map = { 'name': 'Entries' @@ -335,7 +337,7 @@ class ListFilesAndDirectoriesSegmentResponse(Model): :param max_results: :type max_results: int :param segment: Required. - :type segment: ~file.models.FilesAndDirectoriesListSegment + :type segment: ~azure.storage.file.models.FilesAndDirectoriesListSegment :param next_marker: Required. :type next_marker: str """ @@ -352,8 +354,8 @@ class ListFilesAndDirectoriesSegmentResponse(Model): _attribute_map = { 'service_endpoint': {'key': 'ServiceEndpoint', 'type': 'str', 'xml': {'name': 'ServiceEndpoint', 'attr': True}}, 'share_name': {'key': 'ShareName', 'type': 'str', 'xml': {'name': 'ShareName', 'attr': True}}, - 'share_snapshot': {'key': 'ShareSnapshot', 'type': 'str', 'xml': {'name': 'ShareSnapshot'}}, - 'directory_path': {'key': 'DirectoryPath', 'type': 'str', 'xml': {'name': 'DirectoryPath'}}, + 'share_snapshot': {'key': 'ShareSnapshot', 'type': 'str', 'xml': {'name': 'ShareSnapshot', 'attr': True}}, + 'directory_path': {'key': 'DirectoryPath', 'type': 'str', 'xml': {'name': 'DirectoryPath', 'attr': True}}, 'prefix': {'key': 'Prefix', 'type': 'str', 'xml': {'name': 'Prefix'}}, 'marker': {'key': 'Marker', 'type': 'str', 'xml': {'name': 'Marker'}}, 'max_results': {'key': 'MaxResults', 'type': 'int', 'xml': {'name': 'MaxResults'}}, @@ -383,7 +385,7 @@ class ListHandlesResponse(Model): All required parameters must be populated in order to send to Azure. :param handle_list: - :type handle_list: list[~file.models.HandleItem] + :type handle_list: list[~azure.storage.file.models.HandleItem] :param next_marker: Required. :type next_marker: str """ @@ -420,7 +422,7 @@ class ListSharesResponse(Model): :param max_results: :type max_results: int :param share_items: - :type share_items: list[~file.models.ShareItem] + :type share_items: list[~azure.storage.file.models.ShareItem] :param next_marker: Required. :type next_marker: str """ @@ -466,7 +468,7 @@ class Metrics(Model): statistics for called API operations. :type include_apis: bool :param retention_policy: - :type retention_policy: ~file.models.RetentionPolicy + :type retention_policy: ~azure.storage.file.models.RetentionPolicy """ _validation = { @@ -564,7 +566,7 @@ class ShareItem(Model): :param snapshot: :type snapshot: str :param properties: Required. - :type properties: ~file.models.ShareProperties + :type properties: ~azure.storage.file.models.ShareProperties :param metadata: :type metadata: dict[str, str] """ @@ -617,7 +619,6 @@ class ShareProperties(Model): 'quota': {'key': 'Quota', 'type': 'int', 'xml': {'name': 'Quota'}}, } _xml_map = { - 'name': 'Properties' } def __init__(self, **kwargs): @@ -646,7 +647,6 @@ class ShareStats(Model): 'share_usage_bytes': {'key': 'ShareUsageBytes', 'type': 'int', 'xml': {'name': 'ShareUsageBytes'}}, } _xml_map = { - 'name': 'ShareStats' } def __init__(self, **kwargs): @@ -662,7 +662,7 @@ class SignedIdentifier(Model): :param id: Required. A unique id. :type id: str :param access_policy: The access policy. - :type access_policy: ~file.models.AccessPolicy + :type access_policy: ~azure.storage.file.models.AccessPolicy """ _validation = { @@ -721,12 +721,12 @@ class StorageServiceProperties(Model): :param hour_metrics: A summary of request statistics grouped by API in hourly aggregates for files. - :type hour_metrics: ~file.models.Metrics + :type hour_metrics: ~azure.storage.file.models.Metrics :param minute_metrics: A summary of request statistics grouped by API in minute aggregates for files. - :type minute_metrics: ~file.models.Metrics + :type minute_metrics: ~azure.storage.file.models.Metrics :param cors: The set of CORS rules. - :type cors: list[~file.models.CorsRule] + :type cors: list[~azure.storage.file.models.CorsRule] """ _attribute_map = { diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_models_py3.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_models_py3.py index aa42c32fcf87..17696f9f0efa 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_models_py3.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/models/_models_py3.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from msrest.serialization import Model from azure.core import HttpResponseError @@ -14,9 +17,9 @@ class AccessPolicy(Model): """An Access policy. :param start: The date-time the policy is active. - :type start: datetime + :type start: str :param expiry: The date-time the policy expires. - :type expiry: datetime + :type expiry: str :param permission: The permissions for the ACL policy. :type permission: str """ @@ -29,8 +32,7 @@ class AccessPolicy(Model): _xml_map = { } - - def __init__(self, *, start=None, expiry=None, permission: str=None, **kwargs) -> None: + def __init__(self, *, start: str=None, expiry: str=None, permission: str=None, **kwargs) -> None: super(AccessPolicy, self).__init__(**kwargs) self.start = start self.expiry = expiry @@ -112,6 +114,7 @@ class DirectoryItem(Model): 'name': {'key': 'Name', 'type': 'str', 'xml': {'name': 'Name'}}, } _xml_map = { + 'name': 'Directory' } def __init__(self, *, name: str, **kwargs) -> None: @@ -143,11 +146,11 @@ class FileHTTPHeaders(Model): """ _attribute_map = { - 'file_cache_control': {'key': '', 'type': 'str', 'xml': {'name': 'file_cache_control'}}, 'file_content_type': {'key': '', 'type': 'str', 'xml': {'name': 'file_content_type'}}, - 'file_content_md5': {'key': '', 'type': 'bytearray', 'xml': {'name': 'file_content_md5'}}, 'file_content_encoding': {'key': '', 'type': 'str', 'xml': {'name': 'file_content_encoding'}}, 'file_content_language': {'key': '', 'type': 'str', 'xml': {'name': 'file_content_language'}}, + 'file_cache_control': {'key': '', 'type': 'str', 'xml': {'name': 'file_cache_control'}}, + 'file_content_md5': {'key': '', 'type': 'bytearray', 'xml': {'name': 'file_content_md5'}}, 'file_content_disposition': {'key': '', 'type': 'str', 'xml': {'name': 'file_content_disposition'}}, } _xml_map = { @@ -171,7 +174,7 @@ class FileItem(Model): :param name: Required. :type name: str :param properties: Required. - :type properties: ~file.models.FileProperty + :type properties: ~azure.storage.file.models.FileProperty """ _validation = { @@ -214,7 +217,6 @@ class FileProperty(Model): 'content_length': {'key': 'Content-Length', 'type': 'long', 'xml': {'name': 'Content-Length'}}, } _xml_map = { - 'name': 'Properties' } def __init__(self, *, content_length: int, **kwargs) -> None: @@ -228,9 +230,9 @@ class FilesAndDirectoriesListSegment(Model): All required parameters must be populated in order to send to Azure. :param directory_items: Required. - :type directory_items: list[~file.models.DirectoryItem] + :type directory_items: list[~azure.storage.file.models.DirectoryItem] :param file_items: Required. - :type file_items: list[~file.models.FileItem] + :type file_items: list[~azure.storage.file.models.FileItem] """ _validation = { @@ -239,8 +241,8 @@ class FilesAndDirectoriesListSegment(Model): } _attribute_map = { - 'directory_items': {'key': 'DirectoryItems', 'type': '[DirectoryItem]', 'xml': {'name': 'Directory', 'itemsName': 'Directory'}}, - 'file_items': {'key': 'FileItems', 'type': '[FileItem]', 'xml': {'name': 'File', 'itemsName': 'File'}}, + 'directory_items': {'key': 'DirectoryItems', 'type': '[DirectoryItem]', 'xml': {'name': 'DirectoryItems', 'itemsName': 'Directory'}}, + 'file_items': {'key': 'FileItems', 'type': '[FileItem]', 'xml': {'name': 'FileItems', 'itemsName': 'File'}}, } _xml_map = { 'name': 'Entries' @@ -335,7 +337,7 @@ class ListFilesAndDirectoriesSegmentResponse(Model): :param max_results: :type max_results: int :param segment: Required. - :type segment: ~file.models.FilesAndDirectoriesListSegment + :type segment: ~azure.storage.file.models.FilesAndDirectoriesListSegment :param next_marker: Required. :type next_marker: str """ @@ -352,8 +354,8 @@ class ListFilesAndDirectoriesSegmentResponse(Model): _attribute_map = { 'service_endpoint': {'key': 'ServiceEndpoint', 'type': 'str', 'xml': {'name': 'ServiceEndpoint', 'attr': True}}, 'share_name': {'key': 'ShareName', 'type': 'str', 'xml': {'name': 'ShareName', 'attr': True}}, - 'share_snapshot': {'key': 'ShareSnapshot', 'type': 'str', 'xml': {'name': 'ShareSnapshot'}}, - 'directory_path': {'key': 'DirectoryPath', 'type': 'str', 'xml': {'name': 'DirectoryPath'}}, + 'share_snapshot': {'key': 'ShareSnapshot', 'type': 'str', 'xml': {'name': 'ShareSnapshot', 'attr': True}}, + 'directory_path': {'key': 'DirectoryPath', 'type': 'str', 'xml': {'name': 'DirectoryPath', 'attr': True}}, 'prefix': {'key': 'Prefix', 'type': 'str', 'xml': {'name': 'Prefix'}}, 'marker': {'key': 'Marker', 'type': 'str', 'xml': {'name': 'Marker'}}, 'max_results': {'key': 'MaxResults', 'type': 'int', 'xml': {'name': 'MaxResults'}}, @@ -383,7 +385,7 @@ class ListHandlesResponse(Model): All required parameters must be populated in order to send to Azure. :param handle_list: - :type handle_list: list[~file.models.HandleItem] + :type handle_list: list[~azure.storage.file.models.HandleItem] :param next_marker: Required. :type next_marker: str """ @@ -420,7 +422,7 @@ class ListSharesResponse(Model): :param max_results: :type max_results: int :param share_items: - :type share_items: list[~file.models.ShareItem] + :type share_items: list[~azure.storage.file.models.ShareItem] :param next_marker: Required. :type next_marker: str """ @@ -466,7 +468,7 @@ class Metrics(Model): statistics for called API operations. :type include_apis: bool :param retention_policy: - :type retention_policy: ~file.models.RetentionPolicy + :type retention_policy: ~azure.storage.file.models.RetentionPolicy """ _validation = { @@ -564,7 +566,7 @@ class ShareItem(Model): :param snapshot: :type snapshot: str :param properties: Required. - :type properties: ~file.models.ShareProperties + :type properties: ~azure.storage.file.models.ShareProperties :param metadata: :type metadata: dict[str, str] """ @@ -617,7 +619,6 @@ class ShareProperties(Model): 'quota': {'key': 'Quota', 'type': 'int', 'xml': {'name': 'Quota'}}, } _xml_map = { - 'name': 'Properties' } def __init__(self, *, last_modified, etag: str, quota: int, **kwargs) -> None: @@ -646,7 +647,6 @@ class ShareStats(Model): 'share_usage_bytes': {'key': 'ShareUsageBytes', 'type': 'int', 'xml': {'name': 'ShareUsageBytes'}}, } _xml_map = { - 'name': 'ShareStats' } def __init__(self, *, share_usage_bytes: int, **kwargs) -> None: @@ -662,7 +662,7 @@ class SignedIdentifier(Model): :param id: Required. A unique id. :type id: str :param access_policy: The access policy. - :type access_policy: ~file.models.AccessPolicy + :type access_policy: ~azure.storage.file.models.AccessPolicy """ _validation = { @@ -721,12 +721,12 @@ class StorageServiceProperties(Model): :param hour_metrics: A summary of request statistics grouped by API in hourly aggregates for files. - :type hour_metrics: ~file.models.Metrics + :type hour_metrics: ~azure.storage.file.models.Metrics :param minute_metrics: A summary of request statistics grouped by API in minute aggregates for files. - :type minute_metrics: ~file.models.Metrics + :type minute_metrics: ~azure.storage.file.models.Metrics :param cors: The set of CORS rules. - :type cors: list[~file.models.CorsRule] + :type cors: list[~azure.storage.file.models.CorsRule] """ _attribute_map = { diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/__init__.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/__init__.py index 825841a61e2f..65680c942feb 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/__init__.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/__init__.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from ._service_operations import ServiceOperations from ._share_operations import ShareOperations diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_directory_operations.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_directory_operations.py index dc581cb0fc97..fc1581c51a45 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_directory_operations.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_directory_operations.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -50,7 +53,7 @@ def create(self, timeout=None, metadata=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -112,7 +115,7 @@ def get_properties(self, sharesnapshot=None, timeout=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -171,7 +174,7 @@ def delete(self, timeout=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -226,7 +229,7 @@ def set_metadata(self, timeout=None, metadata=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -303,9 +306,10 @@ def list_files_and_directories_segment(self, prefix=None, sharesnapshot=None, ma direct response :return: ListFilesAndDirectoriesSegmentResponse or the result of cls(response) - :rtype: ~file.models.ListFilesAndDirectoriesSegmentResponse + :rtype: + ~azure.storage.file.models.ListFilesAndDirectoriesSegmentResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "list" @@ -392,9 +396,9 @@ def list_handles(self, marker=None, maxresults=None, timeout=None, sharesnapshot :param callable cls: A custom type or function that will be passed the direct response :return: ListHandlesResponse or the result of cls(response) - :rtype: ~file.models.ListHandlesResponse + :rtype: ~azure.storage.file.models.ListHandlesResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "listhandles" @@ -481,7 +485,7 @@ def force_close_handles(self, handle_id, timeout=None, marker=None, sharesnapsho :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "forceclosehandles" diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_file_operations.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_file_operations.py index 838c86de34b1..614ed01d0b22 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_file_operations.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_file_operations.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -52,13 +55,13 @@ def create(self, file_content_length, timeout=None, metadata=None, file_http_hea object. :type metadata: str :param file_http_headers: Additional parameters for the operation - :type file_http_headers: ~file.models.FileHTTPHeaders + :type file_http_headers: ~azure.storage.file.models.FileHTTPHeaders :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) file_content_type = None @@ -155,7 +158,7 @@ def download(self, timeout=None, range=None, range_get_content_md5=None, cls=Non :return: object or the result of cls(response) :rtype: Generator :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -204,18 +207,18 @@ def download(self, timeout=None, range=None, range_get_content_md5=None, cls=Non 'Cache-Control': self._deserialize('str', response.headers.get('Cache-Control')), 'Content-Disposition': self._deserialize('str', response.headers.get('Content-Disposition')), 'Content-Language': self._deserialize('str', response.headers.get('Content-Language')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-copy-completion-time': self._deserialize('rfc-1123', response.headers.get('x-ms-copy-completion-time')), 'x-ms-copy-status-description': self._deserialize('str', response.headers.get('x-ms-copy-status-description')), 'x-ms-copy-id': self._deserialize('str', response.headers.get('x-ms-copy-id')), 'x-ms-copy-progress': self._deserialize('str', response.headers.get('x-ms-copy-progress')), 'x-ms-copy-source': self._deserialize('str', response.headers.get('x-ms-copy-source')), 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), - 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), - 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), - 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), - 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), - 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), 'x-ms-content-md5': self._deserialize('bytearray', response.headers.get('x-ms-content-md5')), + 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } if response.status_code == 206: @@ -232,18 +235,18 @@ def download(self, timeout=None, range=None, range_get_content_md5=None, cls=Non 'Cache-Control': self._deserialize('str', response.headers.get('Cache-Control')), 'Content-Disposition': self._deserialize('str', response.headers.get('Content-Disposition')), 'Content-Language': self._deserialize('str', response.headers.get('Content-Language')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), + 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), + 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), 'x-ms-copy-completion-time': self._deserialize('rfc-1123', response.headers.get('x-ms-copy-completion-time')), 'x-ms-copy-status-description': self._deserialize('str', response.headers.get('x-ms-copy-status-description')), 'x-ms-copy-id': self._deserialize('str', response.headers.get('x-ms-copy-id')), 'x-ms-copy-progress': self._deserialize('str', response.headers.get('x-ms-copy-progress')), 'x-ms-copy-source': self._deserialize('str', response.headers.get('x-ms-copy-source')), 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), - 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), - 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), - 'Accept-Ranges': self._deserialize('str', response.headers.get('Accept-Ranges')), - 'Date': self._deserialize('rfc-1123', response.headers.get('Date')), - 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), 'x-ms-content-md5': self._deserialize('bytearray', response.headers.get('x-ms-content-md5')), + 'x-ms-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } @@ -270,7 +273,7 @@ def get_properties(self, sharesnapshot=None, timeout=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -341,7 +344,7 @@ def delete(self, timeout=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -392,13 +395,13 @@ def set_http_headers(self, timeout=None, file_content_length=None, file_http_hea then all ranges above the specified byte value are cleared. :type file_content_length: long :param file_http_headers: Additional parameters for the operation - :type file_http_headers: ~file.models.FileHTTPHeaders + :type file_http_headers: ~azure.storage.file.models.FileHTTPHeaders :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) file_content_type = None @@ -491,7 +494,7 @@ def set_metadata(self, timeout=None, metadata=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -555,7 +558,8 @@ def upload_range(self, range, content_length, file_range_write="update", optiona Content-Length header to zero, and set the Range header to a value that indicates the range to clear, up to maximum file size. Possible values include: 'update', 'clear' - :type file_range_write: str or ~file.models.FileRangeWriteType + :type file_range_write: str or + ~azure.storage.file.models.FileRangeWriteType :param content_length: Specifies the number of bytes being transmitted in the request body. When the x-ms-write header is set to clear, the value of this header must be set to zero. @@ -579,7 +583,7 @@ def upload_range(self, range, content_length, file_range_write="update", optiona :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "range" @@ -649,9 +653,9 @@ def get_range_list(self, sharesnapshot=None, timeout=None, range=None, cls=None, :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~file.models.Range] + :rtype: list[~azure.storage.file.models.Range] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "rangelist" @@ -733,7 +737,7 @@ def start_copy(self, copy_source, timeout=None, metadata=None, cls=None, **kwarg :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -795,7 +799,7 @@ def abort_copy(self, copy_id, timeout=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "copy" @@ -863,9 +867,9 @@ def list_handles(self, marker=None, maxresults=None, timeout=None, sharesnapshot :param callable cls: A custom type or function that will be passed the direct response :return: ListHandlesResponse or the result of cls(response) - :rtype: ~file.models.ListHandlesResponse + :rtype: ~azure.storage.file.models.ListHandlesResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "listhandles" @@ -947,7 +951,7 @@ def force_close_handles(self, handle_id, timeout=None, marker=None, sharesnapsho :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "forceclosehandles" diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_service_operations.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_service_operations.py index 55c5a4ab85b2..8283028768ce 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_service_operations.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_service_operations.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -41,7 +44,7 @@ def set_properties(self, storage_service_properties, timeout=None, cls=None, **k :param storage_service_properties: The StorageService properties. :type storage_service_properties: - ~file.models.StorageServiceProperties + ~azure.storage.file.models.StorageServiceProperties :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -52,7 +55,7 @@ def set_properties(self, storage_service_properties, timeout=None, cls=None, **k :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -110,9 +113,9 @@ def get_properties(self, timeout=None, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: StorageServiceProperties or the result of cls(response) - :rtype: ~file.models.StorageServiceProperties + :rtype: ~azure.storage.file.models.StorageServiceProperties :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -181,7 +184,8 @@ def list_shares_segment(self, prefix=None, marker=None, maxresults=None, include :type maxresults: int :param include: Include this parameter to specify one or more datasets to include in the response. - :type include: list[str or ~file.models.ListSharesIncludeType] + :type include: list[str or + ~azure.storage.file.models.ListSharesIncludeType] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -190,9 +194,9 @@ def list_shares_segment(self, prefix=None, marker=None, maxresults=None, include :param callable cls: A custom type or function that will be passed the direct response :return: ListSharesResponse or the result of cls(response) - :rtype: ~file.models.ListSharesResponse + :rtype: ~azure.storage.file.models.ListSharesResponse :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "list" diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_share_operations.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_share_operations.py index 6028e9e34917..6693d31cf218 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_share_operations.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/operations/_share_operations.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -53,7 +56,7 @@ def create(self, timeout=None, metadata=None, quota=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -116,7 +119,7 @@ def get_properties(self, sharesnapshot=None, timeout=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -177,13 +180,14 @@ def delete(self, sharesnapshot=None, timeout=None, delete_snapshots=None, cls=No :param delete_snapshots: Specifies the option include to delete the base share and all of its snapshots. Possible values include: 'include' - :type delete_snapshots: str or ~file.models.DeleteSnapshotsOptionType + :type delete_snapshots: str or + ~azure.storage.file.models.DeleteSnapshotsOptionType :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -242,7 +246,7 @@ def create_snapshot(self, timeout=None, metadata=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "snapshot" @@ -304,7 +308,7 @@ def set_quota(self, timeout=None, quota=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -366,7 +370,7 @@ def set_metadata(self, timeout=None, metadata=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -424,9 +428,9 @@ def get_access_policy(self, timeout=None, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~file.models.SignedIdentifier] + :rtype: list[~azure.storage.file.models.SignedIdentifier] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "acl" @@ -482,7 +486,7 @@ def set_access_policy(self, share_acl=None, timeout=None, cls=None, **kwargs): """Sets a stored access policy for use with shared access signatures. :param share_acl: The ACL for the share. - :type share_acl: list[~file.models.SignedIdentifier] + :type share_acl: list[~azure.storage.file.models.SignedIdentifier] :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -493,7 +497,7 @@ def set_access_policy(self, share_acl=None, timeout=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "acl" @@ -520,8 +524,7 @@ def set_access_policy(self, share_acl=None, timeout=None, cls=None, **kwargs): # Construct body serialization_ctxt = {'xml': {'name': 'SignedIdentifiers', 'itemsName': 'SignedIdentifier', 'wrapped': True}} if share_acl is not None: - body_content = self._serialize.serialize_iter(share_acl, 'SignedIdentifier', - serialization_ctxt=serialization_ctxt) + body_content = self._serialize.body(share_acl, '[SignedIdentifier]', serialization_ctxt=serialization_ctxt) else: body_content = None @@ -557,9 +560,9 @@ def get_statistics(self, timeout=None, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: ShareStats or the result of cls(response) - :rtype: ~file.models.ShareStats + :rtype: ~azure.storage.file.models.ShareStats :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "stats" diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_generated/version.py b/sdk/storage/azure-storage-file/azure/storage/file/_generated/version.py index f93afe178a08..3d08b008d2d6 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_generated/version.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_generated/version.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file VERSION = "2018-11-09" diff --git a/sdk/storage/azure-storage-file/swagger/README.md b/sdk/storage/azure-storage-file/swagger/README.md new file mode 100644 index 000000000000..799b8dc6ae8f --- /dev/null +++ b/sdk/storage/azure-storage-file/swagger/README.md @@ -0,0 +1,51 @@ +# Azure File Storage for Python + +> see https://aka.ms/autorest + +### Setup +```ps +cd C:\work +git clone --recursive https://github.com/Azure/autorest.python.git +cd autorest.python +git checkout azure-core +npm install +``` + +### Generation +```ps +cd +autorest --use=C:/work/autorest.python --version=2.0.4280 +``` + +### Settings +``` yaml +input-file: ./file-2018-11-09.json +output-folder: ../azure/storage/file/_generated +namespace: azure.storage.file +no-namespace-folders: true +license-header: MICROSOFT_MIT_NO_VERSION +enable-xml: true +vanilla: true +clear-output-folder: true +python: true +``` + +### Remove x-ms-pageable +Currently breaking the latest version of autorest.python +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]..get + transform: > + if ($["x-ms-pageable"]) { delete $["x-ms-pageable"]; } +``` + +### Use strings for dates when python doesn't have enough precision +``` yaml +directive: +- from: swagger-document + where: $.definitions.AccessPolicy.properties + transform: > + $.Start.format = "str"; + $.Expiry.format = "str"; +``` \ No newline at end of file diff --git a/sdk/storage/azure-storage-file/swagger/file.json b/sdk/storage/azure-storage-file/swagger/file-2018-11-09.json similarity index 100% rename from sdk/storage/azure-storage-file/swagger/file.json rename to sdk/storage/azure-storage-file/swagger/file-2018-11-09.json diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/__init__.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/__init__.py index f3ca950f4944..1ee3b7536cf5 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/__init__.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/__init__.py @@ -1,14 +1,16 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -from ._configuration import AzureQueueStorageConfiguration from ._azure_queue_storage import AzureQueueStorage -__all__ = ['AzureQueueStorage', 'AzureQueueStorageConfiguration'] +__all__ = ['AzureQueueStorage'] from .version import VERSION diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_azure_queue_storage.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_azure_queue_storage.py index 8129624d2c7a..1ede9645d07c 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_azure_queue_storage.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_azure_queue_storage.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core import PipelineClient from msrest import Serializer, Deserializer @@ -23,23 +26,23 @@ class AzureQueueStorage(object): :ivar service: Service operations - :vartype service: queue.operations.ServiceOperations + :vartype service: azure.storage.queue.operations.ServiceOperations :ivar queue: Queue operations - :vartype queue: queue.operations.QueueOperations + :vartype queue: azure.storage.queue.operations.QueueOperations :ivar messages: Messages operations - :vartype messages: queue.operations.MessagesOperations + :vartype messages: azure.storage.queue.operations.MessagesOperations :ivar message_id: MessageId operations - :vartype message_id: queue.operations.MessageIdOperations + :vartype message_id: azure.storage.queue.operations.MessageIdOperations :param url: The URL of the service account, queue or message that is the targe of the desired operation. :type url: str """ - def __init__(self, url, config=None, **kwargs): + def __init__(self, url, **kwargs): base_url = '{url}' - self._config = config or AzureQueueStorageConfiguration(url, **kwargs) + self._config = AzureQueueStorageConfiguration(url, **kwargs) self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_configuration.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_configuration.py index 78e0f1b2e37a..75443cb798a4 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_configuration.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/_configuration.py @@ -1,12 +1,15 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -from azure.core.configuration import Configuration, ConnectionConfiguration +from azure.core.configuration import Configuration from azure.core.pipeline import policies from .version import VERSION @@ -33,19 +36,17 @@ def __init__(self, url, **kwargs): super(AzureQueueStorageConfiguration, self).__init__(**kwargs) self._configure(**kwargs) - self.user_agent_policy.add_user_agent('azurequeuestorage/{}'.format(VERSION)) + self.user_agent_policy.add_user_agent('azsdk-python-azurequeuestorage/{}'.format(VERSION)) self.generate_client_request_id = True - self.accept_language = None self.url = url self.version = "2018-03-28" def _configure(self, **kwargs): - self.connection = ConnectionConfiguration(**kwargs) - self.user_agent_policy = policies.UserAgentPolicy(**kwargs) - self.headers_policy = policies.HeadersPolicy(**kwargs) - self.proxy_policy = policies.ProxyPolicy(**kwargs) - self.logging_policy = policies.NetworkTraceLoggingPolicy(**kwargs) - self.retry_policy = policies.RetryPolicy(**kwargs) - self.custom_hook_policy = policies.CustomHookPolicy(**kwargs) - self.redirect_policy = policies.RedirectPolicy(**kwargs) + 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.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) diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/__init__.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/__init__.py index 6cdb3f3b6528..a6c00c21eb19 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/__init__.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/__init__.py @@ -1,11 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from ._azure_queue_storage_async import AzureQueueStorage -from ._configuration_async import AzureQueueStorageConfiguration -__all__ = ['AzureQueueStorage', 'AzureQueueStorageConfiguration'] +__all__ = ['AzureQueueStorage'] diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_azure_queue_storage_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_azure_queue_storage_async.py index 67bc78c251a7..5784a84c9dac 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_azure_queue_storage_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_azure_queue_storage_async.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core import AsyncPipelineClient from msrest import Serializer, Deserializer @@ -23,13 +26,13 @@ class AzureQueueStorage(object): :ivar service: Service operations - :vartype service: queue.aio.operations_async.ServiceOperations + :vartype service: azure.storage.queue.aio.operations_async.ServiceOperations :ivar queue: Queue operations - :vartype queue: queue.aio.operations_async.QueueOperations + :vartype queue: azure.storage.queue.aio.operations_async.QueueOperations :ivar messages: Messages operations - :vartype messages: queue.aio.operations_async.MessagesOperations + :vartype messages: azure.storage.queue.aio.operations_async.MessagesOperations :ivar message_id: MessageId operations - :vartype message_id: queue.aio.operations_async.MessageIdOperations + :vartype message_id: azure.storage.queue.aio.operations_async.MessageIdOperations :param url: The URL of the service account, queue or message that is the targe of the desired operation. @@ -37,10 +40,10 @@ class AzureQueueStorage(object): """ def __init__( - self, url, config=None, **kwargs): + self, url, **kwargs): base_url = '{url}' - self._config = config or AzureQueueStorageConfiguration(url, **kwargs) + self._config = AzureQueueStorageConfiguration(url, **kwargs) self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_configuration_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_configuration_async.py index 898075e85084..5cbe3a2db1e0 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_configuration_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/_configuration_async.py @@ -1,12 +1,15 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file -from azure.core.configuration import Configuration, ConnectionConfiguration +from azure.core.configuration import Configuration from azure.core.pipeline import policies from ..version import VERSION @@ -33,7 +36,7 @@ def __init__(self, url, **kwargs): super(AzureQueueStorageConfiguration, self).__init__(**kwargs) self._configure(**kwargs) - self.user_agent_policy.add_user_agent('azurequeuestorage/{}'.format(VERSION)) + self.user_agent_policy.add_user_agent('azsdk-python-azurequeuestorage/{}'.format(VERSION)) self.generate_client_request_id = True self.accept_language = None @@ -41,10 +44,10 @@ def __init__(self, url, **kwargs): self.version = "2018-03-28" def _configure(self, **kwargs): - self.connection = ConnectionConfiguration(**kwargs) - self.user_agent_policy = policies.UserAgentPolicy(**kwargs) - self.headers_policy = policies.HeadersPolicy(**kwargs) - self.proxy_policy = policies.ProxyPolicy(**kwargs) - self.logging_policy = policies.NetworkTraceLoggingPolicy(**kwargs) - self.retry_policy = policies.AsyncRetryPolicy(**kwargs) - self.redirect_policy = policies.AsyncRedirectPolicy(**kwargs) + 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.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) diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/__init__.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/__init__.py index 3f0b116c598d..6d9d66736b9d 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/__init__.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/__init__.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from ._service_operations_async import ServiceOperations from ._queue_operations_async import QueueOperations diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_message_id_operations_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_message_id_operations_async.py index dec606a6b13a..1213424f717e 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_message_id_operations_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_message_id_operations_async.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -32,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config - async def update(self, queue_message, pop_receipt, visibilitytimeout, timeout=None, request_id=None, *, cls=None, **kwargs): + async def update(self, pop_receipt, visibilitytimeout, queue_message=None, timeout=None, request_id=None, *, cls=None, **kwargs): """The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message operation updates the visibility timeout of a message. You can also use this operation to update the @@ -40,8 +43,6 @@ async def update(self, queue_message, pop_receipt, visibilitytimeout, timeout=No included in an XML request with UTF-8 encoding, and the encoded message can be up to 64KB in size. - :param queue_message: A Message object which can be stored in a Queue - :type queue_message: ~queue.models.QueueMessage :param pop_receipt: Required. Specifies the valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation. @@ -53,6 +54,8 @@ async def update(self, queue_message, pop_receipt, visibilitytimeout, timeout=No REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time. :type visibilitytimeout: int + :param queue_message: A Message object which can be stored in a Queue + :type queue_message: ~azure.storage.queue.models.QueueMessage :param timeout: The The timeout parameter is expressed in seconds. For more information, see ` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_messages_operations_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_messages_operations_async.py index 30f14a557bc4..2d1dd74990ca 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_messages_operations_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_messages_operations_async.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -63,9 +66,9 @@ async def dequeue(self, number_of_messages=None, visibilitytimeout=None, timeout :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~queue.models.DequeuedMessageItem] + :rtype: list[~azure.storage.queue.models.DequeuedMessageItem] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -134,7 +137,7 @@ async def clear(self, timeout=None, request_id=None, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -174,7 +177,7 @@ async def clear(self, timeout=None, request_id=None, *, cls=None, **kwargs): return cls(response, None, response_headers) clear.metadata = {'url': '/{queueName}/messages'} - async def enqueue(self, queue_message, visibilitytimeout=None, message_time_to_live=None, timeout=None, request_id=None, *, cls=None, **kwargs): + async def enqueue(self, queue_message=None, visibilitytimeout=None, message_time_to_live=None, timeout=None, request_id=None, *, cls=None, **kwargs): """The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be specified to make the message invisible until the visibility timeout expires. A message must be in a @@ -183,7 +186,7 @@ async def enqueue(self, queue_message, visibilitytimeout=None, message_time_to_l newer, or 8 KB in size for previous versions. :param queue_message: A Message object which can be stored in a Queue - :type queue_message: ~queue.models.QueueMessage + :type queue_message: ~azure.storage.queue.models.QueueMessage :param visibilitytimeout: Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 @@ -210,9 +213,9 @@ async def enqueue(self, queue_message, visibilitytimeout=None, message_time_to_l :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~queue.models.EnqueuedMessage] + :rtype: list[~azure.storage.queue.models.EnqueuedMessage] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -240,7 +243,10 @@ async def enqueue(self, queue_message, visibilitytimeout=None, message_time_to_l header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') # Construct body - body_content = self._serialize.body(queue_message, 'QueueMessage') + if queue_message is not None: + body_content = self._serialize.body(queue_message, 'QueueMessage') + else: + body_content = None # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -290,9 +296,9 @@ async def peek(self, number_of_messages=None, timeout=None, request_id=None, *, :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~queue.models.PeekedMessageItem] + :rtype: list[~azure.storage.queue.models.PeekedMessageItem] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_queue_operations_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_queue_operations_async.py index 559e1f3cfe82..76a7ac3a98bd 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_queue_operations_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/aio/operations_async/_queue_operations_async.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -56,7 +59,7 @@ async def create(self, timeout=None, metadata=None, request_id=None, *, cls=None :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -115,7 +118,7 @@ async def delete(self, timeout=None, request_id=None, *, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -173,7 +176,7 @@ async def get_properties(self, timeout=None, request_id=None, *, cls=None, **kwa :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -243,7 +246,7 @@ async def set_metadata(self, timeout=None, metadata=None, request_id=None, *, cl :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -304,9 +307,9 @@ async def get_access_policy(self, timeout=None, request_id=None, *, cls=None, ** :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~queue.models.SignedIdentifier] + :rtype: list[~azure.storage.queue.models.SignedIdentifier] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "acl" @@ -362,7 +365,7 @@ async def set_access_policy(self, queue_acl=None, timeout=None, request_id=None, Access Signatures. :param queue_acl: the acls for the queue - :type queue_acl: list[~queue.models.SignedIdentifier] + :type queue_acl: list[~azure.storage.queue.models.SignedIdentifier] :param timeout: The The timeout parameter is expressed in seconds. For more information, see ` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -190,9 +193,9 @@ async def get_statistics(self, timeout=None, request_id=None, *, cls=None, **kwa :param callable cls: A custom type or function that will be passed the direct response :return: StorageServiceStats or the result of cls(response) - :rtype: ~queue.models.StorageServiceStats + :rtype: ~azure.storage.queue.models.StorageServiceStats :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "stats" @@ -270,7 +273,8 @@ async def list_queues_segment(self, prefix=None, marker=None, maxresults=None, i :type maxresults: int :param include: Include this parameter to specify that the queues's metadata be returned as part of the response body. - :type include: list[str or ~queue.models.ListQueuesIncludeType] + :type include: list[str or + ~azure.storage.queue.models.ListQueuesIncludeType] :param timeout: The The timeout parameter is expressed in seconds. For more information, see None: + def __init__(self, *, start: str, expiry: str, permission: str, **kwargs) -> None: super(AccessPolicy, self).__init__(**kwargs) self.start = start self.expiry = expiry @@ -149,7 +152,6 @@ class DequeuedMessageItem(Model): 'dequeue_count': {'key': 'DequeueCount', 'type': 'long', 'xml': {'name': 'DequeueCount'}}, 'message_text': {'key': 'MessageText', 'type': 'str', 'xml': {'name': 'MessageText'}}, } - _xml_map = { 'name': 'QueueMessage' } @@ -203,7 +205,6 @@ class EnqueuedMessage(Model): 'pop_receipt': {'key': 'PopReceipt', 'type': 'str', 'xml': {'name': 'PopReceipt'}}, 'time_next_visible': {'key': 'TimeNextVisible', 'type': 'rfc-1123', 'xml': {'name': 'TimeNextVisible'}}, } - _xml_map = { 'name': 'QueueMessage' } @@ -224,7 +225,7 @@ class GeoReplication(Model): :param status: Required. The status of the secondary location. Possible values include: 'live', 'bootstrap', 'unavailable' - :type status: str or ~queue.models.GeoReplicationStatusType + :type status: str or ~azure.storage.queue.models.GeoReplicationStatusType :param last_sync_time: Required. A GMT date/time value, to the second. All primary writes preceding this value are guaranteed to be available for read operations at the secondary. Primary writes after this point in time @@ -264,7 +265,7 @@ class ListQueuesSegmentResponse(Model): :param max_results: Required. :type max_results: int :param queue_items: - :type queue_items: list[~queue.models.QueueItem] + :type queue_items: list[~azure.storage.queue.models.QueueItem] :param next_marker: Required. :type next_marker: str """ @@ -284,6 +285,9 @@ class ListQueuesSegmentResponse(Model): 'queue_items': {'key': 'QueueItems', 'type': '[QueueItem]', 'xml': {'name': 'Queues', 'itemsName': 'Queues', 'wrapped': True}}, 'next_marker': {'key': 'NextMarker', 'type': 'str', 'xml': {'name': 'NextMarker'}}, } + _xml_map = { + 'name': 'EnumerationResults' + } def __init__(self, *, service_endpoint: str, prefix: str, max_results: int, next_marker: str, marker: str=None, queue_items=None, **kwargs) -> None: super(ListQueuesSegmentResponse, self).__init__(**kwargs) @@ -312,7 +316,7 @@ class Logging(Model): logged. :type write: bool :param retention_policy: Required. - :type retention_policy: ~queue.models.RetentionPolicy + :type retention_policy: ~azure.storage.queue.models.RetentionPolicy """ _validation = { @@ -352,11 +356,11 @@ class Metrics(Model): :param enabled: Required. Indicates whether metrics are enabled for the Queue service. :type enabled: bool - :param include_ap_is: Indicates whether metrics should generate summary + :param include_apis: Indicates whether metrics should generate summary statistics for called API operations. - :type include_ap_is: bool + :type include_apis: bool :param retention_policy: - :type retention_policy: ~queue.models.RetentionPolicy + :type retention_policy: ~azure.storage.queue.models.RetentionPolicy """ _validation = { @@ -372,11 +376,11 @@ class Metrics(Model): _xml_map = { } - def __init__(self, *, enabled: bool, version: str=None, include_ap_is: bool=None, retention_policy=None, **kwargs) -> None: + def __init__(self, *, enabled: bool, version: str=None, include_apis: bool=None, retention_policy=None, **kwargs) -> None: super(Metrics, self).__init__(**kwargs) self.version = version self.enabled = enabled - self.include_ap_is = include_ap_is + self.include_apis = include_apis self.retention_policy = retention_policy @@ -416,7 +420,6 @@ class PeekedMessageItem(Model): 'dequeue_count': {'key': 'DequeueCount', 'type': 'long', 'xml': {'name': 'DequeueCount'}}, 'message_text': {'key': 'MessageText', 'type': 'str', 'xml': {'name': 'MessageText'}}, } - _xml_map = { 'name': 'QueueMessage' } @@ -449,6 +452,9 @@ class QueueItem(Model): 'name': {'key': 'Name', 'type': 'str', 'xml': {'name': 'Name'}}, 'metadata': {'key': 'Metadata', 'type': '{str}', 'xml': {'name': 'Metadata'}}, } + _xml_map = { + 'name': 'Queue' + } def __init__(self, *, name: str, metadata=None, **kwargs) -> None: super(QueueItem, self).__init__(**kwargs) @@ -472,9 +478,7 @@ class QueueMessage(Model): _attribute_map = { 'message_text': {'key': 'MessageText', 'type': 'str', 'xml': {'name': 'MessageText'}}, } - _xml_map = { - 'name': 'QueueMessage' } def __init__(self, *, message_text: str, **kwargs) -> None: @@ -521,13 +525,12 @@ class SignedIdentifier(Model): :param id: Required. a unique id :type id: str - :param access_policy: Required. The access policy - :type access_policy: ~queue.models.AccessPolicy + :param access_policy: The access policy + :type access_policy: ~azure.storage.queue.models.AccessPolicy """ _validation = { 'id': {'required': True}, - 'access_policy': {'required': True}, } _attribute_map = { @@ -537,7 +540,7 @@ class SignedIdentifier(Model): _xml_map = { } - def __init__(self, *, id: str, access_policy, **kwargs) -> None: + def __init__(self, *, id: str, access_policy=None, **kwargs) -> None: super(SignedIdentifier, self).__init__(**kwargs) self.id = id self.access_policy = access_policy @@ -581,15 +584,15 @@ class StorageServiceProperties(Model): """Storage Service Properties. :param logging: Azure Analytics Logging settings - :type logging: ~queue.models.Logging + :type logging: ~azure.storage.queue.models.Logging :param hour_metrics: A summary of request statistics grouped by API in hourly aggregates for queues - :type hour_metrics: ~queue.models.Metrics + :type hour_metrics: ~azure.storage.queue.models.Metrics :param minute_metrics: a summary of request statistics grouped by API in minute aggregates for queues - :type minute_metrics: ~queue.models.Metrics + :type minute_metrics: ~azure.storage.queue.models.Metrics :param cors: The set of CORS rules. - :type cors: list[~queue.models.CorsRule] + :type cors: list[~azure.storage.queue.models.CorsRule] """ _attribute_map = { @@ -614,7 +617,7 @@ class StorageServiceStats(Model): :param geo_replication: Geo-Replication information for the Secondary Storage Service - :type geo_replication: ~queue.models.GeoReplication + :type geo_replication: ~azure.storage.queue.models.GeoReplication """ _attribute_map = { diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/__init__.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/__init__.py index 454a7377fa00..d600f5294c7f 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/__init__.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/__init__.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from ._service_operations import ServiceOperations from ._queue_operations import QueueOperations diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_message_id_operations.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_message_id_operations.py index 0de068c5bc5d..8be7a24dbb60 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_message_id_operations.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_message_id_operations.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -32,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._config = config - def update(self, queue_message, pop_receipt, visibilitytimeout=None, timeout=None, request_id=None, cls=None, **kwargs): + def update(self, pop_receipt, visibilitytimeout, queue_message=None, timeout=None, request_id=None, cls=None, **kwargs): """The Update operation was introduced with version 2011-08-18 of the Queue service API. The Update Message operation updates the visibility timeout of a message. You can also use this operation to update the @@ -40,8 +43,6 @@ def update(self, queue_message, pop_receipt, visibilitytimeout=None, timeout=Non included in an XML request with UTF-8 encoding, and the encoded message can be up to 64KB in size. - :param queue_message: A Message object which can be stored in a Queue - :type queue_message: ~queue.models.QueueMessage :param pop_receipt: Required. Specifies the valid pop receipt value returned from an earlier call to the Get Messages or Update Message operation. @@ -53,6 +54,8 @@ def update(self, queue_message, pop_receipt, visibilitytimeout=None, timeout=Non REST protocol versions prior to version 2011-08-18. The visibility timeout of a message can be set to a value later than the expiry time. :type visibilitytimeout: int + :param queue_message: A Message object which can be stored in a Queue + :type queue_message: ~azure.storage.queue.models.QueueMessage :param timeout: The The timeout parameter is expressed in seconds. For more information, see ` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_messages_operations.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_messages_operations.py index a2c6a2a4632a..ccd00ceaa53a 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_messages_operations.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_messages_operations.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -63,9 +66,9 @@ def dequeue(self, number_of_messages=None, visibilitytimeout=None, timeout=None, :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~queue.models.DequeuedMessageItem] + :rtype: list[~azure.storage.queue.models.DequeuedMessageItem] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -134,7 +137,7 @@ def clear(self, timeout=None, request_id=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -174,7 +177,7 @@ def clear(self, timeout=None, request_id=None, cls=None, **kwargs): return cls(response, None, response_headers) clear.metadata = {'url': '/{queueName}/messages'} - def enqueue(self, queue_message, visibilitytimeout=None, message_time_to_live=None, timeout=None, request_id=None, cls=None, **kwargs): + def enqueue(self, queue_message=None, visibilitytimeout=None, message_time_to_live=None, timeout=None, request_id=None, cls=None, **kwargs): """The Enqueue operation adds a new message to the back of the message queue. A visibility timeout can also be specified to make the message invisible until the visibility timeout expires. A message must be in a @@ -183,7 +186,7 @@ def enqueue(self, queue_message, visibilitytimeout=None, message_time_to_live=No newer, or 8 KB in size for previous versions. :param queue_message: A Message object which can be stored in a Queue - :type queue_message: ~queue.models.QueueMessage + :type queue_message: ~azure.storage.queue.models.QueueMessage :param visibilitytimeout: Optional. Specifies the new visibility timeout value, in seconds, relative to server time. The default value is 30 seconds. A specified value must be larger than or equal to 1 @@ -210,9 +213,9 @@ def enqueue(self, queue_message, visibilitytimeout=None, message_time_to_live=No :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~queue.models.EnqueuedMessage] + :rtype: list[~azure.storage.queue.models.EnqueuedMessage] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -240,7 +243,10 @@ def enqueue(self, queue_message, visibilitytimeout=None, message_time_to_live=No header_parameters['x-ms-client-request-id'] = self._serialize.header("request_id", request_id, 'str') # Construct body - body_content = self._serialize.body(queue_message, 'QueueMessage') + if queue_message is not None: + body_content = self._serialize.body(queue_message, 'QueueMessage') + else: + body_content = None # Construct and send request request = self._client.post(url, query_parameters, header_parameters, body_content) @@ -290,9 +296,9 @@ def peek(self, number_of_messages=None, timeout=None, request_id=None, cls=None, :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~queue.models.PeekedMessageItem] + :rtype: list[~azure.storage.queue.models.PeekedMessageItem] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_queue_operations.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_queue_operations.py index 228caef49c45..02618d6a1707 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_queue_operations.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/operations/_queue_operations.py @@ -1,10 +1,13 @@ # coding=utf-8 # -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -# pylint: skip-file from azure.core.exceptions import map_error @@ -56,7 +59,7 @@ def create(self, timeout=None, metadata=None, request_id=None, cls=None, **kwarg :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -115,7 +118,7 @@ def delete(self, timeout=None, request_id=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) # Construct URL @@ -173,7 +176,7 @@ def get_properties(self, timeout=None, request_id=None, cls=None, **kwargs): :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -243,7 +246,7 @@ def set_metadata(self, timeout=None, metadata=None, request_id=None, cls=None, * :return: None or the result of cls(response) :rtype: None :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "metadata" @@ -304,9 +307,9 @@ def get_access_policy(self, timeout=None, request_id=None, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: list or the result of cls(response) - :rtype: list[~queue.models.SignedIdentifier] + :rtype: list[~azure.storage.queue.models.SignedIdentifier] :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "acl" @@ -362,7 +365,7 @@ def set_access_policy(self, queue_acl=None, timeout=None, request_id=None, cls=N Access Signatures. :param queue_acl: the acls for the queue - :type queue_acl: list[~queue.models.SignedIdentifier] + :type queue_acl: list[~azure.storage.queue.models.SignedIdentifier] :param timeout: The The timeout parameter is expressed in seconds. For more information, see ` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "properties" @@ -190,9 +193,9 @@ def get_statistics(self, timeout=None, request_id=None, cls=None, **kwargs): :param callable cls: A custom type or function that will be passed the direct response :return: StorageServiceStats or the result of cls(response) - :rtype: ~queue.models.StorageServiceStats + :rtype: ~azure.storage.queue.models.StorageServiceStats :raises: - :class:`StorageErrorException` + :class:`StorageErrorException` """ error_map = kwargs.pop('error_map', None) comp = "stats" @@ -270,7 +273,8 @@ def list_queues_segment(self, prefix=None, marker=None, maxresults=None, include :type maxresults: int :param include: Include this parameter to specify that the queues's metadata be returned as part of the response body. - :type include: list[str or ~queue.models.ListQueuesIncludeType] + :type include: list[str or + ~azure.storage.queue.models.ListQueuesIncludeType] :param timeout: The The timeout parameter is expressed in seconds. For more information, see see https://aka.ms/autorest + +### Setup +```ps +cd C:\work +git clone --recursive https://github.com/Azure/autorest.python.git +cd autorest.python +git checkout azure-core +npm install +``` + +### Generation +```ps +cd +autorest --use=C:/work/autorest.python --version=2.0.4280 +``` + +### Settings +``` yaml +input-file: ./queue-2018-03-28.json +output-folder: ../azure/storage/queue/_generated +namespace: azure.storage.queue +no-namespace-folders: true +license-header: MICROSOFT_MIT_NO_VERSION +enable-xml: true +vanilla: true +clear-output-folder: true +python: true +``` + +### Remove x-ms-pageable +Currently breaking the latest version of autorest.python +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]..get + transform: > + if ($["x-ms-pageable"]) { delete $["x-ms-pageable"]; } +``` + +### Use strings for dates when python doesn't have enough precision +``` yaml +directive: +- from: swagger-document + where: $.definitions.AccessPolicy.properties + transform: > + $.Start.format = "str"; + $.Expiry.format = "str"; +``` + +### SignedIdentifier shouldn't require an AccessPolicy, only ID +``` yaml +directive: +- from: swagger-document + where: $.definitions.SignedIdentifier + transform: > + $.required = [ "Id" ]; +``` + +### QueueMessage is required for enqueue, but not for update +``` yaml +directive: +- from: swagger-document + where: $.parameters.QueueMessage + transform: > + $.required = false; +``` diff --git a/sdk/storage/azure-storage-queue/swagger/queue.json b/sdk/storage/azure-storage-queue/swagger/queue-2018-03-28.json similarity index 100% rename from sdk/storage/azure-storage-queue/swagger/queue.json rename to sdk/storage/azure-storage-queue/swagger/queue-2018-03-28.json diff --git a/sdk/storage/azure-storage-queue/tests/test_queue.py b/sdk/storage/azure-storage-queue/tests/test_queue.py index bff9879d1024..02f82a2b80d3 100644 --- a/sdk/storage/azure-storage-queue/tests/test_queue.py +++ b/sdk/storage/azure-storage-queue/tests/test_queue.py @@ -745,7 +745,7 @@ def test_set_queue_acl_with_empty_signed_identifier(self): queue_client = self._create_queue() # Act - queue_client.set_queue_access_policy(signed_identifiers={'empty': AccessPolicy()}) + queue_client.set_queue_access_policy(signed_identifiers={'empty': None}) # Assert acl = queue_client.get_queue_access_policy() diff --git a/sdk/storage/azure-storage-queue/tests/test_queue_async.py b/sdk/storage/azure-storage-queue/tests/test_queue_async.py index 3ae8bbd1081c..e21b13f9c6fb 100644 --- a/sdk/storage/azure-storage-queue/tests/test_queue_async.py +++ b/sdk/storage/azure-storage-queue/tests/test_queue_async.py @@ -944,7 +944,7 @@ async def _test_set_queue_acl_with_empty_signed_identifier(self): queue_client = await self._create_queue() # Act - await queue_client.set_queue_access_policy(signed_identifiers={'empty': AccessPolicy()}) + await queue_client.set_queue_access_policy(signed_identifiers={'empty': None}) # Assert acl = await queue_client.get_queue_access_policy()