Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Handles multi-API versions of Azure Storage Data Plane originally from https://g

Change Log
----------
1.6.0
++++++
* fileshare: Support v2025-07-05(12.22.0) and remove v2025-05-05

1.5.0
++++++
* packaging: Remove unused import, cleanup build pipeline
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -1737,3 +1737,84 @@ def create_hardlink(
))
except HttpResponseError as error:
process_storage_error(error)

@distributed_trace
def create_symlink(
self, target: str,
*,
metadata: Optional[Dict[str, str]] = None,
file_creation_time: Optional[Union[str, datetime]] = None,
file_last_write_time: Optional[Union[str, datetime]] = None,
owner: Optional[str] = None,
group: Optional[str] = None,
lease: Optional[Union[ShareLeaseClient, str]] = None,
timeout: Optional[int] = None,
**kwargs: Any
) -> Dict[str, Any]:
"""NFS only. Creates a symbolic link to the specified file.

:param str target:
Specifies the file path the symbolic link will point to. The file path can be either relative or absolute.
:keyword dict[str, str] metadata:
Name-value pairs associated with the file as metadata.
:keyword file_creation_time: Creation time for the file.
:paramtype file_creation_time: str or ~datetime.datetime
:keyword file_last_write_time: Last write time for the file.
:paramtype file_last_write_time: str or ~datetime.datetime
:keyword str owner: The owner of the file.
:keyword str group: The owning group of the file.
:keyword lease:
Required if the file has an active lease. Value can be a ShareLeaseClient object
or the lease ID as a string.
:paramtype lease: ~azure.storage.fileshare.ShareLeaseClient or str
:keyword int timeout:
Sets the server-side timeout for the operation in seconds. For more details see
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
This value is not tracked or validated on the client. To configure client-side network timeouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-file-share
#other-client--per-operation-configuration>`__.
:returns: File-updated property dict (ETag and last modified).
:rtype: dict[str, Any]
"""
try:
return cast(Dict[str, Any], self._client.file.create_symbolic_link(
link_text=target,
metadata=metadata,
file_creation_time=file_creation_time,
file_last_write_time=file_last_write_time,
owner=owner,
group=group,
lease_access_conditions=lease,
timeout=timeout,
cls=return_response_headers,
**kwargs
))
except HttpResponseError as error:
process_storage_error(error)

