From 3b75da7d4ab78fa178d058e6e6b75dc5294de329 Mon Sep 17 00:00:00 2001 From: tg-msft Date: Tue, 20 Aug 2019 15:29:32 -0700 Subject: [PATCH 1/2] Updating Storage Files swagger to 2019-02-02 This includes a few transform changes to set default values for new required parameters and marked certain 8601 dates as strings when they use more precision that Python's dates. I'm seeing a few test failures that I'm hoping someone on the Python side can investigate (mostly "The specified share is being deleted. Try operation later." that I was seeing before my changes). There are a few other failures related to new service features that we can fix if easy or disable and file a work item to get these changes in. The recorded tests will also have to be updated, but we don't need to block on that right now. --- .../file/_generated/_azure_file_storage.py | 2 +- .../aio/_azure_file_storage_async.py | 2 +- .../_directory_operations_async.py | 136 +- .../_file_operations_async.py | 202 +- .../_share_operations_async.py | 117 + .../file/_generated/models/__init__.py | 3 + .../storage/file/_generated/models/_models.py | 24 + .../file/_generated/models/_models_py3.py | 24 + .../operations/_directory_operations.py | 136 +- .../_generated/operations/_file_operations.py | 202 +- .../operations/_share_operations.py | 117 + .../azure/storage/file/_generated/version.py | 2 +- .../storage/file/aio/file_client_async.py | 9 +- .../azure/storage/file/file_client.py | 4 + .../azure-storage-file/swagger/README.md | 51 +- .../swagger/file-2019-02-02.json | 4359 +++++++++++++++++ 16 files changed, 5376 insertions(+), 14 deletions(-) create mode 100644 sdk/storage/azure-storage-file/swagger/file-2019-02-02.json 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 e3a814d83f1a..64364407a06b 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 @@ -49,7 +49,7 @@ def __init__(self, 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)} - self.api_version = '2018-11-09' + self.api_version = '2019-02-02' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) 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 dd86db3045cc..436bf74ad244 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 @@ -50,7 +50,7 @@ def __init__( 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-11-09' + self.api_version = '2019-02-02' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) 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 17f8a28e4094..13a8c729c76a 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 @@ -37,9 +37,19 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config self.restype = "directory" - async def create(self, timeout=None, metadata=None, *, cls=None, **kwargs): + async def create(self, file_attributes="none", file_creation_time="now", file_last_write_time="now", timeout=None, metadata=None, file_permission="inherit", file_permission_key=None, *, cls=None, **kwargs): """Creates a new directory under the specified share or parent directory. + :param file_attributes: If specified, the provided file attributes + shall be set. Default value: ‘Archive’ for file and ‘Directory’ for + directory. ‘None’ can also be specified as default. + :type file_attributes: str + :param file_creation_time: Creation time for the file/directory. + Default value: Now. + :type file_creation_time: str + :param file_last_write_time: Last write time for the file/directory. + Default value: Now. + :type file_last_write_time: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -48,6 +58,17 @@ async def create(self, timeout=None, metadata=None, *, cls=None, **kwargs): :param metadata: A name-value pair to associate with a file storage object. :type metadata: str + :param file_permission: If specified the permission (security + descriptor) shall be set for the directory/file. This header can be + used if Permission size is <= 8KB, else x-ms-file-permission-key + header shall be used. Default value: Inherit. If SDDL is specified as + input, it must have owner, group and dacl. Note: Only one of the + x-ms-file-permission or x-ms-file-permission-key should be specified. + :type file_permission: str + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: str :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -74,6 +95,13 @@ async def create(self, timeout=None, metadata=None, *, cls=None, **kwargs): if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if file_permission is not None: + header_parameters['x-ms-file-permission'] = self._serialize.header("file_permission", file_permission, 'str') + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-file-attributes'] = self._serialize.header("file_attributes", file_attributes, 'str') + header_parameters['x-ms-file-creation-time'] = self._serialize.header("file_creation_time", file_creation_time, 'str') + header_parameters['x-ms-file-last-write-time'] = self._serialize.header("file_last_write_time", file_last_write_time, 'str') # Construct and send request request = self._client.put(url, query_parameters, header_parameters) @@ -92,6 +120,13 @@ async def create(self, timeout=None, metadata=None, *, cls=None, **kwargs): '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -155,6 +190,13 @@ async def get_properties(self, sharesnapshot=None, timeout=None, *, cls=None, ** 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), '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-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -213,6 +255,98 @@ async def delete(self, timeout=None, *, cls=None, **kwargs): return cls(response, None, response_headers) delete.metadata = {'url': '/{shareName}/{directory}'} + async def set_properties(self, file_attributes="none", file_creation_time="now", file_last_write_time="now", timeout=None, file_permission="inherit", file_permission_key=None, *, cls=None, **kwargs): + """Sets properties on the directory. + + :param file_attributes: If specified, the provided file attributes + shall be set. Default value: ‘Archive’ for file and ‘Directory’ for + directory. ‘None’ can also be specified as default. + :type file_attributes: str + :param file_creation_time: Creation time for the file/directory. + Default value: Now. + :type file_creation_time: str + :param file_last_write_time: Last write time for the file/directory. + Default value: Now. + :type file_last_write_time: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for File Service Operations. + :type timeout: int + :param file_permission: If specified the permission (security + descriptor) shall be set for the directory/file. This header can be + used if Permission size is <= 8KB, else x-ms-file-permission-key + header shall be used. Default value: Inherit. If SDDL is specified as + input, it must have owner, group and dacl. Note: Only one of the + x-ms-file-permission or x-ms-file-permission-key should be specified. + :type file_permission: str + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: 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 = "properties" + + # Construct URL + url = self.set_properties.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-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if file_permission is not None: + header_parameters['x-ms-file-permission'] = self._serialize.header("file_permission", file_permission, 'str') + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-file-attributes'] = self._serialize.header("file_attributes", file_attributes, 'str') + header_parameters['x-ms-file-creation-time'] = self._serialize.header("file_creation_time", file_creation_time, 'str') + header_parameters['x-ms-file-last-write-time'] = self._serialize.header("file_last_write_time", file_last_write_time, '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 [200]: + 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')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + set_properties.metadata = {'url': '/{shareName}/{directory}'} + async def set_metadata(self, timeout=None, metadata=None, *, cls=None, **kwargs): """Updates user defined metadata for the specified directory. 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 e0f0a0dc847b..87b76b55326a 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 @@ -24,6 +24,7 @@ class FileOperations: :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar x_ms_type: Dummy constant parameter, file type can only be file. Constant value: "file". + :ivar x_ms_write: Only update is supported: - Update: Writes the bytes downloaded from the source url into the specified range. Constant value: "update". :ivar x_ms_copy_action: . Constant value: "abort". """ @@ -37,15 +38,26 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config self.x_ms_type = "file" + self.x_ms_write = "update" self.x_ms_copy_action = "abort" - async def create(self, file_content_length, timeout=None, metadata=None, file_http_headers=None, *, cls=None, **kwargs): + async def create(self, file_content_length, file_attributes="none", file_creation_time="now", file_last_write_time="now", timeout=None, metadata=None, file_permission="inherit", file_permission_key=None, file_http_headers=None, *, cls=None, **kwargs): """Creates a new file or replaces a file. Note it only initializes the file with no content. :param file_content_length: Specifies the maximum size for the file, up to 1 TB. :type file_content_length: long + :param file_attributes: If specified, the provided file attributes + shall be set. Default value: ‘Archive’ for file and ‘Directory’ for + directory. ‘None’ can also be specified as default. + :type file_attributes: str + :param file_creation_time: Creation time for the file/directory. + Default value: Now. + :type file_creation_time: str + :param file_last_write_time: Last write time for the file/directory. + Default value: Now. + :type file_last_write_time: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -54,6 +66,17 @@ async def create(self, file_content_length, timeout=None, metadata=None, file_ht :param metadata: A name-value pair to associate with a file storage object. :type metadata: str + :param file_permission: If specified the permission (security + descriptor) shall be set for the directory/file. This header can be + used if Permission size is <= 8KB, else x-ms-file-permission-key + header shall be used. Default value: Inherit. If SDDL is specified as + input, it must have owner, group and dacl. Note: Only one of the + x-ms-file-permission or x-ms-file-permission-key should be specified. + :type file_permission: str + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: str :param file_http_headers: Additional parameters for the operation :type file_http_headers: ~azure.storage.file.models.FileHTTPHeaders :param callable cls: A custom type or function that will be passed the @@ -102,6 +125,13 @@ async def create(self, file_content_length, timeout=None, metadata=None, file_ht header_parameters['x-ms-type'] = self._serialize.header("self.x_ms_type", self.x_ms_type, 'str') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if file_permission is not None: + header_parameters['x-ms-file-permission'] = self._serialize.header("file_permission", file_permission, 'str') + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-file-attributes'] = self._serialize.header("file_attributes", file_attributes, 'str') + header_parameters['x-ms-file-creation-time'] = self._serialize.header("file_creation_time", file_creation_time, 'str') + header_parameters['x-ms-file-last-write-time'] = self._serialize.header("file_last_write_time", file_last_write_time, 'str') if file_content_type is not None: header_parameters['x-ms-content-type'] = self._serialize.header("file_content_type", file_content_type, 'str') if file_content_encoding is not None: @@ -132,6 +162,13 @@ async def create(self, file_content_length, timeout=None, metadata=None, file_ht '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -220,6 +257,13 @@ async def download(self, timeout=None, range=None, range_get_content_md5=None, * 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), '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-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } if response.status_code == 206: @@ -248,6 +292,13 @@ async def download(self, timeout=None, range=None, range_get_content_md5=None, * 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), '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-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } @@ -327,6 +378,13 @@ async def get_properties(self, sharesnapshot=None, timeout=None, *, cls=None, ** '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-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -383,9 +441,19 @@ async def delete(self, timeout=None, *, cls=None, **kwargs): return cls(response, None, response_headers) delete.metadata = {'url': '/{shareName}/{directory}/{fileName}'} - async def set_http_headers(self, timeout=None, file_content_length=None, file_http_headers=None, *, cls=None, **kwargs): + async def set_http_headers(self, file_attributes="none", file_creation_time="now", file_last_write_time="now", timeout=None, file_content_length=None, file_permission="inherit", file_permission_key=None, file_http_headers=None, *, cls=None, **kwargs): """Sets HTTP headers on the file. + :param file_attributes: If specified, the provided file attributes + shall be set. Default value: ‘Archive’ for file and ‘Directory’ for + directory. ‘None’ can also be specified as default. + :type file_attributes: str + :param file_creation_time: Creation time for the file/directory. + Default value: Now. + :type file_creation_time: str + :param file_last_write_time: Last write time for the file/directory. + Default value: Now. + :type file_last_write_time: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -395,6 +463,17 @@ async def set_http_headers(self, timeout=None, file_content_length=None, file_ht the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared. :type file_content_length: long + :param file_permission: If specified the permission (security + descriptor) shall be set for the directory/file. This header can be + used if Permission size is <= 8KB, else x-ms-file-permission-key + header shall be used. Default value: Inherit. If SDDL is specified as + input, it must have owner, group and dacl. Note: Only one of the + x-ms-file-permission or x-ms-file-permission-key should be specified. + :type file_permission: str + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: str :param file_http_headers: Additional parameters for the operation :type file_http_headers: ~azure.storage.file.models.FileHTTPHeaders :param callable cls: A custom type or function that will be passed the @@ -444,6 +523,13 @@ async def set_http_headers(self, timeout=None, file_content_length=None, file_ht header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if file_content_length is not None: header_parameters['x-ms-content-length'] = self._serialize.header("file_content_length", file_content_length, 'long') + if file_permission is not None: + header_parameters['x-ms-file-permission'] = self._serialize.header("file_permission", file_permission, 'str') + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-file-attributes'] = self._serialize.header("file_attributes", file_attributes, 'str') + header_parameters['x-ms-file-creation-time'] = self._serialize.header("file_creation_time", file_creation_time, 'str') + header_parameters['x-ms-file-last-write-time'] = self._serialize.header("file_last_write_time", file_last_write_time, 'str') if file_content_type is not None: header_parameters['x-ms-content-type'] = self._serialize.header("file_content_type", file_content_type, 'str') if file_content_encoding is not None: @@ -474,6 +560,13 @@ async def set_http_headers(self, timeout=None, file_content_length=None, file_ht '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -606,7 +699,7 @@ async def upload_range(self, range, content_length, file_range_write="update", o header_parameters = {} header_parameters['Content-Type'] = 'application/octet-stream' header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') - header_parameters['x-ms-write'] = self._serialize.header("file_range_write", file_range_write, 'FileRangeWriteType') + header_parameters['x-ms-write'] = self._serialize.header("self.x_ms_write", self.x_ms_write, 'FileRangeWriteType') header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if content_md5 is not None: header_parameters['Content-MD5'] = self._serialize.header("content_md5", content_md5, 'bytearray') @@ -637,6 +730,109 @@ async def upload_range(self, range, content_length, file_range_write="update", o return cls(response, None, response_headers) upload_range.metadata = {'url': '/{shareName}/{directory}/{fileName}'} + async def upload_range_from_url(self, range, copy_source, content_length, timeout=None, source_range=None, source_content_crc64=None, source_modified_access_conditions=None, *, cls=None, **kwargs): + """Upload a range of bytes to a file where the contents are read from a + URL. + + :param range: Writes data to the specified byte range in the file. + :type range: str + :param copy_source: Specifies the URL of the source file or blob, up + to 2 KB in length. To copy a file to another file within the same + storage account, you may use Shared Key to authenticate the source + file. If you are copying a file from another storage account, or if + you are copying a blob from the same storage account or another + storage account, then you must authenticate the source file or blob + using a shared access signature. If the source is a public blob, no + authentication is required to perform the copy operation. A file in a + share snapshot can also be specified as a copy source. + :type copy_source: str + :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. + :type content_length: long + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for File Service Operations. + :type timeout: int + :param source_range: Bytes of source data in the specified range. + :type source_range: str + :param source_content_crc64: Specify the crc64 calculated for the + range of bytes that must be read from the copy source. + :type source_content_crc64: bytearray + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.file.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) + source_if_match_crc64 = None + if source_modified_access_conditions is not None: + source_if_match_crc64 = source_modified_access_conditions.source_if_match_crc64 + source_if_none_match_crc64 = None + if source_modified_access_conditions is not None: + source_if_none_match_crc64 = source_modified_access_conditions.source_if_none_match_crc64 + + comp = "range" + + # Construct URL + url = self.upload_range_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-range'] = self._serialize.header("range", range, 'str') + header_parameters['x-ms-copy-source'] = self._serialize.header("copy_source", copy_source, 'str') + if source_range is not None: + header_parameters['x-ms-source-range'] = self._serialize.header("source_range", source_range, 'str') + header_parameters['x-ms-write'] = self._serialize.header("self.x_ms_write", self.x_ms_write, 'str') + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + if source_content_crc64 is not None: + header_parameters['x-ms-source-content-crc64'] = self._serialize.header("source_content_crc64", source_content_crc64, 'bytearray') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if source_if_match_crc64 is not None: + header_parameters['x-ms-source-if-match-crc64'] = self._serialize.header("source_if_match_crc64", source_if_match_crc64, 'bytearray') + if source_if_none_match_crc64 is not None: + header_parameters['x-ms-source-if-none-match-crc64'] = self._serialize.header("source_if_none_match_crc64", source_if_none_match_crc64, 'bytearray') + + # 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')), + '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-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_range_from_url.metadata = {'url': '/{shareName}/{directory}/{fileName}'} + async def get_range_list(self, sharesnapshot=None, timeout=None, range=None, *, cls=None, **kwargs): """Returns the list of valid ranges for a file. 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 14f5d174a496..f8097f5d6a12 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 @@ -293,6 +293,123 @@ async def create_snapshot(self, timeout=None, metadata=None, *, cls=None, **kwar return cls(response, None, response_headers) create_snapshot.metadata = {'url': '/{shareName}'} + async def create_permission(self, timeout=None, *, cls=None, **kwargs): + """Create a permission (a security descriptor). + + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for File Service Operations. + :type timeout: int + :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 = "filepermission" + + # Construct URL + url = self.create_permission.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("self.restype", self.restype, 'str') + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, '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 = { + '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + create_permission.metadata = {'url': '/{shareName}'} + + async def get_permission(self, file_permission_key=None, timeout=None, *, cls=None, **kwargs): + """Returns the permission (security descriptor) for a given key. + + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for File Service Operations. + :type timeout: int + :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 = "filepermission" + + # Construct URL + url = self.get_permission.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("self.restype", self.restype, 'str') + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, '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) + + if cls: + response_headers = { + '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) + get_permission.metadata = {'url': '/{shareName}'} + async def set_quota(self, timeout=None, quota=None, *, cls=None, **kwargs): """Sets quota for the specified share. 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 27c92bdded62..ab96ded586e8 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 @@ -28,6 +28,7 @@ from ._models_py3 import ShareProperties from ._models_py3 import ShareStats from ._models_py3 import SignedIdentifier + from ._models_py3 import SourceModifiedAccessConditions from ._models_py3 import StorageError, StorageErrorException from ._models_py3 import StorageServiceProperties except (SyntaxError, ImportError): @@ -49,6 +50,7 @@ from ._models import ShareProperties from ._models import ShareStats from ._models import SignedIdentifier + from ._models import SourceModifiedAccessConditions from ._models import StorageError, StorageErrorException from ._models import StorageServiceProperties from ._azure_file_storage_enums import ( @@ -78,6 +80,7 @@ 'ShareProperties', 'ShareStats', 'SignedIdentifier', + 'SourceModifiedAccessConditions', 'StorageError', 'StorageErrorException', 'StorageServiceProperties', 'StorageErrorCode', 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 ac571b71cac9..7d96070ac55a 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 @@ -682,6 +682,30 @@ def __init__(self, **kwargs): self.access_policy = kwargs.get('access_policy', None) +class SourceModifiedAccessConditions(Model): + """Additional parameters for upload_range_from_url operation. + + :param source_if_match_crc64: Specify the crc64 value to operate only on + range with a matching crc64 checksum. + :type source_if_match_crc64: bytearray + :param source_if_none_match_crc64: Specify the crc64 value to operate only + on range without a matching crc64 checksum. + :type source_if_none_match_crc64: bytearray + """ + + _attribute_map = { + 'source_if_match_crc64': {'key': '', 'type': 'bytearray', 'xml': {'name': 'source_if_match_crc64'}}, + 'source_if_none_match_crc64': {'key': '', 'type': 'bytearray', 'xml': {'name': 'source_if_none_match_crc64'}}, + } + _xml_map = { + } + + def __init__(self, **kwargs): + super(SourceModifiedAccessConditions, self).__init__(**kwargs) + self.source_if_match_crc64 = kwargs.get('source_if_match_crc64', None) + self.source_if_none_match_crc64 = kwargs.get('source_if_none_match_crc64', None) + + class StorageError(Model): """StorageError. 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 17696f9f0efa..59ee91425336 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 @@ -682,6 +682,30 @@ def __init__(self, *, id: str, access_policy=None, **kwargs) -> None: self.access_policy = access_policy +class SourceModifiedAccessConditions(Model): + """Additional parameters for upload_range_from_url operation. + + :param source_if_match_crc64: Specify the crc64 value to operate only on + range with a matching crc64 checksum. + :type source_if_match_crc64: bytearray + :param source_if_none_match_crc64: Specify the crc64 value to operate only + on range without a matching crc64 checksum. + :type source_if_none_match_crc64: bytearray + """ + + _attribute_map = { + 'source_if_match_crc64': {'key': '', 'type': 'bytearray', 'xml': {'name': 'source_if_match_crc64'}}, + 'source_if_none_match_crc64': {'key': '', 'type': 'bytearray', 'xml': {'name': 'source_if_none_match_crc64'}}, + } + _xml_map = { + } + + def __init__(self, *, source_if_match_crc64: bytearray=None, source_if_none_match_crc64: bytearray=None, **kwargs) -> None: + super(SourceModifiedAccessConditions, self).__init__(**kwargs) + self.source_if_match_crc64 = source_if_match_crc64 + self.source_if_none_match_crc64 = source_if_none_match_crc64 + + class StorageError(Model): """StorageError. 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 fc1581c51a45..4cd6176e5959 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 @@ -37,9 +37,19 @@ def __init__(self, client, config, serializer, deserializer): self._config = config self.restype = "directory" - def create(self, timeout=None, metadata=None, cls=None, **kwargs): + def create(self, file_attributes="none", file_creation_time="now", file_last_write_time="now", timeout=None, metadata=None, file_permission="inherit", file_permission_key=None, cls=None, **kwargs): """Creates a new directory under the specified share or parent directory. + :param file_attributes: If specified, the provided file attributes + shall be set. Default value: ‘Archive’ for file and ‘Directory’ for + directory. ‘None’ can also be specified as default. + :type file_attributes: str + :param file_creation_time: Creation time for the file/directory. + Default value: Now. + :type file_creation_time: str + :param file_last_write_time: Last write time for the file/directory. + Default value: Now. + :type file_last_write_time: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -48,6 +58,17 @@ def create(self, timeout=None, metadata=None, cls=None, **kwargs): :param metadata: A name-value pair to associate with a file storage object. :type metadata: str + :param file_permission: If specified the permission (security + descriptor) shall be set for the directory/file. This header can be + used if Permission size is <= 8KB, else x-ms-file-permission-key + header shall be used. Default value: Inherit. If SDDL is specified as + input, it must have owner, group and dacl. Note: Only one of the + x-ms-file-permission or x-ms-file-permission-key should be specified. + :type file_permission: str + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: str :param callable cls: A custom type or function that will be passed the direct response :return: None or the result of cls(response) @@ -74,6 +95,13 @@ def create(self, timeout=None, metadata=None, cls=None, **kwargs): if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if file_permission is not None: + header_parameters['x-ms-file-permission'] = self._serialize.header("file_permission", file_permission, 'str') + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-file-attributes'] = self._serialize.header("file_attributes", file_attributes, 'str') + header_parameters['x-ms-file-creation-time'] = self._serialize.header("file_creation_time", file_creation_time, 'str') + header_parameters['x-ms-file-last-write-time'] = self._serialize.header("file_last_write_time", file_last_write_time, 'str') # Construct and send request request = self._client.put(url, query_parameters, header_parameters) @@ -92,6 +120,13 @@ def create(self, timeout=None, metadata=None, cls=None, **kwargs): '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -155,6 +190,13 @@ def get_properties(self, sharesnapshot=None, timeout=None, cls=None, **kwargs): 'x-ms-version': self._deserialize('str', response.headers.get('x-ms-version')), '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-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -213,6 +255,98 @@ def delete(self, timeout=None, cls=None, **kwargs): return cls(response, None, response_headers) delete.metadata = {'url': '/{shareName}/{directory}'} + def set_properties(self, file_attributes="none", file_creation_time="now", file_last_write_time="now", timeout=None, file_permission="inherit", file_permission_key=None, cls=None, **kwargs): + """Sets properties on the directory. + + :param file_attributes: If specified, the provided file attributes + shall be set. Default value: ‘Archive’ for file and ‘Directory’ for + directory. ‘None’ can also be specified as default. + :type file_attributes: str + :param file_creation_time: Creation time for the file/directory. + Default value: Now. + :type file_creation_time: str + :param file_last_write_time: Last write time for the file/directory. + Default value: Now. + :type file_last_write_time: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for File Service Operations. + :type timeout: int + :param file_permission: If specified the permission (security + descriptor) shall be set for the directory/file. This header can be + used if Permission size is <= 8KB, else x-ms-file-permission-key + header shall be used. Default value: Inherit. If SDDL is specified as + input, it must have owner, group and dacl. Note: Only one of the + x-ms-file-permission or x-ms-file-permission-key should be specified. + :type file_permission: str + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: 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 = "properties" + + # Construct URL + url = self.set_properties.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-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if file_permission is not None: + header_parameters['x-ms-file-permission'] = self._serialize.header("file_permission", file_permission, 'str') + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-file-attributes'] = self._serialize.header("file_attributes", file_attributes, 'str') + header_parameters['x-ms-file-creation-time'] = self._serialize.header("file_creation_time", file_creation_time, 'str') + header_parameters['x-ms-file-last-write-time'] = self._serialize.header("file_last_write_time", file_last_write_time, '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 [200]: + 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')), + 'x-ms-request-id': self._deserialize('str', response.headers.get('x-ms-request-id')), + 'Last-Modified': self._deserialize('rfc-1123', response.headers.get('Last-Modified')), + '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + set_properties.metadata = {'url': '/{shareName}/{directory}'} + def set_metadata(self, timeout=None, metadata=None, cls=None, **kwargs): """Updates user defined metadata for the specified directory. 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 614ed01d0b22..1877b26ac9a6 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 @@ -24,6 +24,7 @@ class FileOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar x_ms_type: Dummy constant parameter, file type can only be file. Constant value: "file". + :ivar x_ms_write: Only update is supported: - Update: Writes the bytes downloaded from the source url into the specified range. Constant value: "update". :ivar x_ms_copy_action: . Constant value: "abort". """ @@ -37,15 +38,26 @@ def __init__(self, client, config, serializer, deserializer): self._config = config self.x_ms_type = "file" + self.x_ms_write = "update" self.x_ms_copy_action = "abort" - def create(self, file_content_length, timeout=None, metadata=None, file_http_headers=None, cls=None, **kwargs): + def create(self, file_content_length, file_attributes="none", file_creation_time="now", file_last_write_time="now", timeout=None, metadata=None, file_permission="inherit", file_permission_key=None, file_http_headers=None, cls=None, **kwargs): """Creates a new file or replaces a file. Note it only initializes the file with no content. :param file_content_length: Specifies the maximum size for the file, up to 1 TB. :type file_content_length: long + :param file_attributes: If specified, the provided file attributes + shall be set. Default value: ‘Archive’ for file and ‘Directory’ for + directory. ‘None’ can also be specified as default. + :type file_attributes: str + :param file_creation_time: Creation time for the file/directory. + Default value: Now. + :type file_creation_time: str + :param file_last_write_time: Last write time for the file/directory. + Default value: Now. + :type file_last_write_time: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -54,6 +66,17 @@ def create(self, file_content_length, timeout=None, metadata=None, file_http_hea :param metadata: A name-value pair to associate with a file storage object. :type metadata: str + :param file_permission: If specified the permission (security + descriptor) shall be set for the directory/file. This header can be + used if Permission size is <= 8KB, else x-ms-file-permission-key + header shall be used. Default value: Inherit. If SDDL is specified as + input, it must have owner, group and dacl. Note: Only one of the + x-ms-file-permission or x-ms-file-permission-key should be specified. + :type file_permission: str + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: str :param file_http_headers: Additional parameters for the operation :type file_http_headers: ~azure.storage.file.models.FileHTTPHeaders :param callable cls: A custom type or function that will be passed the @@ -102,6 +125,13 @@ def create(self, file_content_length, timeout=None, metadata=None, file_http_hea header_parameters['x-ms-type'] = self._serialize.header("self.x_ms_type", self.x_ms_type, 'str') if metadata is not None: header_parameters['x-ms-meta'] = self._serialize.header("metadata", metadata, 'str') + if file_permission is not None: + header_parameters['x-ms-file-permission'] = self._serialize.header("file_permission", file_permission, 'str') + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-file-attributes'] = self._serialize.header("file_attributes", file_attributes, 'str') + header_parameters['x-ms-file-creation-time'] = self._serialize.header("file_creation_time", file_creation_time, 'str') + header_parameters['x-ms-file-last-write-time'] = self._serialize.header("file_last_write_time", file_last_write_time, 'str') if file_content_type is not None: header_parameters['x-ms-content-type'] = self._serialize.header("file_content_type", file_content_type, 'str') if file_content_encoding is not None: @@ -132,6 +162,13 @@ def create(self, file_content_length, timeout=None, metadata=None, file_http_hea '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -219,6 +256,13 @@ def download(self, timeout=None, range=None, range_get_content_md5=None, cls=Non 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), '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-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } if response.status_code == 206: @@ -247,6 +291,13 @@ def download(self, timeout=None, range=None, range_get_content_md5=None, cls=Non 'x-ms-copy-status': self._deserialize(models.CopyStatusType, response.headers.get('x-ms-copy-status')), '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-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } @@ -326,6 +377,13 @@ def get_properties(self, sharesnapshot=None, timeout=None, cls=None, **kwargs): '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-server-encrypted': self._deserialize('bool', response.headers.get('x-ms-server-encrypted')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -382,9 +440,19 @@ def delete(self, timeout=None, cls=None, **kwargs): return cls(response, None, response_headers) delete.metadata = {'url': '/{shareName}/{directory}/{fileName}'} - def set_http_headers(self, timeout=None, file_content_length=None, file_http_headers=None, cls=None, **kwargs): + def set_http_headers(self, file_attributes="none", file_creation_time="now", file_last_write_time="now", timeout=None, file_content_length=None, file_permission="inherit", file_permission_key=None, file_http_headers=None, cls=None, **kwargs): """Sets HTTP headers on the file. + :param file_attributes: If specified, the provided file attributes + shall be set. Default value: ‘Archive’ for file and ‘Directory’ for + directory. ‘None’ can also be specified as default. + :type file_attributes: str + :param file_creation_time: Creation time for the file/directory. + Default value: Now. + :type file_creation_time: str + :param file_last_write_time: Last write time for the file/directory. + Default value: Now. + :type file_last_write_time: str :param timeout: The timeout parameter is expressed in seconds. For more information, see Setting @@ -394,6 +462,17 @@ def set_http_headers(self, timeout=None, file_content_length=None, file_http_hea the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared. :type file_content_length: long + :param file_permission: If specified the permission (security + descriptor) shall be set for the directory/file. This header can be + used if Permission size is <= 8KB, else x-ms-file-permission-key + header shall be used. Default value: Inherit. If SDDL is specified as + input, it must have owner, group and dacl. Note: Only one of the + x-ms-file-permission or x-ms-file-permission-key should be specified. + :type file_permission: str + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: str :param file_http_headers: Additional parameters for the operation :type file_http_headers: ~azure.storage.file.models.FileHTTPHeaders :param callable cls: A custom type or function that will be passed the @@ -443,6 +522,13 @@ def set_http_headers(self, timeout=None, file_content_length=None, file_http_hea header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') if file_content_length is not None: header_parameters['x-ms-content-length'] = self._serialize.header("file_content_length", file_content_length, 'long') + if file_permission is not None: + header_parameters['x-ms-file-permission'] = self._serialize.header("file_permission", file_permission, 'str') + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-file-attributes'] = self._serialize.header("file_attributes", file_attributes, 'str') + header_parameters['x-ms-file-creation-time'] = self._serialize.header("file_creation_time", file_creation_time, 'str') + header_parameters['x-ms-file-last-write-time'] = self._serialize.header("file_last_write_time", file_last_write_time, 'str') if file_content_type is not None: header_parameters['x-ms-content-type'] = self._serialize.header("file_content_type", file_content_type, 'str') if file_content_encoding is not None: @@ -473,6 +559,13 @@ def set_http_headers(self, timeout=None, file_content_length=None, file_http_hea '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-file-attributes': self._deserialize('str', response.headers.get('x-ms-file-attributes')), + 'x-ms-file-creation-time': self._deserialize('str', response.headers.get('x-ms-file-creation-time')), + 'x-ms-file-last-write-time': self._deserialize('str', response.headers.get('x-ms-file-last-write-time')), + 'x-ms-file-change-time': self._deserialize('str', response.headers.get('x-ms-file-change-time')), + 'x-ms-file-id': self._deserialize('str', response.headers.get('x-ms-file-id')), + 'x-ms-file-parent-id': self._deserialize('str', response.headers.get('x-ms-file-parent-id')), 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), } return cls(response, None, response_headers) @@ -605,7 +698,7 @@ def upload_range(self, range, content_length, file_range_write="update", optiona header_parameters = {} header_parameters['Content-Type'] = 'application/octet-stream' header_parameters['x-ms-range'] = self._serialize.header("range", range, 'str') - header_parameters['x-ms-write'] = self._serialize.header("file_range_write", file_range_write, 'FileRangeWriteType') + header_parameters['x-ms-write'] = self._serialize.header("self.x_ms_write", self.x_ms_write, 'FileRangeWriteType') header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') if content_md5 is not None: header_parameters['Content-MD5'] = self._serialize.header("content_md5", content_md5, 'bytearray') @@ -636,6 +729,109 @@ def upload_range(self, range, content_length, file_range_write="update", optiona return cls(response, None, response_headers) upload_range.metadata = {'url': '/{shareName}/{directory}/{fileName}'} + def upload_range_from_url(self, range, copy_source, content_length, timeout=None, source_range=None, source_content_crc64=None, source_modified_access_conditions=None, cls=None, **kwargs): + """Upload a range of bytes to a file where the contents are read from a + URL. + + :param range: Writes data to the specified byte range in the file. + :type range: str + :param copy_source: Specifies the URL of the source file or blob, up + to 2 KB in length. To copy a file to another file within the same + storage account, you may use Shared Key to authenticate the source + file. If you are copying a file from another storage account, or if + you are copying a blob from the same storage account or another + storage account, then you must authenticate the source file or blob + using a shared access signature. If the source is a public blob, no + authentication is required to perform the copy operation. A file in a + share snapshot can also be specified as a copy source. + :type copy_source: str + :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. + :type content_length: long + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for File Service Operations. + :type timeout: int + :param source_range: Bytes of source data in the specified range. + :type source_range: str + :param source_content_crc64: Specify the crc64 calculated for the + range of bytes that must be read from the copy source. + :type source_content_crc64: bytearray + :param source_modified_access_conditions: Additional parameters for + the operation + :type source_modified_access_conditions: + ~azure.storage.file.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) + source_if_match_crc64 = None + if source_modified_access_conditions is not None: + source_if_match_crc64 = source_modified_access_conditions.source_if_match_crc64 + source_if_none_match_crc64 = None + if source_modified_access_conditions is not None: + source_if_none_match_crc64 = source_modified_access_conditions.source_if_none_match_crc64 + + comp = "range" + + # Construct URL + url = self.upload_range_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-range'] = self._serialize.header("range", range, 'str') + header_parameters['x-ms-copy-source'] = self._serialize.header("copy_source", copy_source, 'str') + if source_range is not None: + header_parameters['x-ms-source-range'] = self._serialize.header("source_range", source_range, 'str') + header_parameters['x-ms-write'] = self._serialize.header("self.x_ms_write", self.x_ms_write, 'str') + header_parameters['Content-Length'] = self._serialize.header("content_length", content_length, 'long') + if source_content_crc64 is not None: + header_parameters['x-ms-source-content-crc64'] = self._serialize.header("source_content_crc64", source_content_crc64, 'bytearray') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, 'str') + if source_if_match_crc64 is not None: + header_parameters['x-ms-source-if-match-crc64'] = self._serialize.header("source_if_match_crc64", source_if_match_crc64, 'bytearray') + if source_if_none_match_crc64 is not None: + header_parameters['x-ms-source-if-none-match-crc64'] = self._serialize.header("source_if_none_match_crc64", source_if_none_match_crc64, 'bytearray') + + # 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')), + '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-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_range_from_url.metadata = {'url': '/{shareName}/{directory}/{fileName}'} + def get_range_list(self, sharesnapshot=None, timeout=None, range=None, cls=None, **kwargs): """Returns the list of valid ranges for a file. 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 6693d31cf218..f761012c7147 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 @@ -293,6 +293,123 @@ def create_snapshot(self, timeout=None, metadata=None, cls=None, **kwargs): return cls(response, None, response_headers) create_snapshot.metadata = {'url': '/{shareName}'} + def create_permission(self, timeout=None, cls=None, **kwargs): + """Create a permission (a security descriptor). + + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for File Service Operations. + :type timeout: int + :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 = "filepermission" + + # Construct URL + url = self.create_permission.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("self.restype", self.restype, 'str') + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, '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 = { + '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-file-permission-key': self._deserialize('str', response.headers.get('x-ms-file-permission-key')), + 'x-ms-error-code': self._deserialize('str', response.headers.get('x-ms-error-code')), + } + return cls(response, None, response_headers) + create_permission.metadata = {'url': '/{shareName}'} + + def get_permission(self, file_permission_key=None, timeout=None, cls=None, **kwargs): + """Returns the permission (security descriptor) for a given key. + + :param file_permission_key: Key of the permission to be set for the + directory/file. Note: Only one of the x-ms-file-permission or + x-ms-file-permission-key should be specified. + :type file_permission_key: str + :param timeout: The timeout parameter is expressed in seconds. For + more information, see Setting + Timeouts for File Service Operations. + :type timeout: int + :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 = "filepermission" + + # Construct URL + url = self.get_permission.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("self.restype", self.restype, 'str') + query_parameters['comp'] = self._serialize.query("comp", comp, 'str') + + # Construct headers + header_parameters = {} + if file_permission_key is not None: + header_parameters['x-ms-file-permission-key'] = self._serialize.header("file_permission_key", file_permission_key, 'str') + header_parameters['x-ms-version'] = self._serialize.header("self._config.version", self._config.version, '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) + + if cls: + response_headers = { + '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) + get_permission.metadata = {'url': '/{shareName}'} + def set_quota(self, timeout=None, quota=None, cls=None, **kwargs): """Sets quota for the specified share. 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 3d08b008d2d6..9c89a27c160c 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 @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2018-11-09" +VERSION = "2019-02-02" diff --git a/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py b/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py index 0795ad55fe6b..a9f1e262a079 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/aio/file_client_async.py @@ -469,6 +469,8 @@ async def set_http_headers(self, content_settings, timeout=None, **kwargs): # t file_content_length=file_content_length, file_http_headers=file_http_headers, cls=return_response_headers, + file_creation_time="preserve", # TODO: Verify these default values are correct + file_last_write_time="preserve", # TODO: Verify these default values are correct **kwargs ) except StorageErrorException as error: @@ -663,7 +665,12 @@ async def resize_file(self, size, timeout=None, **kwargs): # type: ignore """ try: return await self._client.file.set_http_headers( # type: ignore - timeout=timeout, file_content_length=size, cls=return_response_headers, **kwargs + timeout=timeout, + file_content_length=size, + cls=return_response_headers, + file_creation_time="preserve", # TODO: Verify these default values are correct + file_last_write_time="preserve", # TODO: Verify these default values are correct + **kwargs ) except StorageErrorException as error: process_storage_error(error) diff --git a/sdk/storage/azure-storage-file/azure/storage/file/file_client.py b/sdk/storage/azure-storage-file/azure/storage/file/file_client.py index 9ff3cf9b22e1..7909ee597d00 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/file_client.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/file_client.py @@ -657,6 +657,8 @@ def set_http_headers(self, content_settings, timeout=None, **kwargs): # type: ig file_content_length=file_content_length, file_http_headers=file_http_headers, cls=return_response_headers, + file_creation_time="preserve", # TODO: Verify these default values are correct + file_last_write_time="preserve", # TODO: Verify these default values are correct **kwargs) except StorageErrorException as error: process_storage_error(error) @@ -853,6 +855,8 @@ def resize_file(self, size, timeout=None, **kwargs): # type: ignore timeout=timeout, file_content_length=size, cls=return_response_headers, + file_creation_time="preserve", # TODO: Verify these default values are correct + file_last_write_time="preserve", # TODO: Verify these default values are correct **kwargs) except StorageErrorException as error: process_storage_error(error) diff --git a/sdk/storage/azure-storage-file/swagger/README.md b/sdk/storage/azure-storage-file/swagger/README.md index 799b8dc6ae8f..4ef2c814084b 100644 --- a/sdk/storage/azure-storage-file/swagger/README.md +++ b/sdk/storage/azure-storage-file/swagger/README.md @@ -19,7 +19,7 @@ autorest --use=C:/work/autorest.python --version=2.0.4280 ### Settings ``` yaml -input-file: ./file-2018-11-09.json +input-file: ./file-2019-02-02.json output-folder: ../azure/storage/file/_generated namespace: azure.storage.file no-namespace-folders: true @@ -48,4 +48,51 @@ directive: transform: > $.Start.format = "str"; $.Expiry.format = "str"; -``` \ No newline at end of file +- from: swagger-document + where: $["x-ms-paths"]..responses..headers["x-ms-file-last-write-time"] + transform: > + $.format = "str"; +- from: swagger-document + where: $["x-ms-paths"]..responses..headers["x-ms-file-change-time"] + transform: > + $.format = "str"; +- from: swagger-document + where: $["x-ms-paths"]..responses..headers["x-ms-file-creation-time"] + transform: > + $.format = "str"; +``` + +### Change new SMB file parameters to use default values +TODO: Verify these default values are correct +``` yaml +directive: +- from: swagger-document + where: $.parameters.FileCreationTime + transform: > + $.format = "str"; + $.default = "now"; +- from: swagger-document + where: $.parameters.FileLastWriteTime + transform: > + $.format = "str"; + $.default = "now"; +- from: swagger-document + where: $.parameters.FileAttributes + transform: > + $.default = "none"; +- from: swagger-document + where: $.parameters.FilePermission + transform: > + $.default = "inherit"; +``` + +### FileRangeWriteFromUrl Constant +``` yaml +directive: +- from: swagger-document + where: $.parameters.FileRangeWriteFromUrl + transform: > + delete $.default; + delete $["x-ms-enum"]; + $["x-ms-parameter-location"] = "method"; +``` diff --git a/sdk/storage/azure-storage-file/swagger/file-2019-02-02.json b/sdk/storage/azure-storage-file/swagger/file-2019-02-02.json new file mode 100644 index 000000000000..571617fff6d0 --- /dev/null +++ b/sdk/storage/azure-storage-file/swagger/file-2019-02-02.json @@ -0,0 +1,4359 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure File 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": { + "File_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 File service endpoint, including properties for Storage Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.", + "parameters": [{ + "$ref": "#/parameters/StorageServiceProperties" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "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 File service used to execute the request." + } + } + }, + "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 File service, including properties for Storage Analytics metrics and CORS (Cross-Origin Resource Sharing) rules.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "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 File service used to execute the request." + } + }, + "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" + ] + } + ] + }, + "/?comp=list": { + "get": { + "tags": [ + "service" + ], + "operationId": "Service_ListSharesSegment", + "description": "The List Shares Segment operation returns a list of the shares and share snapshots under the specified account.", + "parameters": [{ + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/ListSharesInclude" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "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 File service used to execute the request." + } + }, + "schema": { + "$ref": "#/definitions/ListSharesResponse" + } + }, + "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" + ] + }] + }, + "/{shareName}?restype=share": { + "put": { + "tags": [ + "share" + ], + "operationId": "Share_Create", + "description": "Creates a new share under the specified account. If the share with the same name already exists, the operation fails.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ShareQuota" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Success, Share created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the share, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. Any operation that modifies the share or its properties or metadata updates the last modified time. Operations on files do not affect the last modified time of the share." + }, + "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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "share" + ], + "operationId": "Share_GetProperties", + "description": "Returns all user-defined metadata and system properties for the specified share or share snapshot. The data returned does not include the share's list of files.", + "parameters": [{ + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "x-ms-meta": { + "type": "string", + "description": "A set of name-value pairs that contain the user-defined metadata of the share.", + "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, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. Any operation that modifies the share or its properties updates the last modified time. Operations on files do not affect the last modified time of the share." + }, + "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 File service used to execute 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." + }, + "x-ms-share-quota": { + "x-ms-client-name": "Quota", + "type": "integer", + "description": "Returns the current share quota in GB." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "share" + ], + "operationId": "Share_Delete", + "description": "Operation marks the specified share or share snapshot for deletion. The share or share snapshot and any files contained within it are later deleted during garbage collection.", + "parameters": [{ + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/DeleteSnapshots" + } + ], + "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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [{ + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "share" + ] + }] + }, + "/{shareName}?restype=share&comp=snapshot": { + "put": { + "tags": [ + "share" + ], + "operationId": "Share_CreateSnapshot", + "description": "Creates a read-only snapshot of a share.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Success, Share snapshot created.", + "headers": { + "x-ms-snapshot": { + "x-ms-client-name": "Snapshot", + "type": "string", + "description": "This header is a DateTime value that uniquely identifies the share snapshot. The value of this header may be used in subsequent requests to access the share snapshot. This value is opaque." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the share snapshot, in quotes. A share snapshot cannot be modified, so the ETag of a given share snapshot never changes. However, if new metadata was supplied with the Snapshot Share request then the ETag of the share snapshot differs from that of the base share. If no metadata was specified with the request, the ETag of the share snapshot is identical to that of the base share at the time the share snapshot was taken." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. A share snapshot cannot be modified, so the last modified time of a given share snapshot never changes. However, if new metadata was supplied with the Snapshot Share request then the last modified time of the share snapshot differs from that of the base share. If no metadata was specified with the request, the last modified time of the share snapshot is identical to that of the base share at the time the share snapshot was taken." + }, + "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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [{ + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "share" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "snapshot" + ] + } + ] + }, + "/{shareName}?restype=share&comp=filepermission": { + "put": { + "tags": [ + "share" + ], + "operationId": "Share_CreatePermission", + "description": "Create a permission (a security descriptor).", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Success, Share level permission created.", + "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 File service used to execute 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." + }, + "x-ms-file-permission-key": { + "x-ms-client-name": "FilePermissonKey", + "type": "string", + "description": "Key of the permission set for the directory/file." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "share" + ], + "operationId": "Share_GetPermission", + "description": "Returns the permission (security descriptor) for a given key", + "parameters": [{ + "$ref": "#/parameters/FilePermissionKey" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [{ + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "share" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "filepermission" + ] + } + ] + }, + "/{shareName}?restype=share&comp=properties": { + "put": { + "tags": [ + "share" + ], + "operationId": "Share_SetQuota", + "description": "Sets quota for the specified share.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/ShareQuota" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. Any operation that modifies the share or its properties updates the last modified time. Operations on files do not affect the last modified time of the share." + }, + "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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [{ + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "share" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] + }, + "/{shareName}?restype=share&comp=metadata": { + "put": { + "tags": [ + "share" + ], + "operationId": "Share_SetMetadata", + "description": "Sets one or more user-defined name-value pairs for the specified share.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. Any operation that modifies the share or its properties updates the last modified time. Operations on files do not affect the last modified time of the share." + }, + "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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [{ + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "share" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{shareName}?restype=share&comp=acl": { + "get": { + "tags": [ + "share" + ], + "operationId": "Share_GetAccessPolicy", + "description": "Returns information about stored access policies specified on the share.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. Any operation that modifies the share or its properties updates the last modified time. Operations on files do not affect the last modified time of the share." + }, + "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 File service used to execute 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." + } + }, + "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": [ + "share" + ], + "operationId": "Share_SetAccessPolicy", + "description": "Sets a stored access policy for use with shared access signatures.", + "parameters": [{ + "$ref": "#/parameters/ShareAcl" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. Any operation that modifies the share or its properties updates the last modified time. Operations on files do not affect the last modified time of the share." + }, + "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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [{ + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "share" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "acl" + ] + } + ] + }, + "/{shareName}?restype=share&comp=stats": { + "get": { + "tags": [ + "share" + ], + "operationId": "Share_GetStatistics", + "description": "Retrieves statistics related to the share.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value that you can use to perform operations conditionally, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. Any operation that modifies the share or its properties updates the last modified time. Operations on files do not affect the last modified time of the share." + }, + "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 File service used to execute 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." + } + }, + "schema": { + "$ref": "#/definitions/ShareStats" + } + }, + "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": [ + "share" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "stats" + ] + } + ] + }, + "/{shareName}/{directory}?restype=directory": { + "put": { + "tags": [ + "directory" + ], + "operationId": "Directory_Create", + "description": "Creates a new directory under the specified share or parent directory.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/FilePermission" + }, + { + "$ref": "#/parameters/FilePermissionKey" + }, + { + "$ref": "#/parameters/FileAttributes" + }, + { + "$ref": "#/parameters/FileCreationTime" + }, + { + "$ref": "#/parameters/FileLastWriteTime" + } + ], + "responses": { + "201": { + "description": "Success, Directory created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the directory, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory." + }, + "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 File service used to execute 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." + }, + "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-file-permission-key": { + "x-ms-client-name": "FilePermissonKey", + "type": "string", + "description": "Key of the permission set for the directory." + }, + "x-ms-file-attributes": { + "x-ms-client-name": "FileAttributes", + "type": "string", + "description": "Attributes set for the directory." + }, + "x-ms-file-creation-time": { + "x-ms-client-name": "FileCreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Creation time for the directory." + }, + "x-ms-file-last-write-time": { + "x-ms-client-name": "FileLastWriteTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Last write time for the directory." + }, + "x-ms-file-change-time": { + "x-ms-client-name": "FileChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Change time for the directory." + }, + "x-ms-file-id": { + "x-ms-client-name": "FileId", + "type": "string", + "description": "The fileId of the directory." + }, + "x-ms-file-parent-id": { + "x-ms-client-name": "FileParentId", + "type": "string", + "description": "The parent fileId of the directory." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "directory" + ], + "operationId": "Directory_GetProperties", + "description": "Returns all system properties for the specified directory, and can also be used to check the existence of a directory. The data returned does not include the files in the directory or any subdirectories.", + "parameters": [{ + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "x-ms-meta": { + "type": "string", + "description": "A set of name-value pairs that contain metadata for the directory.", + "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, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the Directory was last modified. Operations on files within the directory do not affect the last modified time of the directory." + }, + "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 File service used to execute 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." + }, + "x-ms-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the directory metadata is completely encrypted using the specified algorithm. Otherwise, the value is set to false." + }, + "x-ms-file-attributes": { + "x-ms-client-name": "FileAttributes", + "type": "string", + "description": "Attributes set for the directory." + }, + "x-ms-file-creation-time": { + "x-ms-client-name": "FileCreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Creation time for the directory." + }, + "x-ms-file-last-write-time": { + "x-ms-client-name": "FileLastWriteTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Last write time for the directory." + }, + "x-ms-file-change-time": { + "x-ms-client-name": "FileChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Change time for the directory." + }, + "x-ms-file-permission-key": { + "x-ms-client-name": "FilePermissionKey", + "type": "string", + "description": "Key of the permission set for the directory." + }, + "x-ms-file-id": { + "x-ms-client-name": "FileId", + "type": "string", + "description": "The fileId of the directory." + }, + "x-ms-file-parent-id": { + "x-ms-client-name": "FileParentId", + "type": "string", + "description": "The parent fileId of the directory." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "directory" + ], + "operationId": "Directory_Delete", + "description": "Removes the specified empty directory. Note that the directory must be empty before it can be deleted.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [{ + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "directory" + ] + }] + }, + "/{shareName}/{directory}?restype=directory&comp=properties": { + "put": { + "tags": [ + "directory" + ], + "operationId": "Directory_SetProperties", + "description": "Sets properties on the directory.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/FilePermission" + }, + { + "$ref": "#/parameters/FilePermissionKey" + }, + { + "$ref": "#/parameters/FileAttributes" + }, + { + "$ref": "#/parameters/FileCreationTime" + }, + { + "$ref": "#/parameters/FileLastWriteTime" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the file, in quotes." + }, + "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." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the directory was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory." + }, + "x-ms-version": { + "x-ms-client-name": "Version", + "type": "string", + "description": "Indicates the version of the File service used to execute 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." + }, + "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-file-permission-key": { + "x-ms-client-name": "FilePermissionKey", + "type": "string", + "description": "Key of the permission set for the directory." + }, + "x-ms-file-attributes": { + "x-ms-client-name": "FileAttributes", + "type": "string", + "description": "Attributes set for the directory." + }, + "x-ms-file-creation-time": { + "x-ms-client-name": "FileCreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Creation time for the directory." + }, + "x-ms-file-last-write-time": { + "x-ms-client-name": "FileLastWriteTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Last write time for the directory." + }, + "x-ms-file-change-time": { + "x-ms-client-name": "FileChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Change time for the directory." + }, + "x-ms-file-id": { + "x-ms-client-name": "FileId", + "type": "string", + "description": "The fileId of the directory." + }, + "x-ms-file-parent-id": { + "x-ms-client-name": "FileParentId", + "type": "string", + "description": "The parent fileId of the directory." + } + } + }, + "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" + ] + }] + }, + "/{shareName}/{directory}?restype=directory&comp=metadata": { + "put": { + "tags": [ + "directory" + ], + "operationId": "Directory_SetMetadata", + "description": "Updates user defined metadata for the specified directory.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK).", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the directory, in quotes." + }, + "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 File service used to execute 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." + }, + "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": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "directory" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "metadata" + ] + } + ] + }, + "/{shareName}/{directory}?restype=directory&comp=list": { + "get": { + "tags": [ + "directory" + ], + "operationId": "Directory_ListFilesAndDirectoriesSegment", + "description": "Returns a list of files or directories under the specified share or directory. It lists the contents only for a single level of the directory hierarchy.", + "parameters": [ + { + "$ref": "#/parameters/Prefix" + }, + { + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "Specifies the format in which the results are returned. Currently this value 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 File service used to execute 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." + } + }, + "schema": { + "$ref": "#/definitions/ListFilesAndDirectoriesSegmentResponse" + } + }, + "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": [ + "directory" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "list" + ] + } + ] + }, + "/{shareName}/{directory}?comp=listhandles": { + "get":{ + "tags": [ + "directory" + ], + "operationId": "Directory_ListHandles", + "description": "Lists handles for directory.", + "parameters":[ + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/Recursive" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "Specifies the format in which the results are returned. Currently this value 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 File service used to execute 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." + } + }, + "schema": { + "$ref": "#/definitions/ListHandlesResponse" + } + }, + "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": [ + "listhandles" + ] + } + ] + }, + "/{shareName}/{directory}?comp=forceclosehandles": { + "put": { + "tags": [ + "directory" + ], + "operationId": "Directory_ForceCloseHandles", + "description": "Closes all handles open for given directory.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/HandleId" + }, + { + "$ref": "#/parameters/Recursive" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "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 File service used to execute 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." + }, + "x-ms-marker": { + "x-ms-client-name": "marker", + "type": "string", + "description": "A string describing next handle to be closed. It is returned when more handles need to be closed to complete the request." + }, + "x-ms-number-of-handles-closed": { + "x-ms-client-name": "numberOfHandlesClosed", + "type": "integer", + "description": "Contains count of number of handles closed." + } + } + }, + "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": [ + "forceclosehandles" + ] + } + ] + }, + "/{shareName}/{directory}/{fileName}": { + "put": { + "tags": [ + "file" + ], + "operationId": "File_Create", + "description": "Creates a new file or replaces a file. Note it only initializes the file with no content.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "x-ms-content-length", + "x-ms-client-name": "fileContentLength", + "in": "header", + "description": "Specifies the maximum size for the file, up to 1 TB.", + "required": true, + "type": "integer", + "format": "int64" + }, + { + "$ref": "#/parameters/FileType" + }, + { + "$ref": "#/parameters/FileContentType" + }, + { + "$ref": "#/parameters/FileContentEncoding" + }, + { + "$ref": "#/parameters/FileContentLanguage" + }, + { + "$ref": "#/parameters/FileCacheControl" + }, + { + "$ref": "#/parameters/FileContentMD5" + }, + { + "$ref": "#/parameters/FileContentDisposition" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/FilePermission" + }, + { + "$ref": "#/parameters/FilePermissionKey" + }, + { + "$ref": "#/parameters/FileAttributes" + }, + { + "$ref": "#/parameters/FileCreationTime" + }, + { + "$ref": "#/parameters/FileLastWriteTime" + } + ], + "responses": { + "201": { + "description": "Success, File created.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the file, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the share was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory." + }, + "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 File service used to execute 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." + }, + "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-file-permission-key": { + "x-ms-client-name": "FilePermissionKey", + "type": "string", + "description": "Key of the permission set for the file." + }, + "x-ms-file-attributes": { + "x-ms-client-name": "FileAttributes", + "type": "string", + "description": "Attributes set for the file." + }, + "x-ms-file-creation-time": { + "x-ms-client-name": "FileCreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Creation time for the file." + }, + "x-ms-file-last-write-time": { + "x-ms-client-name": "FileLastWriteTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Last write time for the file." + }, + "x-ms-file-change-time": { + "x-ms-client-name": "FileChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Change time for the file." + }, + "x-ms-file-id": { + "x-ms-client-name": "FileId", + "type": "string", + "description": "The fileId of the file." + }, + "x-ms-file-parent-id": { + "x-ms-client-name": "FileParentId", + "type": "string", + "description": "The parent fileId of the file." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "get": { + "tags": [ + "file" + ], + "operationId": "File_Download", + "description": "Reads or downloads a file from the system, including its metadata and properties.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/Range" + }, + { + "$ref": "#/parameters/GetRangeContentMD5" + } + ], + "responses": { + "200": { + "description": "Succeeded to read the entire file.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the file was last modified. Any operation that modifies the file or its properties updates the last modified time." + }, + "x-ms-meta": { + "type": "string", + "description": "A set of name-value pairs associated with this file as user-defined metadata.", + "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 content type specified for the file. The default content type is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned if the client requested a subset of the file 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, in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the file has an MD5 hash and the request is to read the full file, this response header is returned so that the client can check for message content integrity. If the request is to read a specified range and the 'x-ms-range-get-content-md5' is set to true, then the request returns an MD5 hash for the range, as long as the range size is less than or equal to 4 MB. If neither of these sets of conditions is true, then no value is returned for the 'Content-MD5' header." + }, + "Content-Encoding": { + "type": "string", + "description": "Returns the value that was specified for the Content-Encoding request header." + }, + "Cache-Control": { + "type": "string", + "description": "Returned if it was previously specified for the file." + }, + "Content-Disposition": { + "type": "string", + "description": "Returns the value that was specified for the 'x-ms-content-disposition' header and specifies how to process the response." + }, + "Content-Language": { + "type": "string", + "description": "Returns the value that was specified for the Content-Language request header." + }, + "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 File service used to execute the request." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial file content." + }, + "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." + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy File operation where this file was the destination file. This value can specify the time of a completed, aborted, or failed copy attempt." + }, + "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 cause of fatal or non-fatal copy operation failure." + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for the last attempted Copy File operation where this file was the destination file." + }, + "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 File operation where this file was the destination file. Can show between 0 and Content-Length bytes copied." + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2KB in length that specifies the source file used in the last attempted Copy File operation where this file was the destination file." + }, + "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-content-md5": { + "x-ms-client-name": "FileContentMD5", + "type": "string", + "format": "byte", + "description": "If the file 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 file'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-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the file data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the file is unencrypted, or if only parts of the file/application metadata are encrypted)." + }, + "x-ms-file-attributes": { + "x-ms-client-name": "FileAttributes", + "type": "string", + "description": "Attributes set for the file." + }, + "x-ms-file-creation-time": { + "x-ms-client-name": "FileCreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Creation time for the file." + }, + "x-ms-file-last-write-time": { + "x-ms-client-name": "FileLastWriteTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Last write time for the file." + }, + "x-ms-file-change-time": { + "x-ms-client-name": "FileChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Change time for the file." + }, + "x-ms-file-permission-key": { + "x-ms-client-name": "FilePermissionKey", + "type": "string", + "description": "Key of the permission set for the file." + }, + "x-ms-file-id": { + "x-ms-client-name": "FileId", + "type": "string", + "description": "The fileId of the file." + }, + "x-ms-file-parent-id": { + "x-ms-client-name": "FileParentId", + "type": "string", + "description": "The parent fileId of the file." + } + }, + "schema": { + "type": "object", + "format": "file" + } + }, + "206": { + "description": "Succeeded to read a specified range of the file.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the file was last modified. Any operation that modifies the file or its properties updates the last modified time." + }, + "x-ms-meta": { + "type": "string", + "description": "A set of name-value pairs associated with this file as user-defined metadata.", + "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 content type specified for the file. The default content type is 'application/octet-stream'" + }, + "Content-Range": { + "type": "string", + "description": "Indicates the range of bytes returned if the client requested a subset of the file 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, in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the file has an MD5 hash and the request is to read the full file, this response header is returned so that the client can check for message content integrity. If the request is to read a specified range and the 'x-ms-range-get-content-md5' is set to true, then the request returns an MD5 hash for the range, as long as the range size is less than or equal to 4 MB. If neither of these sets of conditions is true, then no value is returned for the 'Content-MD5' header." + }, + "Content-Encoding": { + "type": "string", + "description": "Returns the value that was specified for the Content-Encoding request header." + }, + "Cache-Control": { + "type": "string", + "description": "Returned if it was previously specified for the file." + }, + "Content-Disposition": { + "type": "string", + "description": "Returns the value that was specified for the 'x-ms-content-disposition' header and specifies how to process the response." + }, + "Content-Language": { + "type": "string", + "description": "Returns the value that was specified for the Content-Language request header." + }, + "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 File service used to execute the request." + }, + "Accept-Ranges": { + "type": "string", + "description": "Indicates that the service supports requests for partial file content." + }, + "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." + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy File operation where this file was the destination file. This value can specify the time of a completed, aborted, or failed copy attempt." + }, + "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 cause of fatal or non-fatal copy operation failure." + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for the last attempted Copy File operation where this file was the destination file." + }, + "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 File operation where this file was the destination file. Can show between 0 and Content-Length bytes copied." + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2KB in length that specifies the source file used in the last attempted Copy File operation where this file was the destination file." + }, + "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-content-md5": { + "x-ms-client-name": "FileContentMD5", + "type": "string", + "format": "byte", + "description": "If the file 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 file'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-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the file data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the file is unencrypted, or if only parts of the file/application metadata are encrypted)." + } + }, + "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": [ + "file" + ], + "operationId": "File_GetProperties", + "description": "Returns all user-defined metadata, standard HTTP properties, and system properties for the file. It does not return the content of the file.", + "parameters": [{ + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the file was last modified. The date format follows RFC 1123. Any operation that modifies the file or its properties updates the last modified time." + }, + "x-ms-meta": { + "type": "string", + "description": "A set of name-value pairs associated with this file as user-defined metadata.", + "x-ms-client-name": "Metadata", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "x-ms-type": { + "x-ms-client-name": "FileType", + "description": "Returns the type File. Reserved for future use.", + "type": "string", + "enum": [ + "File" + ] + }, + "Content-Length": { + "type": "integer", + "format": "int64", + "description": "The size of the file in bytes. This header returns the value of the 'x-ms-content-length' header that is stored with the file." + }, + "Content-Type": { + "type": "string", + "description": "The content type specified for the file. 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, in quotes." + }, + "Content-MD5": { + "type": "string", + "format": "byte", + "description": "If the Content-MD5 header has been set for the file, the Content-MD5 response header is returned so that the client can check for message content integrity." + }, + "Content-Encoding": { + "type": "string", + "description": "If the Content-Encoding request header has previously been set for the file, the Content-Encoding value is returned in this header." + }, + "Cache-Control": { + "type": "string", + "description": "If the Cache-Control request header has previously been set for the file, the Cache-Control value is returned in this header." + }, + "Content-Disposition": { + "type": "string", + "description": "Returns the value that was specified for the 'x-ms-content-disposition' header and specifies how to process the response." + }, + "Content-Language": { + "type": "string", + "description": "Returns the value that was specified for the Content-Language request header." + }, + "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 File service used to execute 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." + }, + "x-ms-copy-completion-time": { + "x-ms-client-name": "CopyCompletionTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Conclusion time of the last attempted Copy File operation where this file was the destination file. This value can specify the time of a completed, aborted, or failed copy attempt." + }, + "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 cause of fatal or non-fatal copy operation failure." + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for the last attempted Copy File operation where this file was the destination file." + }, + "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 File operation where this file was the destination file. Can show between 0 and Content-Length bytes copied." + }, + "x-ms-copy-source": { + "x-ms-client-name": "CopySource", + "type": "string", + "description": "URL up to 2KB in length that specifies the source file used in the last attempted Copy File operation where this file was the destination file." + }, + "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-server-encrypted": { + "x-ms-client-name": "IsServerEncrypted", + "type": "boolean", + "description": "The value of this header is set to true if the file data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the file is unencrypted, or if only parts of the file/application metadata are encrypted)." + }, + "x-ms-file-attributes": { + "x-ms-client-name": "FileAttributes", + "type": "string", + "description": "Attributes set for the file." + }, + "x-ms-file-creation-time": { + "x-ms-client-name": "FileCreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Creation time for the file." + }, + "x-ms-file-last-write-time": { + "x-ms-client-name": "FileLastWriteTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Last write time for the file." + }, + "x-ms-file-change-time": { + "x-ms-client-name": "FileChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Change time for the file." + }, + "x-ms-file-permission-key": { + "x-ms-client-name": "FilePermissionKey", + "type": "string", + "description": "Key of the permission set for the file." + }, + "x-ms-file-id": { + "x-ms-client-name": "FileId", + "type": "string", + "description": "The fileId of the file." + }, + "x-ms-file-parent-id": { + "x-ms-client-name": "FileParentId", + "type": "string", + "description": "The parent fileId of the file." + } + } + }, + "default": { + "description": "Failure", + "headers": { + "x-ms-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "delete": { + "tags": [ + "file" + ], + "operationId": "File_Delete", + "description": "removes the file from the storage account.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [ + + ] + }, + "/{shareName}/{directory}/{fileName}?comp=properties": { + "put": { + "tags": [ + "file" + ], + "operationId": "File_SetHTTPHeaders", + "description": "Sets HTTP headers on the file.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "x-ms-content-length", + "x-ms-client-name": "fileContentLength", + "in": "header", + "description": "Resizes a file to the specified size. If the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared.", + "required": false, + "type": "integer", + "format": "int64" + }, + { + "$ref": "#/parameters/FileContentType" + }, + { + "$ref": "#/parameters/FileContentEncoding" + }, + { + "$ref": "#/parameters/FileContentLanguage" + }, + { + "$ref": "#/parameters/FileCacheControl" + }, + { + "$ref": "#/parameters/FileContentMD5" + }, + { + "$ref": "#/parameters/FileContentDisposition" + }, + { + "$ref": "#/parameters/FilePermission" + }, + { + "$ref": "#/parameters/FilePermissionKey" + }, + { + "$ref": "#/parameters/FileAttributes" + }, + { + "$ref": "#/parameters/FileCreationTime" + }, + { + "$ref": "#/parameters/FileLastWriteTime" + } + ], + "responses": { + "200": { + "description": "Success", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the file, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the directory was last modified. Any operation that modifies the directory or its properties updates the last modified time. Operations on files do not affect the last modified time of the directory." + }, + "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 File service used to execute 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." + }, + "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-file-permission-key": { + "x-ms-client-name": "FilePermissionKey", + "type": "string", + "description": "Key of the permission set for the file." + }, + "x-ms-file-attributes": { + "x-ms-client-name": "FileAttributes", + "type": "string", + "description": "Attributes set for the file." + }, + "x-ms-file-creation-time": { + "x-ms-client-name": "FileCreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Creation time for the file." + }, + "x-ms-file-last-write-time": { + "x-ms-client-name": "FileLastWriteTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Last write time for the file." + }, + "x-ms-file-change-time": { + "x-ms-client-name": "FileChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Change time for the file." + }, + "x-ms-file-id": { + "x-ms-client-name": "FileId", + "type": "string", + "description": "The fileId of the directory." + }, + "x-ms-file-parent-id": { + "x-ms-client-name": "FileParentId", + "type": "string", + "description": "The parent fileId of the directory." + } + } + }, + "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" + ] + }] + }, + "/{shareName}/{directory}/{fileName}?comp=metadata": { + "put": { + "tags": [ + "file" + ], + "operationId": "File_SetMetadata", + "description": "Updates user-defined metadata for the specified file.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success (OK).", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the file, in quotes." + }, + "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 File service used to execute 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." + }, + "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" + ] + }] + }, + "/{shareName}/{directory}/{fileName}?comp=range": { + "put": { + "tags": [ + "file" + ], + "operationId": "File_UploadRange", + "description": "Upload a range of bytes to a file.", + "consumes": [ + "application/octet-stream" + ], + "parameters": [{ + "$ref": "#/parameters/OptionalBody" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "description": "Specifies the range of bytes to be written. Both the start and end of the range must be specified. For an update operation, the range can be up to 4 MB in size. For a clear operation, the range can be up to the value of the file's full size. The File service accepts only a single byte range for the Range and 'x-ms-range' headers, and the byte range must be specified in the following format: bytes=startByte-endByte.", + "required": true, + "type": "string" + }, + { + "name": "x-ms-write", + "x-ms-client-name": "FileRangeWrite", + "in": "header", + "description": "Specify one of the following options: - 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. - 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 set the Range header to a value that indicates the range to clear, up to maximum file size.", + "required": true, + "type": "string", + "enum": [ + "update", + "clear" + ], + "default": "update", + "x-ms-enum": { + "name": "FileRangeWriteType", + "modelAsString": false + } + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/ContentMD5" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Success (Created).", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the file, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the directory was last modified. Any operation that modifies the share or its properties or metadata updates the last modified time. Operations on files do not affect the last modified time of the share." + }, + "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 File service; it is not necessarily the same value as may have been 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 File service used to execute 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." + }, + "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": [ + "range" + ] + }] + }, + "/{shareName}/{directory}/{fileName}?comp=range&fromURL": { + "put": { + "tags": [ + "file" + ], + "operationId": "File_UploadRangeFromURL", + "description": "Upload a range of bytes to a file where the contents are read from a URL.", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/TargetRange" + }, + { + "$ref": "#/parameters/CopySource" + }, + { + "$ref": "#/parameters/SourceRange" + }, + { + "$ref": "#/parameters/FileRangeWriteFromUrl" + }, + { + "$ref": "#/parameters/ContentLength" + }, + { + "$ref": "#/parameters/SourceContentCrc64" + }, + { + "$ref": "#/parameters/SourceIfMatchCrc64" + }, + { + "$ref": "#/parameters/SourceIfNoneMatchCrc64" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "201": { + "description": "Success (Created).", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the file, in quotes." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date and time the directory was last modified. Any operation that modifies the share or its properties or metadata updates the last modified time. Operations on files do not affect the last modified time of the share." + }, + "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 File service; it is not necessarily the same value as may have been 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 File service used to execute 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." + }, + "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": [ + "range" + ] + }] + }, + "/{shareName}/{directory}/{fileName}?comp=rangelist": { + "get": { + "tags": [ + "file" + ], + "operationId": "File_GetRangeList", + "description": "Returns the list of valid ranges for a file.", + "parameters": [{ + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "description": "Specifies the range of bytes over which to list ranges, inclusively.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "The date/time that the file was last modified. Any operation that modifies the file, including an update of the file's metadata or properties, changes the file's last modified time." + }, + "ETag": { + "type": "string", + "format": "etag", + "description": "The ETag contains a value which represents the version of the file, in quotes." + }, + "x-ms-content-length": { + "x-ms-client-name": "FileContentLength", + "type": "integer", + "format": "int64", + "description": "The size of the file 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 File service used to execute 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." + } + }, + "schema": { + "$ref": "#/definitions/RangeList" + } + }, + "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": [ + "rangelist" + ] + }] + }, + "/{shareName}/{directory}/{fileName}?comp=copy": { + "put": { + "tags": [ + "file" + ], + "operationId": "File_StartCopy", + "description": "Copies a blob or file to a destination file within the storage account.", + "parameters": [{ + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/Metadata" + }, + { + "$ref": "#/parameters/CopySource" + } + ], + "responses": { + "202": { + "description": "The copy file has been accepted with the specified copy status.", + "headers": { + "ETag": { + "type": "string", + "format": "etag", + "description": "If the copy is completed, contains the ETag of the destination file. If the copy is not complete, contains the ETag of the empty file created at the start of the copy." + }, + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Returns the date/time that the copy operation to the destination file completed." + }, + "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 File service used to execute 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." + }, + "x-ms-copy-id": { + "x-ms-client-name": "CopyId", + "type": "string", + "description": "String identifier for this copy operation. Use with Get File or Get File Properties to check the status of this copy operation, or pass to Abort Copy File 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": [ + + ] + }, + "/{shareName}/{directory}/{fileName}?comp=copy©id={CopyId}": { + "put": { + "tags": [ + "file" + ], + "operationId": "File_AbortCopy", + "description": "Aborts a pending Copy File operation, and leaves a destination file with zero length and full metadata.", + "parameters": [{ + "$ref": "#/parameters/CopyId" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/CopyActionAbort" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "204": { + "description": "The delete request was accepted and the file 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 File service used to execute 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-error-code": { + "x-ms-client-name": "ErrorCode", + "type": "string" + } + }, + "schema": { + "$ref": "#/definitions/StorageError" + } + } + } + }, + "parameters": [{ + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "copy" + ] + }] + }, + "/{shareName}/{directory}/{fileName}?comp=listhandles": { + "get":{ + "tags": [ + "file" + ], + "operationId": "File_ListHandles", + "description": "Lists handles for file", + "parameters":[ + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/MaxResults" + }, + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success.", + "headers": { + "Content-Type": { + "type": "string", + "description": "Specifies the format in which the results are returned. Currently this value 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 File service used to execute 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." + } + }, + "schema": { + "$ref": "#/definitions/ListHandlesResponse" + } + }, + "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": [ + "listhandles" + ] + } + ] + }, + "/{shareName}/{directory}/{fileName}?comp=forceclosehandles": { + "put": { + "tags": [ + "file" + ], + "operationId": "File_ForceCloseHandles", + "description": "Closes all handles open for given file", + "parameters": [ + { + "$ref": "#/parameters/Timeout" + }, + { + "$ref": "#/parameters/Marker" + }, + { + "$ref": "#/parameters/ShareSnapshot" + }, + { + "$ref": "#/parameters/HandleId" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "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 File service used to execute 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." + }, + "x-ms-marker": { + "x-ms-client-name": "marker", + "type": "string", + "description": "A string describing next handle to be closed. It is returned when more handles need to be closed to complete the request." + }, + "x-ms-number-of-handles-closed": { + "x-ms-client-name": "numberOfHandlesClosed", + "type": "integer", + "description": "Contains count of number of handles closed." + } + } + }, + "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": [ + "forceclosehandles" + ] + } + ] + } + }, + "definitions": { + "AccessPolicy": { + "description": "An Access policy.", + "type": "object", + "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" + } + } + }, + "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", + "CannotDeleteFileOrDirectory", + "ClientCacheFlushDelay", + "DeletePending", + "DirectoryNotEmpty", + "FileLockConflict", + "InvalidFileOrDirectoryPathName", + "ParentNotFound", + "ReadOnlyAttribute", + "ShareAlreadyExists", + "ShareBeingDeleted", + "ShareDisabled", + "ShareNotFound", + "SharingViolation", + "ShareSnapshotInProgress", + "ShareSnapshotCountExceeded", + "ShareSnapshotOperationNotSupported", + "ShareHasSnapshots", + "ContainerQuotaDowngradeNotAllowed" + ], + "x-ms-enum": { + "name": "StorageErrorCode", + "modelAsString": true + } + }, + "FilesAndDirectoriesListSegment": { + "description": "Abstract for entries that can be listed from Directory.", + "type": "object", + "required": [ + "DirectoryItems", + "FileItems" + ], + "properties": { + "DirectoryItems": { + "type": "array", + "items": { + "$ref": "#/definitions/DirectoryItem" + } + }, + "FileItems": { + "type": "array", + "items": { + "$ref": "#/definitions/FileItem" + } + } + }, + "xml": { + "name": "Entries" + } + }, + "DirectoryItem": { + "xml": { + "name": "Directory" + }, + "description": "A listed directory item.", + "type": "object", + "required": [ + "Name" + ], + "properties": { + "Name": { + "type": "string" + } + } + }, + "FileItem": { + "xml": { + "name": "File" + }, + "description": "A listed file item.", + "type": "object", + "required": [ + "Name", + "Properties" + ], + "properties": { + "Name": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/FileProperty" + } + } + }, + "FileProperty": { + "description": "File properties.", + "type": "object", + "required": [ + "Content-Length" + ], + "properties": { + "Content-Length": { + "description": "Content length of the file. This value may not be up-to-date since an SMB client may have modified the file locally. The value of Content-Length may not reflect that fact until the handle is closed or the op-lock is broken. To retrieve current property values, call Get File Properties.", + "type": "integer", + "format": "int64" + } + } + }, + "HandleItem" : { + "xml": { + "name": "Handle" + }, + "description": "A listed Azure Storage handle item.", + "type": "object", + "required": [ + "HandleId", + "Path", + "FileId", + "SessionId", + "ClientIp", + "OpenTime" + ], + "properties": { + "HandleId": { + "type": "string", + "description": "XSMB service handle ID" + }, + "Path": { + "type": "string", + "description": "File or directory name including full path starting from share root" + }, + "FileId": { + "type": "string", + "description": "FileId uniquely identifies the file or directory." + }, + "ParentId": { + "type": "string", + "description": "ParentId uniquely identifies the parent directory of the object." + }, + "SessionId": { + "type": "string", + "description": "SMB session ID in context of which the file handle was opened" + }, + "ClientIp": { + "type": "string", + "description": "Client IP that opened the handle" + }, + "OpenTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Time when the session that previously opened the handle has last been reconnected. (UTC)" + }, + "LastReconnectTime": { + "type": "string", + "format": "date-time-rfc1123", + "description": "Time handle was last connected to (UTC)" + } + } + }, + "ListFilesAndDirectoriesSegmentResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of directories and files.", + "type": "object", + "required": [ + "ServiceEndpoint", + "ShareName", + "DirectoryPath", + "Prefix", + "NextMarker", + "Segment" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ShareName": { + "type": "string", + "xml": { + "attribute": true + } + }, + "ShareSnapshot": { + "type": "string", + "xml": { + "attribute": true + } + }, + "DirectoryPath": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "Segment": { + "$ref": "#/definitions/FilesAndDirectoriesListSegment" + }, + "NextMarker": { + "type": "string" + } + } + }, + "ListHandlesResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of handles.", + "type": "object", + "required": [ + "NextMarker" + ], + "properties": { + "HandleList": { + "type": "array", + "items": { + "$ref": "#/definitions/HandleItem" + }, + "xml": { + "name": "Entries", + "wrapped": true + } + }, + "NextMarker": { + "type": "string" + } + } + }, + "ListSharesResponse": { + "xml": { + "name": "EnumerationResults" + }, + "description": "An enumeration of shares.", + "type": "object", + "required": [ + "ServiceEndpoint", + "NextMarker" + ], + "properties": { + "ServiceEndpoint": { + "type": "string", + "xml": { + "attribute": true + } + }, + "Prefix": { + "type": "string" + }, + "Marker": { + "type": "string" + }, + "MaxResults": { + "type": "integer" + }, + "ShareItems": { + "type": "array", + "items": { + "$ref": "#/definitions/ShareItem" + }, + "xml": { + "name": "Shares", + "wrapped": true + } + }, + "NextMarker": { + "type": "string" + } + } + }, + "Metadata": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "Metrics": { + "description": "Storage Analytics metrics for file service.", + "required": [ + "Version", + "Enabled" + ], + "properties": { + "Version": { + "description": "The version of Storage Analytics to configure.", + "type": "string" + }, + "Enabled": { + "description": "Indicates whether metrics are enabled for the File service.", + "type": "boolean" + }, + "IncludeAPIs": { + "description": "Indicates whether metrics should generate summary statistics for called API operations.", + "type": "boolean" + }, + "RetentionPolicy": { + "$ref": "#/definitions/RetentionPolicy" + } + } + }, + "Range": { + "description": "An Azure Storage file range.", + "type": "object", + "required": [ + "Start", + "End" + ], + "properties": { + "Start": { + "type": "integer", + "format": "int64", + "description": "Start of the range." + }, + "End": { + "type": "integer", + "format": "int64", + "description": "End of the range." + } + }, + "xml": { + "name": "Range" + } + }, + "RangeList": { + "description": "A list of non-overlapping valid ranges, sorted by increasing address range.", + "type": "array", + "items": { + "$ref": "#/definitions/Range" + }, + "xml": { + "wrapped": true, + "name": "Ranges" + } + }, + "StorageError": { + "type": "object", + "properties": { + "Message": { + "type": "string" + } + } + }, + "RetentionPolicy": { + "description": "The retention policy.", + "type": "object", + "required": [ + "Enabled" + ], + "properties": { + "Enabled": { + "description": "Indicates whether a retention policy is enabled for the File service. If false, metrics data is retained, and the user is responsible for deleting it.", + "type": "boolean" + }, + "Days": { + "description": "Indicates the number of days that metrics data should be retained. All data older than this value will be deleted. Metrics data is deleted on a best-effort basis after the retention period expires.", + "type": "integer", + "minimum": 1, + "maximum": 365 + } + } + }, + "ShareItem": { + "xml": { + "name": "Share" + }, + "description": "A listed Azure Storage share item.", + "type": "object", + "required": [ + "Name", + "Properties" + ], + "properties": { + "Name": { + "type": "string" + }, + "Snapshot": { + "type": "string" + }, + "Properties": { + "$ref": "#/definitions/ShareProperties" + }, + "Metadata": { + "$ref": "#/definitions/Metadata" + } + } + }, + "ShareProperties": { + "description": "Properties of a share.", + "type": "object", + "required": [ + "Last-Modified", + "Etag", + "Quota" + ], + "properties": { + "Last-Modified": { + "type": "string", + "format": "date-time-rfc1123" + }, + "Etag": { + "type": "string", + "format": "etag" + }, + "Quota": { + "type": "integer" + } + } + }, + "ShareStats": { + "description": "Stats for the share.", + "type": "object", + "required": [ + "ShareUsageBytes" + ], + "properties": { + "ShareUsageBytes": { + "description": "The approximate size of the data stored in bytes. Note that this value may not include all recently created or recently resized files.", + "type": "integer" + } + } + }, + "SignedIdentifier": { + "description": "Signed identifier.", + "type": "object", + "required": [ + "Id" + ], + "properties": { + "Id": { + "type": "string", + "description": "A unique id." + }, + "AccessPolicy": { + "description": "The access policy.", + "$ref": "#/definitions/AccessPolicy" + } + } + }, + "SignedIdentifiers": { + "description": "A collection of signed identifiers.", + "type": "array", + "items": { + "$ref": "#/definitions/SignedIdentifier", + "xml": { + "name": "SignedIdentifier" + } + }, + "xml": { + "wrapped": true, + "name": "SignedIdentifiers" + } + }, + "StorageServiceProperties": { + "description": "Storage service properties.", + "type": "object", + "properties": { + "HourMetrics": { + "description": "A summary of request statistics grouped by API in hourly aggregates for files.", + "$ref": "#/definitions/Metrics" + }, + "MinuteMetrics": { + "description": "A summary of request statistics grouped by API in minute aggregates for files.", + "$ref": "#/definitions/Metrics" + }, + "Cors": { + "description": "The set of CORS rules.", + "type": "array", + "items": { + "$ref": "#/definitions/CorsRule" + }, + "xml": { + "wrapped": true + } + } + } + } + }, + "parameters": { + "ApiVersionParameter": { + "name": "x-ms-version", + "x-ms-client-name": "version", + "in": "header", + "description": "Specifies the version of the operation to use for this request.", + "required": true, + "type": "string" + }, + "ContentLength": { + "name": "Content-Length", + "x-ms-client-name": "contentLength", + "in": "header", + "description": "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.", + "required": true, + "type": "integer", + "format": "int64", + "x-ms-parameter-location": "method" + }, + "ContentMD5": { + "name": "Content-MD5", + "x-ms-client-name": "contentMD5", + "in": "header", + "description": "An MD5 hash of the content. This hash is used to verify the integrity of the data during transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error code 400 (Bad Request).", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method" + }, + "CopyActionAbort": { + "name": "x-ms-copy-action", + "x-ms-client-name": "copyActionAbortConstant", + "in": "header", + "required": true, + "type": "string", + "enum": [ + "abort" + ], + "x-ms-parameter-location": "method" + }, + "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 File operation." + }, + "CopySource": { + "name": "x-ms-copy-source", + "x-ms-client-name": "copySource", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Specifies the URL of the source file or blob, up to 2 KB in length. To copy a file to another file within the same storage account, you may use Shared Key to authenticate the source file. If you are copying a file from another storage account, or if you are copying a blob from the same storage account or another storage account, then you must authenticate the source file or blob using a shared access signature. If the source is a public blob, no authentication is required to perform the copy operation. A file in a share snapshot can also be specified as a copy source." + }, + "DeleteSnapshots": { + "name": "x-ms-delete-snapshots", + "x-ms-client-name": "deleteSnapshots", + "description": "Specifies the option include to delete the base share and all of its snapshots.", + "in": "header", + "required": false, + "type": "string", + "enum": [ + "include" + ], + "x-ms-enum": { + "name": "DeleteSnapshotsOptionType", + "modelAsString": false + }, + "x-ms-parameter-location": "method" + }, + "FileAttributes": { + "name": "x-ms-file-attributes", + "x-ms-client-name": "FileAttributes", + "in": "header", + "description": "If specified, the provided file attributes shall be set. Default value: ‘Archive’ for file and ‘Directory’ for directory. ‘None’ can also be specified as default.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "FileCacheControl": { + "name": "x-ms-cache-control", + "x-ms-client-name": "fileCacheControl", + "description": "Sets the file's cache control. The File service stores this value but does not use or modify it.", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "file-HTTP-headers" + } + }, + "FileContentDisposition": { + "name": "x-ms-content-disposition", + "x-ms-client-name": "fileContentDisposition", + "description": "Sets the file's Content-Disposition header.", + "in": "header", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "file-HTTP-headers" + } + }, + "FileContentEncoding": { + "name": "x-ms-content-encoding", + "x-ms-client-name": "fileContentEncoding", + "in": "header", + "description": "Specifies which content encodings have been applied to the file.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "file-HTTP-headers" + } + }, + "FileContentLanguage": { + "name": "x-ms-content-language", + "x-ms-client-name": "fileContentLanguage", + "in": "header", + "description": "Specifies the natural languages used by this resource.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "file-HTTP-headers" + } + }, + "FileContentMD5": { + "name": "x-ms-content-md5", + "x-ms-client-name": "fileContentMD5", + "in": "header", + "description": "Sets the file's MD5 hash.", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "file-HTTP-headers" + } + }, + "FileContentType": { + "name": "x-ms-content-type", + "x-ms-client-name": "fileContentType", + "in": "header", + "description": "Sets the MIME content type of the file. The default type is 'application/octet-stream'.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "file-HTTP-headers" + } + }, + "FileCreationTime": { + "name": "x-ms-file-creation-time", + "x-ms-client-name": "FileCreationTime", + "in": "header", + "description": "Creation time for the file/directory. Default value: Now.", + "required": true, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method" + }, + "FileLastWriteTime": { + "name": "x-ms-file-last-write-time", + "x-ms-client-name": "FileLastWriteTime", + "in": "header", + "description": "Last write time for the file/directory. Default value: Now.", + "required": true, + "type": "string", + "format": "date-time-rfc1123", + "x-ms-parameter-location": "method" + }, + "FilePermission": { + "name": "x-ms-file-permission", + "x-ms-client-name": "FilePermission", + "in": "header", + "description": "If specified the permission (security descriptor) shall be set for the directory/file. This header can be used if Permission size is <= 8KB, else x-ms-file-permission-key header shall be used. Default value: Inherit. If SDDL is specified as input, it must have owner, group and dacl. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "FilePermissionKey": { + "name": "x-ms-file-permission-key", + "x-ms-client-name": "FilePermissionKey", + "in": "header", + "description": "Key of the permission to be set for the directory/file. Note: Only one of the x-ms-file-permission or x-ms-file-permission-key should be specified.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "FileRangeWriteFromUrl": { + "name": "x-ms-write", + "x-ms-client-name": "fileRangeWriteFromUrl", + "in": "header", + "description": "Only update is supported: - Update: Writes the bytes downloaded from the source url into the specified range.", + "required": true, + "type": "string", + "enum": [ + "update" + ], + "default": "update", + "x-ms-enum": { + "name": "FileRangeWriteFromUrlType", + "modelAsString": false + } + }, + "FileType": { + "name": "x-ms-type", + "x-ms-client-name": "fileTypeConstant", + "in": "header", + "required": true, + "description": "Dummy constant parameter, file type can only be file.", + "type": "string", + "enum": [ + "file" + ], + "x-ms-parameter-location": "method" + }, + "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 this header is set to true and specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size." + }, + "HandleId": { + "name": "x-ms-handle-id", + "x-ms-client-name": "handleId", + "in": "header", + "description": "Specifies handle ID opened on the file or directory to be closed. Asterix (‘*’) is a wildcard that specifies all handles.", + "required": true, + "type": "string", + "x-ms-parameter-location": "method" + }, + "ListSharesInclude": { + "name": "include", + "in": "query", + "description": "Include this parameter to specify one or more datasets to include in the response.", + "required": false, + "type": "array", + "collectionFormat": "csv", + "items": { + "type": "string", + "enum": [ + "snapshots", + "metadata" + ], + "x-ms-enum": { + "name": "ListSharesIncludeType", + "modelAsString": false + } + }, + "x-ms-parameter-location": "method" + }, + "Marker": { + "name": "marker", + "in": "query", + "description": "A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "MaxResults": { + "name": "maxresults", + "in": "query", + "description": "Specifies the maximum number of entries to return. If the request does not specify maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 items.", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method" + }, + "Metadata": { + "name": "x-ms-meta", + "x-ms-client-name": "metadata", + "in": "header", + "description": "A name-value pair to associate with a file storage object.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-header-collection-prefix": "x-ms-meta-" + }, + "OptionalBody": { + "name": "optionalbody", + "in": "body", + "description": "Initial data.", + "required": false, + "schema": { + "type": "object", + "format": "file" + }, + "x-ms-parameter-location": "method" + }, + "Prefix": { + "name": "prefix", + "in": "query", + "description": "Filters the results to return only entries whose name begins with the specified prefix.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "Range": { + "name": "x-ms-range", + "x-ms-client-name": "range", + "in": "header", + "description": "Return file data only from the specified byte range.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "Recursive": { + "name": "x-ms-recursive", + "x-ms-client-name": "recursive", + "in": "header", + "description": "Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files.", + "required": false, + "type": "boolean", + "x-ms-parameter-location": "method" + }, + "Url": { + "name": "url", + "in": "path", + "description": "The URL of the service account, share, directory or file that is the target of the desired operation.", + "required": true, + "type": "string", + "x-ms-skip-url-encoding": true + }, + "ShareAcl": { + "name": "shareAcl", + "in": "body", + "description": "The ACL for the share.", + "schema": { + "$ref": "#/definitions/SignedIdentifiers" + }, + "x-ms-parameter-location": "method" + }, + "ShareQuota": { + "name": "x-ms-share-quota", + "x-ms-client-name": "quota", + "in": "header", + "description": "Specifies the maximum size of the share, in gigabytes.", + "required": false, + "type": "integer", + "minimum": 1, + "x-ms-parameter-location": "method" + }, + "ShareSnapshot": { + "name": "sharesnapshot", + "in": "query", + "description": "The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method" + }, + "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." + }, + "SourceIfMatchCrc64": { + "name": "x-ms-source-if-match-crc64", + "x-ms-client-name": "sourceIfMatchCrc64", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify the crc64 value to operate only on range with a matching crc64 checksum." + }, + "SourceIfNoneMatchCrc64": { + "name": "x-ms-source-if-none-match-crc64", + "x-ms-client-name": "sourceIfNoneMatchCrc64", + "in": "header", + "required": false, + "type": "string", + "format": "byte", + "x-ms-parameter-location": "method", + "x-ms-parameter-grouping": { + "name": "source-modified-access-conditions" + }, + "description": "Specify the crc64 value to operate only on range without a matching crc64 checksum." + }, + "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." + }, + "StorageServiceProperties": { + "name": "StorageServiceProperties", + "in": "body", + "description": "The StorageService properties.", + "required": true, + "schema": { + "$ref": "#/definitions/StorageServiceProperties" + }, + "x-ms-parameter-location": "method" + }, + "TargetRange": { + "name": "x-ms-range", + "x-ms-client-name": "Range", + "in": "header", + "required": true, + "type": "string", + "x-ms-parameter-location": "method", + "description": "Writes data to the specified byte range in the file." + }, + "Timeout": { + "name": "timeout", + "in": "query", + "description": "The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations.", + "required": false, + "type": "integer", + "minimum": 0, + "x-ms-parameter-location": "method" + } + } +} From c326c9f8c6c1bac4a81900ff916013d5a6b7ab95 Mon Sep 17 00:00:00 2001 From: Rakshith Bhyravabhotla Date: Thu, 22 Aug 2019 16:38:56 -0700 Subject: [PATCH 2/2] swagger changes --- .../_directory_operations_async.py | 1 + .../operations/_directory_operations.py | 1 + .../azure-storage-file/swagger/README.md | 1 + .../swagger/file-2019-02-02.json | 74 ++++++++++++++++--- 4 files changed, 65 insertions(+), 12 deletions(-) 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 13a8c729c76a..ba9dad7c9405 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 @@ -305,6 +305,7 @@ async def set_properties(self, file_attributes="none", file_creation_time="now", query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['restype'] = self._serialize.query("self.restype", self.restype, 'str') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') # Construct headers 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 4cd6176e5959..aa3610436576 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 @@ -305,6 +305,7 @@ def set_properties(self, file_attributes="none", file_creation_time="now", file_ query_parameters = {} if timeout is not None: query_parameters['timeout'] = self._serialize.query("timeout", timeout, 'int', minimum=0) + query_parameters['restype'] = self._serialize.query("self.restype", self.restype, 'str') query_parameters['comp'] = self._serialize.query("comp", comp, 'str') # Construct headers diff --git a/sdk/storage/azure-storage-file/swagger/README.md b/sdk/storage/azure-storage-file/swagger/README.md index 4ef2c814084b..b68783a68c80 100644 --- a/sdk/storage/azure-storage-file/swagger/README.md +++ b/sdk/storage/azure-storage-file/swagger/README.md @@ -87,6 +87,7 @@ directive: ``` ### FileRangeWriteFromUrl Constant +This value is supposed to be the constant value update and these changes turn it from a parameter into a constant. ``` yaml directive: - from: swagger-document diff --git a/sdk/storage/azure-storage-file/swagger/file-2019-02-02.json b/sdk/storage/azure-storage-file/swagger/file-2019-02-02.json index 571617fff6d0..94f08be899cd 100644 --- a/sdk/storage/azure-storage-file/swagger/file-2019-02-02.json +++ b/sdk/storage/azure-storage-file/swagger/file-2019-02-02.json @@ -543,7 +543,7 @@ "description": "A UTC date/time value generated by the service that indicates the time at which the response was initiated." }, "x-ms-file-permission-key": { - "x-ms-client-name": "FilePermissonKey", + "x-ms-client-name": "FilePermissionKey", "type": "string", "description": "Key of the permission set for the directory/file." } @@ -1090,7 +1090,7 @@ "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-file-permission-key": { - "x-ms-client-name": "FilePermissonKey", + "x-ms-client-name": "FilePermissionKey", "type": "string", "description": "Key of the permission set for the directory." }, @@ -1428,15 +1428,26 @@ } } }, - "parameters": [{ - "name": "comp", - "in": "query", - "required": true, - "type": "string", - "enum": [ - "properties" - ] - }] + "parameters": [ + { + "name": "restype", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "directory" + ] + }, + { + "name": "comp", + "in": "query", + "required": true, + "type": "string", + "enum": [ + "properties" + ] + } + ] }, "/{shareName}/{directory}?restype=directory&comp=metadata": { "put": { @@ -1500,7 +1511,8 @@ } } }, - "parameters": [{ + "parameters": [ + { "name": "restype", "in": "query", "required": true, @@ -2236,6 +2248,44 @@ "x-ms-client-name": "IsServerEncrypted", "type": "boolean", "description": "The value of this header is set to true if the file data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the file is unencrypted, or if only parts of the file/application metadata are encrypted)." + }, + "x-ms-file-attributes": { + "x-ms-client-name": "FileAttributes", + "type": "string", + "description": "Attributes set for the file." + }, + "x-ms-file-creation-time": { + "x-ms-client-name": "FileCreationTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Creation time for the file." + }, + "x-ms-file-last-write-time": { + "x-ms-client-name": "FileLastWriteTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Last write time for the file." + }, + "x-ms-file-change-time": { + "x-ms-client-name": "FileChangeTime", + "type": "string", + "format": "date-time-rfc1123", + "description": "Change time for the file." + }, + "x-ms-file-permission-key": { + "x-ms-client-name": "FilePermissionKey", + "type": "string", + "description": "Key of the permission set for the file." + }, + "x-ms-file-id": { + "x-ms-client-name": "FileId", + "type": "string", + "description": "The fileId of the file." + }, + "x-ms-file-parent-id": { + "x-ms-client-name": "FileParentId", + "type": "string", + "description": "The parent fileId of the file." } }, "schema": {