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
1 change: 1 addition & 0 deletions sdk/storage/azure-storage-file/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

**Breaking changes**

- `file_permission_key` parameter has been renamed to `permission_key`
- `set_share_access_policy` has required parameter `signed_identifiers`.
- NoRetry policy has been removed. Use keyword argument `retry_total=0` for no retries.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ async def set_http_headers(self, file_attributes="none", # type: Union[str, NTF
file_creation_time="preserve", # type: Union[str, datetime]
file_last_write_time="preserve", # type: Union[str, datetime]
file_permission=None, # type: Optional[str]
file_permission_key=None, # type: Optional[str]
permission_key=None, # type: Optional[str]
timeout=None, # type: Optional[int]
**kwargs): # type: ignore
# type: (...) -> Dict[str, Any]
Expand All @@ -387,21 +387,21 @@ async def set_http_headers(self, file_attributes="none", # type: Union[str, NTF
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
:param 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
:type permission_key: str
:returns: File-updated property dict (Etag and last modified).
:rtype: dict(str, Any)
"""
file_permission = _get_file_permission(file_permission, file_permission_key, 'preserve')
file_permission = _get_file_permission(file_permission, permission_key, 'preserve')
try:
return await self._client.directory.set_properties( # type: ignore
file_attributes=_str(file_attributes),
file_creation_time=_datetime_to_str(file_creation_time),
file_last_write_time=_datetime_to_str(file_last_write_time),
file_permission=file_permission,
file_permission_key=file_permission_key,
file_permission_key=permission_key,
timeout=timeout,
cls=return_response_headers,
**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async def _upload_file_helper(
file_creation_time=file_creation_time,
file_last_write_time=file_last_write_time,
file_permission=file_permission,
file_permission_key=file_permission_key,
permission_key=file_permission_key,
timeout=timeout,
**kwargs
)
Expand Down Expand Up @@ -151,7 +151,7 @@ async def create_file( # type: ignore
file_creation_time="now", # type: Union[str, datetime]
file_last_write_time="now", # type: Union[str, datetime]
file_permission=None, # type: Optional[str]
file_permission_key=None, # type: Optional[str]
permission_key=None, # type: Optional[str]
timeout=None, # type: Optional[int]
**kwargs # type: Any
):
Expand Down Expand Up @@ -188,10 +188,10 @@ async def create_file( # type: ignore
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
:param 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
:type permission_key: str
:returns: File-updated property dict (Etag and last modified).
:rtype: dict(str, Any)

Expand Down Expand Up @@ -219,7 +219,7 @@ async def create_file( # type: ignore
file_content_language=content_settings.content_language,
file_content_disposition=content_settings.content_disposition,
)
file_permission = _get_file_permission(file_permission, file_permission_key, 'Inherit')
file_permission = _get_file_permission(file_permission, permission_key, 'Inherit')
try:
return await self._client.file.create( # type: ignore
file_content_length=size,
Expand All @@ -228,7 +228,7 @@ async def create_file( # type: ignore
file_creation_time=_datetime_to_str(file_creation_time),
file_last_write_time=_datetime_to_str(file_last_write_time),
file_permission=file_permission,
file_permission_key=file_permission_key,
file_permission_key=permission_key,
file_http_headers=file_http_headers,
headers=headers,
timeout=timeout,
Expand All @@ -250,7 +250,7 @@ async def upload_file(
file_creation_time="now", # type: Union[str, datetime]
file_last_write_time="now", # type: Union[str, datetime]
file_permission=None, # type: Optional[str]
file_permission_key=None, # type: Optional[str]
permission_key=None, # type: Optional[str]
encoding="UTF-8", # type: str
timeout=None, # type: Optional[int]
**kwargs # type: Any
Expand Down Expand Up @@ -299,10 +299,10 @@ async def upload_file(
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
:param 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
:type permission_key: str

:returns: File-updated property dict (Etag and last modified).
:rtype: dict(str, Any)
Expand Down Expand Up @@ -348,7 +348,7 @@ async def upload_file(
file_creation_time=file_creation_time,
file_last_write_time=file_last_write_time,
file_permission=file_permission,
file_permission_key=file_permission_key,
file_permission_key=permission_key,
**kwargs
)

Expand Down Expand Up @@ -535,7 +535,7 @@ async def set_http_headers(self, content_settings, # type: ContentSettings
file_creation_time="preserve", # type: Union[str, datetime]
file_last_write_time="preserve", # type: Union[str, datetime]
file_permission=None, # type: Optional[str]
file_permission_key=None, # type: Optional[str]
permission_key=None, # type: Optional[str]
timeout=None, # type: Optional[int]
**kwargs # Any
): # type: ignore
Expand Down Expand Up @@ -564,10 +564,10 @@ async def set_http_headers(self, content_settings, # type: ContentSettings
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
:param 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
:type permission_key: str
:returns: File-updated property dict (Etag and last modified).
:rtype: dict(str, Any)
"""
Expand All @@ -580,7 +580,7 @@ async def set_http_headers(self, content_settings, # type: ContentSettings
file_content_language=content_settings.content_language,
file_content_disposition=content_settings.content_disposition,
)
file_permission = _get_file_permission(file_permission, file_permission_key, 'preserve')
file_permission = _get_file_permission(file_permission, permission_key, 'preserve')
try:
return await self._client.file.set_http_headers( # type: ignore
file_content_length=file_content_length,
Expand All @@ -589,7 +589,7 @@ async def set_http_headers(self, content_settings, # type: ContentSettings
file_creation_time=_datetime_to_str(file_creation_time),
file_last_write_time=_datetime_to_str(file_last_write_time),
file_permission=file_permission,
file_permission_key=file_permission_key,
file_permission_key=permission_key,
timeout=timeout,
cls=return_response_headers,
**kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ async def create_permission_for_share(self, file_permission, # type: str

@distributed_trace_async
async def get_permission_for_share( # type: ignore
self, file_permission_key, # type: str
self, permission_key, # type: str
timeout=None, # type: Optional[int]
**kwargs # type: Any
):
Expand All @@ -499,7 +499,7 @@ async def get_permission_for_share( # type: ignore

This 'permission' can be used for the files/directories in the share.

:param str file_permission_key:
:param str permission_key:
Key of the file permission to retrieve
:param int timeout:
The timeout parameter is expressed in seconds.
Expand All @@ -508,7 +508,7 @@ async def get_permission_for_share( # type: ignore
"""
try:
return await self._client.share.get_permission( # type: ignore
file_permission_key=file_permission_key,
file_permission_key=permission_key,
cls=deserialize_permission,
timeout=timeout,
**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def set_http_headers(self, file_attributes="none", # type: Union[str, NTFSAttri
file_creation_time="preserve", # type: Union[str, datetime]
file_last_write_time="preserve", # type: Union[str, datetime]
file_permission=None, # type: Optional[str]
file_permission_key=None, # type: Optional[str]
permission_key=None, # type: Optional[str]
timeout=None, # type: Optional[int]
**kwargs): # type: ignore
# type: (...) -> Dict[str, Any]
Expand All @@ -460,21 +460,21 @@ def set_http_headers(self, file_attributes="none", # type: Union[str, NTFSAttri
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
:param 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
:type permission_key: str
:returns: File-updated property dict (Etag and last modified).
:rtype: dict(str, Any)
"""
file_permission = _get_file_permission(file_permission, file_permission_key, 'preserve')
file_permission = _get_file_permission(file_permission, permission_key, 'preserve')
try:
return self._client.directory.set_properties( # type: ignore
file_attributes=_str(file_attributes),
file_creation_time=_datetime_to_str(file_creation_time),
file_last_write_time=_datetime_to_str(file_last_write_time),
file_permission=file_permission,
file_permission_key=file_permission_key,
file_permission_key=permission_key,
timeout=timeout,
cls=return_response_headers,
**kwargs)
Expand Down
30 changes: 15 additions & 15 deletions sdk/storage/azure-storage-file/azure/storage/file/file_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _upload_file_helper(
file_creation_time=file_creation_time,
file_last_write_time=file_last_write_time,
file_permission=file_permission,
file_permission_key=file_permission_key,
permission_key=file_permission_key,
**kwargs
)
if size == 0:
Expand Down Expand Up @@ -340,7 +340,7 @@ def create_file( # type: ignore
file_creation_time="now", # type: Union[str, datetime]
file_last_write_time="now", # type: Union[str, datetime]
file_permission=None, # type: Optional[str]
file_permission_key=None, # type: Optional[str]
permission_key=None, # type: Optional[str]
timeout=None, # type: Optional[int]
**kwargs # type: Any
):
Expand Down Expand Up @@ -377,10 +377,10 @@ def create_file( # type: ignore
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
:param 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
:type permission_key: str
:returns: File-updated property dict (Etag and last modified).
:rtype: dict(str, Any)

Expand Down Expand Up @@ -408,7 +408,7 @@ def create_file( # type: ignore
file_content_language=content_settings.content_language,
file_content_disposition=content_settings.content_disposition
)
file_permission = _get_file_permission(file_permission, file_permission_key, 'Inherit')
file_permission = _get_file_permission(file_permission, permission_key, 'Inherit')
try:
return self._client.file.create( # type: ignore
file_content_length=size,
Expand All @@ -417,7 +417,7 @@ def create_file( # type: ignore
file_creation_time=_datetime_to_str(file_creation_time),
file_last_write_time=_datetime_to_str(file_last_write_time),
file_permission=file_permission,
file_permission_key=file_permission_key,
file_permission_key=permission_key,
file_http_headers=file_http_headers,
headers=headers,
timeout=timeout,
Expand All @@ -438,7 +438,7 @@ def upload_file(
file_creation_time="now", # type: Union[str, datetime]
file_last_write_time="now", # type: Union[str, datetime]
file_permission=None, # type: Optional[str]
file_permission_key=None, # type: Optional[str]
permission_key=None, # type: Optional[str]
encoding="UTF-8", # type: str
timeout=None, # type: Optional[int]
**kwargs # type: Any
Expand Down Expand Up @@ -487,10 +487,10 @@ def upload_file(
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
:param 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
:type permission_key: str
:returns: File-updated property dict (Etag and last modified).
:rtype: dict(str, Any)

Expand Down Expand Up @@ -535,7 +535,7 @@ def upload_file(
file_creation_time=file_creation_time,
file_last_write_time=file_last_write_time,
file_permission=file_permission,
file_permission_key=file_permission_key,
file_permission_key=permission_key,
**kwargs)

@distributed_trace
Expand Down Expand Up @@ -723,7 +723,7 @@ def set_http_headers(self, content_settings, # type: ContentSettings
file_creation_time="preserve", # type: Union[str, datetime]
file_last_write_time="preserve", # type: Union[str, datetime]
file_permission=None, # type: Optional[str]
file_permission_key=None, # type: Optional[str]
permission_key=None, # type: Optional[str]
timeout=None, # type: Optional[int]
**kwargs # Any
): # type: ignore
Expand Down Expand Up @@ -752,10 +752,10 @@ def set_http_headers(self, content_settings, # type: ContentSettings
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
:param 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
:type permission_key: str
:returns: File-updated property dict (Etag and last modified).
:rtype: dict(str, Any)
"""
Expand All @@ -768,7 +768,7 @@ def set_http_headers(self, content_settings, # type: ContentSettings
file_content_language=content_settings.content_language,
file_content_disposition=content_settings.content_disposition
)
file_permission = _get_file_permission(file_permission, file_permission_key, 'preserve')
file_permission = _get_file_permission(file_permission, permission_key, 'preserve')
try:
return self._client.file.set_http_headers( # type: ignore
file_content_length=file_content_length,
Expand All @@ -777,7 +777,7 @@ def set_http_headers(self, content_settings, # type: ContentSettings
file_creation_time=_datetime_to_str(file_creation_time),
file_last_write_time=_datetime_to_str(file_last_write_time),
file_permission=file_permission,
file_permission_key=file_permission_key,
file_permission_key=permission_key,
timeout=timeout,
cls=return_response_headers,
**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def create_permission_for_share(self, file_permission, # type: str

@distributed_trace
def get_permission_for_share( # type: ignore
self, file_permission_key, # type: str
self, permission_key, # type: str
timeout=None, # type: Optional[int]
**kwargs # type: Any
):
Expand All @@ -678,7 +678,7 @@ def get_permission_for_share( # type: ignore

This 'permission' can be used for the files/directories in the share.

:param str file_permission_key:
:param str permission_key:
Key of the file permission to retrieve
:param int timeout:
The timeout parameter is expressed in seconds.
Expand All @@ -687,7 +687,7 @@ def get_permission_for_share( # type: ignore
"""
try:
return self._client.share.get_permission( # type: ignore
file_permission_key=file_permission_key,
file_permission_key=permission_key,
cls=deserialize_permission,
timeout=timeout,
**kwargs)
Expand Down
Loading