@distributed_trace
def get_symlink(
self,
*,
timeout: Optional[int] = None,
**kwargs: Any
) -> Dict[str, Any]:
"""NFS only. Gets the symbolic link for the file client.

:keyword int timeout:
Sets the server-side timeout for the operation in seconds. For more details see
https://learn.microsoft.com/rest/api/storageservices/setting-timeouts-for-file-service-operations.
This value is not tracked or validated on the client. To configure client-side network timeouts
see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-file-share
#other-client--per-operation-configuration>`__.
:returns: File-updated property dict (ETag and last modified).
:rtype: dict[str, Any]
"""
try:
return cast(Dict[str, Any], self._client.file.get_symbolic_link(
timeout=timeout,
cls=return_response_headers,
**kwargs
))
except HttpResponseError as error:
process_storage_error(error)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=line-too-long,useless-suppression,too-many-lines
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down Expand Up @@ -411,7 +411,7 @@ def from_dict(
:param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
:raises DeserializationError: if something went wrong
:rtype: Self
"""
deserializer = Deserializer(cls._infer_class_models())
Expand Down Expand Up @@ -1361,7 +1361,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
# Iter and wrapped, should have found one node only (the wrap one)
if len(children) != 1:
raise DeserializationError(
"Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
"Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
xml_name
)
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=too-many-lines
# pylint: disable=line-too-long,useless-suppression,too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down Expand Up @@ -82,12 +82,11 @@ async def create(
file_mode: Optional[str] = None,
**kwargs: Any
) -> None:
# pylint: disable=line-too-long
"""Creates a new directory under the specified share or parent directory.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting
href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting
Timeouts for File Service Operations.</a>`. Default value is None.
:type timeout: int
:param metadata: A name-value pair to associate with a file storage object. Default value is
Expand Down Expand Up @@ -222,7 +221,6 @@ async def create(
async def get_properties(
self, sharesnapshot: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any
) -> None:
# pylint: disable=line-too-long
"""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.
Expand All @@ -232,7 +230,7 @@ async def get_properties(
:type sharesnapshot: str
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting
href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting
Timeouts for File Service Operations.</a>`. Default value is None.
:type timeout: int
:return: None or the result of cls(response)
Expand Down Expand Up @@ -315,13 +313,12 @@ async def get_properties(

@distributed_trace_async
async def delete(self, timeout: Optional[int] = None, **kwargs: Any) -> None:
# pylint: disable=line-too-long
"""Removes the specified empty directory. Note that the directory must be empty before it can be
deleted.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting
href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting
Timeouts for File Service Operations.</a>`. Default value is None.
:type timeout: int
:return: None or the result of cls(response)
Expand Down Expand Up @@ -390,12 +387,11 @@ async def set_properties(
file_mode: Optional[str] = None,
**kwargs: Any
) -> None:
# pylint: disable=line-too-long
"""Sets properties on the directory.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting
href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting
Timeouts for File Service Operations.</a>`. Default value is None.
:type timeout: int
:param file_permission: If specified the permission (security descriptor) shall be set for the
Expand Down Expand Up @@ -527,12 +523,11 @@ async def set_properties(
async def set_metadata(
self, timeout: Optional[int] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any
) -> None:
# pylint: disable=line-too-long
"""Updates user defined metadata for the specified directory.

:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting
href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting
Timeouts for File Service Operations.</a>`. Default value is None.
:type timeout: int
:param metadata: A name-value pair to associate with a file storage object. Default value is
Expand Down Expand Up @@ -607,7 +602,6 @@ async def list_files_and_directories_segment(
include_extended_info: Optional[bool] = None,
**kwargs: Any
) -> _models.ListFilesAndDirectoriesSegmentResponse:
# pylint: disable=line-too-long
"""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.

Expand All @@ -628,7 +622,7 @@ async def list_files_and_directories_segment(
:type maxresults: int
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting
href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting
Timeouts for File Service Operations.</a>`. Default value is None.
:type timeout: int
:param include: Include this parameter to specify one or more datasets to include in the
Expand Down Expand Up @@ -709,7 +703,6 @@ async def list_handles(
recursive: Optional[bool] = None,
**kwargs: Any
) -> _models.ListHandlesResponse:
# pylint: disable=line-too-long
"""Lists handles for directory.

:param marker: A string value that identifies the portion of the list to be returned with the
Expand All @@ -723,7 +716,7 @@ async def list_handles(
:type maxresults: int
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting
href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting
Timeouts for File Service Operations.</a>`. Default value is None.
:type timeout: int
:param sharesnapshot: The snapshot parameter is an opaque DateTime value that, when present,
Expand Down Expand Up @@ -801,15 +794,14 @@ async def force_close_handles(
recursive: Optional[bool] = None,
**kwargs: Any
) -> None:
# pylint: disable=line-too-long
"""Closes all handles open for given directory.

:param handle_id: Specifies handle ID opened on the file or directory to be closed. Asterisk
(‘*’) is a wildcard that specifies all handles. Required.
:type handle_id: str
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting
href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting
Timeouts for File Service Operations.</a>`. Default value is None.
:type timeout: int
:param marker: A string value that identifies the portion of the list to be returned with the
Expand Down Expand Up @@ -900,15 +892,14 @@ async def rename(
copy_file_smb_info: Optional[_models.CopyFileSmbInfo] = None,
**kwargs: Any
) -> None:
# pylint: disable=line-too-long
"""Renames a directory.

:param rename_source: Required. Specifies the URI-style path of the source file, up to 2 KB in
length. Required.
:type rename_source: str
:param timeout: The timeout parameter is expressed in seconds. For more information, see
:code:`<a
href="https://docs.microsoft.com/en-us/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations?redirectedfrom=MSDN">Setting
href="https://learn.microsoft.com/rest/api/storageservices/Setting-Timeouts-for-File-Service-Operations">Setting
Timeouts for File Service Operations.</a>`. Default value is None.
:type timeout: int
:param replace_if_exists: Optional. A boolean value for if the destination file already exists,
Expand Down
Loading