From ae25cea65acbcdb83032c9287b4a2cf1c894445a Mon Sep 17 00:00:00 2001 From: Xiaoxi Fu <49707495+xiafu-msft@users.noreply.github.com> Date: Fri, 6 Mar 2020 19:06:25 -0800 Subject: [PATCH] [ADLS]Remove Secondary Endpoint for ADLS (#10144) --- .../azure/storage/blob/_shared/base_client.py | 2 +- .../_data_lake_directory_client.py | 124 +++++++++-------- .../filedatalake/_data_lake_file_client.py | 59 ++++---- .../storage/filedatalake/_data_lake_lease.py | 20 +-- .../filedatalake/_data_lake_service_client.py | 27 ++-- .../filedatalake/_file_system_client.py | 105 +++++++------- .../storage/filedatalake/_path_client.py | 129 ++++++++++-------- .../filedatalake/_shared/base_client.py | 2 +- .../aio/_data_lake_directory_client_async.py | 34 ++--- .../aio/_data_lake_file_client_async.py | 43 +++--- .../aio/_data_lake_lease_async.py | 20 +-- .../aio/_data_lake_service_client_async.py | 18 +-- .../aio/_file_system_client_async.py | 105 +++++++------- .../filedatalake/aio/_path_client_async.py | 51 +++---- .../storage/fileshare/_shared/base_client.py | 2 +- .../storage/queue/_shared/base_client.py | 2 +- 16 files changed, 399 insertions(+), 344 deletions(-) diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py index 65cf9ea3361f..f566f4ba1291 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py @@ -63,7 +63,7 @@ "blob": {"primary": "BlobEndpoint", "secondary": "BlobSecondaryEndpoint"}, "queue": {"primary": "QueueEndpoint", "secondary": "QueueSecondaryEndpoint"}, "file": {"primary": "FileEndpoint", "secondary": "FileSecondaryEndpoint"}, - "dfs": {"primary": "BlobEndpoint", "secondary": "BlobSecondaryEndpoint"}, + "dfs": {"primary": "BlobEndpoint", "secondary": "BlobEndpoint"}, } diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py index 40cab2cd2af8..eebc38047f9c 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_directory_client.py @@ -75,9 +75,11 @@ def from_connection_string( :param str conn_str: A connection string to an Azure Storage account. - :param file_system_name: The name of file system to interact with. + :param file_system_name: + The name of file system to interact with. :type file_system_name: str - :param directory_name: The name of directory to interact with. The directory is under file system. + :param directory_name: + The name of directory to interact with. The directory is under file system. :type directory_name: str :param credential: The credentials with which to authenticate. This is optional if the @@ -88,9 +90,7 @@ def from_connection_string( :return a DataLakeDirectoryClient :rtype ~azure.storage.filedatalake.DataLakeDirectoryClient """ - account_url, secondary, credential = parse_connection_str(conn_str, credential, 'dfs') - if 'secondary_hostname' not in kwargs: - kwargs['secondary_hostname'] = secondary + account_url, _, credential = parse_connection_str(conn_str, credential, 'dfs') return cls( account_url, file_system_name=file_system_name, directory_name=directory_name, credential=credential, **kwargs) @@ -105,25 +105,27 @@ def create_directory(self, content_settings=None, # type: Optional[ContentSetti :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) :keyword lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword str permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword str permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -153,9 +155,9 @@ def delete_directory(self, **kwargs): Marks the specified directory for deletion. :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.blob.LeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -187,7 +189,7 @@ def get_directory_properties(self, **kwargs): :keyword lease: Required if the directory or file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -227,31 +229,35 @@ def rename_directory(self, new_name, # type: str """ Rename the source directory. - :param str new_name: the new directory name the user want to rename to. + :param str new_name: + the new directory name the user want to rename to. The value must have the following format: "{filesystem}/{directory}/{subdirectory}". - :keyword source_lease: A lease ID for the source path. If specified, - the source path must have an active lease and the leaase ID must - match. - :keyword source_lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str - :param ~azure.storage.filedatalake.ContentSettings content_settings: + :keyword source_lease: + A lease ID for the source path. If specified, + the source path must have an active lease and the leaase ID must + match. + :paramtype source_lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :type permissions: str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. @@ -298,7 +304,7 @@ def rename_directory(self, new_name, # type: str new_directory_client = DataLakeDirectoryClient( self.url, new_file_system, directory_name=path, credential=self._raw_credential, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, require_encryption=self.require_encryption, + require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function) new_directory_client._rename_path('/'+self.file_system_name+'/'+self.path_name, # pylint: disable=protected-access @@ -320,24 +326,27 @@ def create_sub_directory(self, sub_directory, # type: Union[DirectoryProperties :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) - :keyword ~azure.storage.filedatalake.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword str permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword str permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -374,9 +383,9 @@ def delete_sub_directory(self, sub_directory, # type: Union[DirectoryProperties or an instance of DirectoryProperties. :type sub_directory: str or ~azure.storage.filedatalake.DirectoryProperties :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.blob.LeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -415,24 +424,27 @@ def create_file(self, file, # type: Union[FileProperties, str] :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :keyword metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) - :keyword ~azure.storage.filedatalake.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword str permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword str permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -489,7 +501,7 @@ def get_file_client(self, file # type: Union[FileProperties, str] return DataLakeFileClient( self.url, self.file_system_name, file_path=file_path, credential=self._raw_credential, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, require_encryption=self.require_encryption, + require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function) @@ -524,6 +536,6 @@ def get_sub_directory_client(self, sub_directory # type: Union[DirectoryPropert return DataLakeDirectoryClient( self.url, self.file_system_name, directory_name=subdir_path, credential=self._raw_credential, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, require_encryption=self.require_encryption, + require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py index 74ccfb5d475d..8f89b2dda23c 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py @@ -97,9 +97,7 @@ def from_connection_string( :return a DataLakeFileClient :rtype ~azure.storage.filedatalake.DataLakeFileClient """ - account_url, secondary, credential = parse_connection_str(conn_str, credential, 'dfs') - if 'secondary_hostname' not in kwargs: - kwargs['secondary_hostname'] = secondary + account_url, _, credential = parse_connection_str(conn_str, credential, 'dfs') return cls( account_url, file_system_name=file_system_name, file_path=file_path, credential=credential, **kwargs) @@ -114,24 +112,27 @@ def create_file(self, content_settings=None, # type: Optional[ContentSettings] :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) - :keyword ~azure.storage.filedatalake.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword str permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword str permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -161,9 +162,9 @@ def delete_file(self, **kwargs): Marks the specified file for deletion. :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.blob.LeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -375,11 +376,11 @@ def append_data(self, data, # type: Union[AnyStr, Iterable[AnyStr], IO[AnyStr]] with the hash that was sent. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. Note that this MD5 hash is not stored with the - blob. + file. :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :return: dict of the response header """ options = self._append_data_options( @@ -489,9 +490,9 @@ def read_file(self, offset=None, # type: Optional[int] :param int stream: User provided stream to write the downloaded data into. :keyword lease: - If specified, download_blob only succeeds if the blob's lease is active - and matches this ID. Required if the blob has an active lease. - :type lease: ~azure.storage.blob.LeaseClient or str + If specified, download only succeeds if the file's lease is active + and matches this ID. Required if the file has an active lease. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -550,19 +551,21 @@ def rename_file(self, new_name, # type: str Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :type permissions: str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_lease.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_lease.py index 04505167af84..10762258a15a 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_lease.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_lease.py @@ -70,8 +70,8 @@ def acquire(self, lease_duration=-1, **kwargs): # type: (int, Optional[int], **Any) -> None """Requests a new lease. - If the container does not have an active lease, the Blob service creates a - lease on the container and returns a new lease ID. + If the file/file system does not have an active lease, the DataLake service creates a + lease on the file/file system and returns a new lease ID. :param int lease_duration: Specifies the duration of the lease, in seconds, or negative one @@ -107,9 +107,9 @@ def renew(self, **kwargs): """Renews the lease. The lease can be renewed if the lease ID specified in the - lease client matches that associated with the container or blob. Note that - the lease may be renewed even if it has expired as long as the container - or blob has not been leased again since the expiration of that lease. When you + lease client matches that associated with the file system or file. Note that + the lease may be renewed even if it has expired as long as the file system + or file has not been leased again since the expiration of that lease. When you renew a lease, the lease duration clock resets. :keyword ~datetime.datetime if_modified_since: @@ -141,8 +141,8 @@ def release(self, **kwargs): """Release the lease. The lease may be released if the client lease id specified matches - that associated with the container or blob. Releasing the lease allows another client - to immediately acquire the lease for the container or blob as soon as the release is complete. + that associated with the file system or file. Releasing the lease allows another client + to immediately acquire the lease for the file system or file as soon as the release is complete. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. @@ -173,7 +173,7 @@ def change(self, proposed_lease_id, **kwargs): """Change the lease ID of an active lease. :param str proposed_lease_id: - Proposed lease ID, in a GUID string format. The Blob service returns 400 + Proposed lease ID, in a GUID string format. The DataLake service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. @@ -201,12 +201,12 @@ def change(self, proposed_lease_id, **kwargs): def break_lease(self, lease_break_period=None, **kwargs): # type: (Optional[int], Any) -> int - """Break the lease, if the container or blob has an active lease. + """Break the lease, if the file system or file has an active lease. Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not required to specify a matching lease ID. When a lease is broken, the lease break period is allowed to elapse, during which time - no lease operation except break and release can be performed on the container or blob. + no lease operation except break and release can be performed on the file system or file. When a lease is successfully broken, the response indicates the interval in seconds until a new lease can be acquired. diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py index f3f91544aaf4..8b8a0acc405a 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_service_client.py @@ -16,7 +16,7 @@ from ._file_system_client import FileSystemClient from ._data_lake_directory_client import DataLakeDirectoryClient from ._data_lake_file_client import DataLakeFileClient -from ._models import UserDelegationKey, FileSystemPropertiesPaged +from ._models import UserDelegationKey, FileSystemPropertiesPaged, LocationMode from ._serialize import convert_dfs_url_to_blob_url @@ -29,8 +29,7 @@ class DataLakeServiceClient(StorageAccountHostsMixin): can also be retrieved using the `get_client` functions. :ivar str url: - The full endpoint URL to the datalake service endpoint. This could be either the - primary endpoint, or the secondary endpoint depending on the current `location_mode`. + The full endpoint URL to the datalake service endpoint. :ivar str primary_endpoint: The full primary endpoint URL. :ivar str primary_hostname: @@ -80,16 +79,18 @@ def __init__( blob_account_url = convert_dfs_url_to_blob_url(account_url) self._blob_account_url = blob_account_url self._blob_service_client = BlobServiceClient(blob_account_url, credential, **kwargs) + self._blob_service_client._hosts[LocationMode.SECONDARY] = "" #pylint: disable=protected-access _, sas_token = parse_query(parsed_url.query) self._query_str, self._raw_credential = self._format_query_string(sas_token, credential) super(DataLakeServiceClient, self).__init__(parsed_url, service='dfs', credential=self._raw_credential, **kwargs) + # ADLS doesn't support secondary endpoint, make sure it's empty + self._hosts[LocationMode.SECONDARY] = "" def _format_url(self, hostname): - """Format the endpoint URL according to the current location - mode hostname. + """Format the endpoint URL according to hostname """ formated_url = "{}://{}/{}".format(self.scheme, hostname, self._query_str) return formated_url @@ -114,9 +115,7 @@ def from_connection_string( :return a DataLakeServiceClient :rtype ~azure.storage.filedatalake.DataLakeServiceClient """ - account_url, secondary, credential = parse_connection_str(conn_str, credential, 'dfs') - if 'secondary_hostname' not in kwargs: - kwargs['secondary_hostname'] = secondary + account_url, _, credential = parse_connection_str(conn_str, credential, 'dfs') return cls(account_url, credential=credential, **kwargs) def get_user_delegation_key(self, key_start_time, # type: datetime @@ -191,7 +190,8 @@ def create_file_system(self, file_system, # type: Union[FileSystemProperties, s be raised. This method returns a client with which to interact with the newly created file system. - :param str file_system: The name of the file system to create. + :param str file_system: + The name of the file system to create. :param metadata: A dict with name-value pairs to associate with the file system as metadata. Example: `{'Category':'test'}` @@ -228,10 +228,11 @@ def delete_file_system(self, file_system, # type: Union[FileSystemProperties, s The file system to delete. This can either be the name of the file system, or an instance of FileSystemProperties. :type file_system: str or ~azure.storage.filedatalake.FileSystemProperties - :keyword ~azure.storage.filedatalake.DataLakeLeaseClient lease: + :keyword lease: If specified, delete_file_system only succeeds if the file system's lease is active and matches this ID. Required if the file system has an active lease. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -290,7 +291,7 @@ def get_file_system_client(self, file_system # type: Union[FileSystemProperties :caption: Getting the file system client to interact with a specific file system. """ return FileSystemClient(self.url, file_system, credential=self._raw_credential, _configuration=self._config, - _pipeline=self._pipeline, _location_mode=self._location_mode, _hosts=self._hosts, + _pipeline=self._pipeline, _hosts=self._hosts, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function) @@ -325,7 +326,7 @@ def get_directory_client(self, file_system, # type: Union[FileSystemProperties, return DataLakeDirectoryClient(self.url, file_system, directory_name=directory, credential=self._raw_credential, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, _hosts=self._hosts, + _hosts=self._hosts, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function @@ -367,6 +368,6 @@ def get_file_client(self, file_system, # type: Union[FileSystemProperties, str] return DataLakeFileClient( self.url, file_system, file_path=file_path, credential=self._raw_credential, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, require_encryption=self.require_encryption, + require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py index 3e304a0ee399..95ca7b967aa9 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_file_system_client.py @@ -89,9 +89,7 @@ def __init__( blob_hosts = None if datalake_hosts: blob_primary_account_url = convert_dfs_url_to_blob_url(datalake_hosts[LocationMode.PRIMARY]) - blob_secondary_account_url = convert_dfs_url_to_blob_url(datalake_hosts[LocationMode.SECONDARY]) - blob_hosts = {LocationMode.PRIMARY: blob_primary_account_url, - LocationMode.SECONDARY: blob_secondary_account_url} + blob_hosts = {LocationMode.PRIMARY: blob_primary_account_url, LocationMode.SECONDARY: ""} self._container_client = ContainerClient(blob_account_url, file_system_name, credential=credential, _hosts=blob_hosts, **kwargs) @@ -101,6 +99,8 @@ def __init__( super(FileSystemClient, self).__init__(parsed_url, service='dfs', credential=self._raw_credential, _hosts=datalake_hosts, **kwargs) + # ADLS doesn't support secondary endpoint, make sure it's empty + self._hosts[LocationMode.SECONDARY] = "" self._client = DataLakeStorageClient(self.url, file_system_name, None, pipeline=self._pipeline) def _format_url(self, hostname): @@ -136,9 +136,7 @@ def from_connection_string( :return a FileSystemClient :rtype ~azure.storage.filedatalake.FileSystemClient """ - account_url, secondary, credential = parse_connection_str(conn_str, credential, 'dfs') - if 'secondary_hostname' not in kwargs: - kwargs['secondary_hostname'] = secondary + account_url, _, credential = parse_connection_str(conn_str, credential, 'dfs') return cls( account_url, file_system_name=file_system_name, credential=credential, **kwargs) @@ -211,7 +209,7 @@ def create_file_system(self, metadata=None, # type: Optional[Dict[str, str]] file system as metadata. Example: `{'Category':'test'}` :type metadata: dict(str, str) :param public_access: - To specify whether data in the container may be accessed publicly and the level of access. + To specify whether data in the file system may be accessed publicly and the level of access. :type public_access: ~azure.storage.filedatalake.PublicAccess :keyword int timeout: The timeout parameter is expressed in seconds. @@ -334,7 +332,7 @@ def set_file_system_metadata( # type: ignore The match condition to use upon the etag. :keyword int timeout: The timeout parameter is expressed in seconds. - :returns: file system-updated property dict (Etag and last modified). + :returns: filesystem-updated property dict (Etag and last modified). .. admonition:: Example: @@ -354,17 +352,17 @@ def set_file_system_access_policy( ): # type: (...) -> Dict[str, Union[str, datetime]] """Sets the permissions for the specified file system or stored access policies that may be used with Shared Access Signatures. The permissions - indicate whether blobs in a container may be accessed publicly. + indicate whether files in a file system may be accessed publicly. :param signed_identifiers: - A dictionary of access policies to associate with the container. The + A dictionary of access policies to associate with the file system. The dictionary may contain up to 5 elements. An empty dictionary will clear the access policies set on the service. :type signed_identifiers: dict[str, ~azure.storage.filedatalake.AccessPolicy] :param ~azure.storage.filedatalake.PublicAccess public_access: - To specify whether data in the container may be accessed publicly and the level of access. + To specify whether data in the file system may be accessed publicly and the level of access. :keyword lease: - Required if the container has an active lease. Value can be a DataLakeLeaseClient object + Required if the file system has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: @@ -381,7 +379,7 @@ def set_file_system_access_policy( the resource has not been modified since the specified date/time. :keyword int timeout: The timeout parameter is expressed in seconds. - :returns: Container-updated property dict (Etag and last modified). + :returns: File System-updated property dict (Etag and last modified). :rtype: dict[str, str or ~datetime.datetime] """ return self._container_client.set_container_access_policy(signed_identifiers, @@ -393,9 +391,9 @@ def get_file_system_access_policy(self, **kwargs): The permissions indicate whether file system data may be accessed publicly. :keyword lease: - If specified, get_container_access_policy only succeeds if the - container's lease is active and matches this ID. - :paramtype lease: ~azure.storage.blob.BlobLeaseClient or str + If specified, the operation only succeeds if the + file system's lease is active and matches this ID. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Access policy information in a dict. @@ -421,14 +419,15 @@ def get_paths(self, path=None, # type: Optional[str] :param int max_results: An optional value that specifies the maximum number of items to return per page. If omitted or greater than 5,000, the response will include up to 5,000 items per page. - :keyword upn: Optional. Valid only when Hierarchical Namespace is - enabled for the account. If "true", the user identity values returned - in the x-ms-owner, x-ms-group, and x-ms-acl response headers will be - transformed from Azure Active Directory Object IDs to User Principal - Names. If "false", the values will be returned as Azure Active - Directory Object IDs. The default value is false. Note that group and - application Object IDs are not translated because they do not have - unique friendly names. + :keyword upn: + Optional. Valid only when Hierarchical Namespace is + enabled for the account. If "true", the user identity values returned + in the x-ms-owner, x-ms-group, and x-ms-acl response headers will be + transformed from Azure Active Directory Object IDs to User Principal + Names. If "false", the values will be returned as Azure Active + Directory Object IDs. The default value is false. Note that group and + application Object IDs are not translated because they do not have + unique friendly names. :type upn: bool :keyword int timeout: The timeout parameter is expressed in seconds. @@ -466,26 +465,29 @@ def create_directory(self, directory, # type: Union[DirectoryProperties, str] or an instance of DirectoryProperties. :type directory: str or ~azure.storage.filedatalake.DirectoryProperties :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. - :keyword ~azure.storage.filedatalake.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword str permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword str permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -522,9 +524,9 @@ def delete_directory(self, directory, # type: Union[DirectoryProperties, str] or an instance of DirectoryProperties. :type directory: str or ~azure.storage.filedatalake.DirectoryProperties :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -563,24 +565,27 @@ def create_file(self, file, # type: Union[FileProperties, str] :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) - :keyword ~azure.storage.filedatalake.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword str permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword str permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -618,9 +623,9 @@ def delete_file(self, file, # type: Union[FileProperties, str] or an instance of FileProperties. :type file: str or ~azure.storage.filedatalake.FileProperties :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -681,7 +686,7 @@ def get_directory_client(self, directory # type: Union[DirectoryProperties, str return DataLakeDirectoryClient(self.url, self.file_system_name, directory_name=directory, credential=self._raw_credential, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, _hosts=self._hosts, + _hosts=self._hosts, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function @@ -718,6 +723,6 @@ def get_file_client(self, file_path # type: Union[FileProperties, str] return DataLakeFileClient( self.url, self.file_system_name, file_path=file_path, credential=self._raw_credential, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, require_encryption=self.require_encryption, + require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py index 073737da2448..fc2ffaf27287 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_path_client.py @@ -53,7 +53,7 @@ def __init__( path_name = path_name.strip('/') if not (file_system_name and path_name): - raise ValueError("Please specify a container name and blob name.") + raise ValueError("Please specify a file system name and file path.") if not parsed_url.netloc: raise ValueError("Invalid URL: {}".format(account_url)) @@ -64,9 +64,7 @@ def __init__( blob_hosts = None if datalake_hosts: blob_primary_account_url = convert_dfs_url_to_blob_url(datalake_hosts[LocationMode.PRIMARY]) - blob_secondary_account_url = convert_dfs_url_to_blob_url(datalake_hosts[LocationMode.SECONDARY]) - blob_hosts = {LocationMode.PRIMARY: blob_primary_account_url, - LocationMode.SECONDARY: blob_secondary_account_url} + blob_hosts = {LocationMode.PRIMARY: blob_primary_account_url, LocationMode.SECONDARY: ""} self._blob_client = BlobClient(blob_account_url, file_system_name, path_name, credential=credential, _hosts=blob_hosts, **kwargs) @@ -78,6 +76,8 @@ def __init__( super(PathClient, self).__init__(parsed_url, service='dfs', credential=self._raw_credential, _hosts=datalake_hosts, **kwargs) + # ADLS doesn't support secondary endpoint, make sure it's empty + self._hosts[LocationMode.SECONDARY] = "" self._client = DataLakeStorageClient(self.url, file_system_name, path_name, pipeline=self._pipeline) def _format_url(self, hostname): @@ -121,9 +121,10 @@ def _create(self, resource_type, content_settings=None, metadata=None, **kwargs) """ Create directory or file - :param resource_type: Required for Create File and Create Directory. - The value must be "file" or "directory". Possible values include: - 'directory', 'file' + :param resource_type: + Required for Create File and Create Directory. + The value must be "file" or "directory". Possible values include: + 'directory', 'file' :type resource_type: str :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. @@ -133,20 +134,22 @@ def _create(self, resource_type, content_settings=None, metadata=None, **kwargs) :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :type permissions: str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. @@ -258,29 +261,33 @@ def set_access_control(self, owner=None, # type: Optional[str] """ Set the owner, group, permissions, or access control list for a path. - :param owner: Optional. The owner of the file or directory. + :param owner: + Optional. The owner of the file or directory. :type owner: str - :param group: Optional. The owning group of the file or directory. + :param group: + Optional. The owning group of the file or directory. :type group: str - :param permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. - permissions and acl are mutually exclusive. + :param permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. + permissions and acl are mutually exclusive. :type permissions: str - :param acl: Sets POSIX access control rights on files and directories. - The value is a comma-separated list of access control entries. Each - access control entry (ACE) consists of a scope, a type, a user or - group identifier, and permissions in the format - "[scope:][type]:[id]:[permissions]". - permissions and acl are mutually exclusive. + :param acl: + Sets POSIX access control rights on files and directories. + The value is a comma-separated list of access control entries. Each + access control entry (ACE) consists of a scope, a type, a user or + group identifier, and permissions in the format + "[scope:][type]:[id]:[permissions]". + permissions and acl are mutually exclusive. :type acl: str :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -330,19 +337,20 @@ def get_access_control(self, upn=None, # type: Optional[bool] **kwargs): # type: (...) -> Dict[str, Any] """ - :param upn: Optional. Valid only when Hierarchical Namespace is - enabled for the account. If "true", the user identity values returned - in the x-ms-owner, x-ms-group, and x-ms-acl response headers will be - transformed from Azure Active Directory Object IDs to User Principal - Names. If "false", the values will be returned as Azure Active - Directory Object IDs. The default value is false. Note that group and - application Object IDs are not translated because they do not have - unique friendly names. + :param upn: Optional. + Valid only when Hierarchical Namespace is + enabled for the account. If "true", the user identity values returned + in the x-ms-owner, x-ms-group, and x-ms-acl response headers will be + transformed from Azure Active Directory Object IDs to User Principal + Names. If "false", the values will be returned as Azure Active + Directory Object IDs. The default value is false. Note that group and + application Object IDs are not translated because they do not have + unique friendly names. :type upn: bool :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -406,39 +414,41 @@ def _rename_path(self, rename_source, """ Rename directory or file - :param rename_source: The value must have the following format: "/{filesystem}/{path}". + :param rename_source: + The value must have the following format: "/{filesystem}/{path}". :type rename_source: str - :param source_lease: A lease ID for the source path. If specified, - the source path must have an active lease and the leaase ID must - match. - :type source_lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str - :param ~azure.storage.filedatalake.ContentSettings content_settings: + :keyword source_lease: + A lease ID for the source path. If specified, + the source path must have an active lease and the leaase ID must + match. + :paramtype source_lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. - :param lease: + :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str - :param str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :param permissions: Optional and only valid if Hierarchical Namespace + :keyword permissions: Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. :type permissions: str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. @@ -449,13 +459,13 @@ def _rename_path(self, rename_source, and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :param ~datetime.datetime source_if_modified_since: + :keyword ~datetime.datetime source_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime source_if_unmodified_since: + :keyword ~datetime.datetime source_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. @@ -466,9 +476,8 @@ def _rename_path(self, rename_source, and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions source_match_condition: The source match condition to use upon the etag. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :return: """ options = self._rename_path_options( rename_source, @@ -486,7 +495,7 @@ def _get_path_properties(self, **kwargs): :keyword lease: Required if the directory or file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -533,9 +542,10 @@ def set_metadata(self, metadata=None, # type: Optional[Dict[str, str]] A dict containing name-value pairs to associate with the file system as metadata. Example: {'category':'test'} :type metadata: dict[str, str] - :keyword str or ~azure.storage.filedatalake.DataLakeLeaseClient lease: + :keyword lease: If specified, set_file_system_metadata only succeeds if the file system's lease is active and matches this ID. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -577,9 +587,10 @@ def set_http_headers(self, content_settings=None, # type: Optional[ContentSetti :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set file/directory properties. - :keyword str or ~azure.storage.filedatalake.DataLakeLeaseClient lease: + :keyword lease: If specified, set_file_system_metadata only succeeds if the file system's lease is active and matches this ID. + :paramtype lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py index 75b72a76ca91..8b65417e9a9a 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py @@ -63,7 +63,7 @@ "blob": {"primary": "BlobEndpoint", "secondary": "BlobSecondaryEndpoint"}, "queue": {"primary": "QueueEndpoint", "secondary": "QueueSecondaryEndpoint"}, "file": {"primary": "FileEndpoint", "secondary": "FileSecondaryEndpoint"}, - "dfs": {"primary": "BlobEndpoint", "secondary": "BlobSecondaryEndpoint"}, + "dfs": {"primary": "BlobEndpoint", "secondary": "BlobEndpoint"}, } diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py index 106432c0250b..b2e3c11a5a69 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_directory_client_async.py @@ -73,10 +73,10 @@ async def create_directory(self, content_settings=None, # type: Optional[Conten :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the directory as metadata. :type metadata: dict(str, str) :keyword lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + Required if the directory has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword str umask: @@ -123,9 +123,9 @@ async def delete_directory(self, **kwargs): Marks the specified directory for deletion. :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.blob.LeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -157,7 +157,7 @@ async def get_directory_properties(self, **kwargs): :keyword lease: Required if the directory or file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -204,13 +204,13 @@ async def rename_directory(self, new_name, # type: str A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match. - :keyword source_lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str - :param ~azure.storage.filedatalake.ContentSettings content_settings: + :paramtype source_lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, @@ -294,11 +294,12 @@ async def create_sub_directory(self, sub_directory, # type: Union[DirectoryProp :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) - :keyword ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, @@ -350,9 +351,9 @@ async def delete_sub_directory(self, sub_directory, # type: Union[DirectoryProp or an instance of DirectoryProperties. :type sub_directory: str or ~azure.storage.filedatalake.DirectoryProperties :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.blob.LeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -391,11 +392,12 @@ async def create_file(self, file, # type: Union[FileProperties, str] :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :keyword metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) - :keyword ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py index 8264dd5ba9f7..4087a152a318 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py @@ -74,19 +74,22 @@ async def create_file(self, content_settings=None, # type: Optional[ContentSett :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) - :keyword ~azure.storage.filedatalake.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword str permissions: Optional and only valid if Hierarchical Namespace + :keyword str permissions: + Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. @@ -121,9 +124,9 @@ async def delete_file(self, **kwargs): Marks the specified file for deletion. :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.blob.LeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -155,7 +158,7 @@ async def get_file_properties(self, **kwargs): :keyword lease: Required if the directory or file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -265,11 +268,11 @@ async def append_data(self, data, # type: Union[AnyStr, Iterable[AnyStr], IO[An with the hash that was sent. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. Note that this MD5 hash is not stored with the - blob. + file. :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :return: dict of the response header """ options = self._append_data_options( @@ -355,9 +358,9 @@ async def read_file(self, offset=None, # type: Optional[int] :param int stream: User provided stream to write the downloaded data into. :keyword lease: - If specified, download_blob only succeeds if the blob's lease is active - and matches this ID. Required if the blob has an active lease. - :type lease: ~azure.storage.blob.LeaseClient or str + If specified, download only succeeds if the file's lease is active + and matches this ID. Required if the file has an active lease. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -409,21 +412,23 @@ async def rename_file(self, new_name, # type: str :keyword source_lease: A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match. - :keyword source_lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str - :param ~azure.storage.filedatalake.ContentSettings content_settings: + :paramtype source_lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword permissions: Optional and only valid if Hierarchical Namespace + :keyword permissions: + Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_lease_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_lease_async.py index 411c9ee141c1..cadf7bc0c396 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_lease_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_lease_async.py @@ -72,8 +72,8 @@ async def acquire(self, lease_duration=-1, **kwargs): # type: (int, Optional[int], **Any) -> None """Requests a new lease. - If the container does not have an active lease, the Blob service creates a - lease on the container and returns a new lease ID. + If the file/file system does not have an active lease, the DataLake service creates a + lease on the file/file system and returns a new lease ID. :param int lease_duration: Specifies the duration of the lease, in seconds, or negative one @@ -109,9 +109,9 @@ async def renew(self, **kwargs): """Renews the lease. The lease can be renewed if the lease ID specified in the - lease client matches that associated with the container or blob. Note that - the lease may be renewed even if it has expired as long as the container - or blob has not been leased again since the expiration of that lease. When you + lease client matches that associated with the file system or file. Note that + the lease may be renewed even if it has expired as long as the file system + or file has not been leased again since the expiration of that lease. When you renew a lease, the lease duration clock resets. :keyword ~datetime.datetime if_modified_since: @@ -143,8 +143,8 @@ async def release(self, **kwargs): """Release the lease. The lease may be released if the client lease id specified matches - that associated with the container or blob. Releasing the lease allows another client - to immediately acquire the lease for the container or blob as soon as the release is complete. + that associated with the file system or file. Releasing the lease allows another client + to immediately acquire the lease for the file system or file as soon as the release is complete. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. @@ -175,7 +175,7 @@ async def change(self, proposed_lease_id, **kwargs): """Change the lease ID of an active lease. :param str proposed_lease_id: - Proposed lease ID, in a GUID string format. The Blob service returns 400 + Proposed lease ID, in a GUID string format. The DataLake service returns 400 (Invalid request) if the proposed lease ID is not in the correct format. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. @@ -203,12 +203,12 @@ async def change(self, proposed_lease_id, **kwargs): async def break_lease(self, lease_break_period=None, **kwargs): # type: (Optional[int], Any) -> int - """Break the lease, if the container or blob has an active lease. + """Break the lease, if the file system or file has an active lease. Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not required to specify a matching lease ID. When a lease is broken, the lease break period is allowed to elapse, during which time - no lease operation except break and release can be performed on the container or blob. + no lease operation except break and release can be performed on the file system or file. When a lease is successfully broken, the response indicates the interval in seconds until a new lease can be acquired. diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py index e0ef6b186c55..a2580d19bcb6 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_service_client_async.py @@ -14,7 +14,7 @@ from ._data_lake_directory_client_async import DataLakeDirectoryClient from ._data_lake_file_client_async import DataLakeFileClient from ._models import FileSystemPropertiesPaged -from .._models import UserDelegationKey +from .._models import UserDelegationKey, LocationMode class DataLakeServiceClient(AsyncStorageAccountHostsMixin, DataLakeServiceClientBase): @@ -26,8 +26,7 @@ class DataLakeServiceClient(AsyncStorageAccountHostsMixin, DataLakeServiceClient can also be retrieved using the `get_client` functions. :ivar str url: - The full endpoint URL to the datalake service endpoint. This could be either the - primary endpoint, or the secondary endpoint depending on the current `location_mode`. + The full endpoint URL to the datalake service endpoint. :ivar str primary_endpoint: The full primary endpoint URL. :ivar str primary_hostname: @@ -72,6 +71,7 @@ def __init__( **kwargs ) self._blob_service_client = BlobServiceClient(self._blob_account_url, credential, **kwargs) + self._blob_service_client._hosts[LocationMode.SECONDARY] = "" #pylint: disable=protected-access self._client = DataLakeStorageClient(self.url, None, None, pipeline=self._pipeline) self._loop = kwargs.get('loop', None) @@ -148,7 +148,8 @@ async def create_file_system(self, file_system, # type: Union[FileSystemPropert be raised. This method returns a client with which to interact with the newly created file system. - :param str file_system: The name of the file system to create. + :param str file_system: + The name of the file system to create. :param metadata: A dict with name-value pairs to associate with the file system as metadata. Example: `{'Category':'test'}` @@ -185,10 +186,11 @@ async def delete_file_system(self, file_system, # type: Union[FileSystemPropert The file system to delete. This can either be the name of the file system, or an instance of FileSystemProperties. :type file_system: str or ~azure.storage.filedatalake.FileSystemProperties - :keyword ~azure.storage.filedatalake.aio.DataLakeLeaseClient lease: + :keyword lease: If specified, delete_file_system only succeeds if the file system's lease is active and matches this ID. Required if the file system has an active lease. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -247,7 +249,7 @@ def get_file_system_client(self, file_system # type: Union[FileSystemProperties :caption: Getting the file system client to interact with a specific file system. """ return FileSystemClient(self.url, file_system, credential=self._raw_credential, _configuration=self._config, - _pipeline=self._pipeline, _location_mode=self._location_mode, _hosts=self._hosts, + _pipeline=self._pipeline, _hosts=self._hosts, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function) @@ -282,7 +284,7 @@ def get_directory_client(self, file_system, # type: Union[FileSystemProperties, return DataLakeDirectoryClient(self.url, file_system, directory_name=directory, credential=self._raw_credential, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, _hosts=self._hosts, + _hosts=self._hosts, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function @@ -324,6 +326,6 @@ def get_file_client(self, file_system, # type: Union[FileSystemProperties, str] return DataLakeFileClient( self.url, file_system, file_path=file_path, credential=self._raw_credential, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, require_encryption=self.require_encryption, + require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py index 46b4238e189c..10b8eb56c6d9 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_file_system_client_async.py @@ -164,7 +164,7 @@ async def create_file_system(self, metadata=None, # type: Optional[Dict[str, st file system as metadata. Example: `{'Category':'test'}` :type metadata: dict(str, str) :param public_access: - To specify whether data in the container may be accessed publicly and the level of access. + To specify whether data in the file system may be accessed publicly and the level of access. :type public_access: ~azure.storage.filedatalake.PublicAccess :keyword int timeout: The timeout parameter is expressed in seconds. @@ -190,10 +190,11 @@ async def delete_file_system(self, **kwargs): The file system and any files contained within it are later deleted during garbage collection. If the file system is not found, a ResourceNotFoundError will be raised. - :keyword str or ~azure.storage.filedatalake.aio.DataLakeLeaseClient lease: + :keyword lease: If specified, delete_file_system only succeeds if the file system's lease is active and matches this ID. Required if the file system has an active lease. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -231,9 +232,10 @@ async def get_file_system_properties(self, **kwargs): """Returns all user-defined metadata and system properties for the specified file system. The data returned does not include the file system's list of paths. - :keyword str or ~azure.storage.filedatalake.aio.DataLakeLeaseClient lease: + :keyword lease: If specified, get_file_system_properties only succeeds if the file system's lease is active and matches this ID. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword int timeout: The timeout parameter is expressed in seconds. :return: Properties for the specified file system within a file system object. @@ -265,9 +267,10 @@ async def set_file_system_metadata( # type: ignore A dict containing name-value pairs to associate with the file system as metadata. Example: {'category':'test'} :type metadata: dict[str, str] - :keyword str or ~azure.storage.filedatalake.aio.DataLakeLeaseClient lease: + :keyword lease: If specified, set_file_system_metadata only succeeds if the file system's lease is active and matches this ID. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -307,17 +310,17 @@ async def set_file_system_access_policy( ): # type: (...) -> Dict[str, Union[str, datetime]] """Sets the permissions for the specified file system or stored access policies that may be used with Shared Access Signatures. The permissions - indicate whether blobs in a container may be accessed publicly. + indicate whether files in a file system may be accessed publicly. :param signed_identifiers: - A dictionary of access policies to associate with the container. The + A dictionary of access policies to associate with the file system. The dictionary may contain up to 5 elements. An empty dictionary will clear the access policies set on the service. :type signed_identifiers: dict[str, ~azure.storage.filedatalake.AccessPolicy] :param ~azure.storage.filedatalake.PublicAccess public_access: - To specify whether data in the container may be accessed publicly and the level of access. + To specify whether data in the file system may be accessed publicly and the level of access. :keyword lease: - Required if the container has an active lease. Value can be a DataLakeLeaseClient object + Required if the file system has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: @@ -334,7 +337,7 @@ async def set_file_system_access_policy( the resource has not been modified since the specified date/time. :keyword int timeout: The timeout parameter is expressed in seconds. - :returns: Container-updated property dict (Etag and last modified). + :returns: filesystem-updated property dict (Etag and last modified). :rtype: dict[str, str or ~datetime.datetime] """ return await self._container_client.set_container_access_policy(signed_identifiers, @@ -346,9 +349,9 @@ async def get_file_system_access_policy(self, **kwargs): The permissions indicate whether file system data may be accessed publicly. :keyword lease: - If specified, get_container_access_policy only succeeds if the - container's lease is active and matches this ID. - :paramtype lease: ~azure.storage.blob.BlobLeaseClient or str + If specified, get_file_system_access_policy only succeeds if the + file system's lease is active and matches this ID. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword int timeout: The timeout parameter is expressed in seconds. :returns: Access policy information in a dict. @@ -371,17 +374,19 @@ def get_paths(self, path=None, # type: Optional[str] :param str path: Filters the results to return only paths under the specified path. - :param int max_results: An optional value that specifies the maximum + :param int max_results: + An optional value that specifies the maximum number of items to return per page. If omitted or greater than 5,000, the response will include up to 5,000 items per page. - :keyword upn: Optional. Valid only when Hierarchical Namespace is - enabled for the account. If "true", the user identity values returned - in the x-ms-owner, x-ms-group, and x-ms-acl response headers will be - transformed from Azure Active Directory Object IDs to User Principal - Names. If "false", the values will be returned as Azure Active - Directory Object IDs. The default value is false. Note that group and - application Object IDs are not translated because they do not have - unique friendly names. + :keyword upn: + Optional. Valid only when Hierarchical Namespace is + enabled for the account. If "true", the user identity values returned + in the x-ms-owner, x-ms-group, and x-ms-acl response headers will be + transformed from Azure Active Directory Object IDs to User Principal + Names. If "false", the values will be returned as Azure Active + Directory Object IDs. The default value is false. Note that group and + application Object IDs are not translated because they do not have + unique friendly names. :type upn: bool :keyword int timeout: The timeout parameter is expressed in seconds. @@ -419,26 +424,29 @@ async def create_directory(self, directory, # type: Union[DirectoryProperties, or an instance of DirectoryProperties. :type directory: str or ~azure.storage.filedatalake.DirectoryProperties :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. - :keyword ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword str permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword str permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -475,9 +483,9 @@ async def delete_directory(self, directory, # type: Union[DirectoryProperties, or an instance of DirectoryProperties. :type directory: str or ~azure.storage.filedatalake.DirectoryProperties :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.blob.LeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -516,24 +524,27 @@ async def create_file(self, file, # type: Union[FileProperties, str] :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. :param metadata: - Name-value pairs associated with the blob as metadata. + Name-value pairs associated with the file as metadata. :type metadata: dict(str, str) - :keyword ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str lease: - Required if the blob has an active lease. Value can be a DataLakeLeaseClient object + :keyword lease: + Required if the file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :keyword str permissions: Optional and only valid if Hierarchical Namespace - is enabled for the account. Sets POSIX access permissions for the file - owner, the file owning group, and others. Each class may be granted - read, write, or execute permission. The sticky bit is also supported. - Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are - supported. + :keyword str permissions: + Optional and only valid if Hierarchical Namespace + is enabled for the account. Sets POSIX access permissions for the file + owner, the file owning group, and others. Each class may be granted + read, write, or execute permission. The sticky bit is also supported. + Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are + supported. :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -571,9 +582,9 @@ async def delete_file(self, file, # type: Union[FileProperties, str] or an instance of FileProperties. :type file: str or ~azure.storage.filedatalake.FileProperties :keyword lease: - Required if the blob has an active lease. Value can be a LeaseClient object + Required if the file has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.blob.LeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -634,7 +645,7 @@ def get_directory_client(self, directory # type: Union[DirectoryProperties, str return DataLakeDirectoryClient(self.url, self.file_system_name, directory_name=directory, credential=self._raw_credential, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, _hosts=self._hosts, + _hosts=self._hosts, require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function, @@ -672,6 +683,6 @@ def get_file_client(self, file_path # type: Union[FileProperties, str] return DataLakeFileClient( self.url, self.file_system_name, file_path=file_path, credential=self._raw_credential, _hosts=self._hosts, _configuration=self._config, _pipeline=self._pipeline, - _location_mode=self._location_mode, require_encryption=self.require_encryption, + require_encryption=self.require_encryption, key_encryption_key=self.key_encryption_key, key_resolver_function=self.key_resolver_function, loop=self._loop) diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py index 56c26caf3b0c..657b5cf15c75 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_path_client_async.py @@ -55,9 +55,9 @@ async def _create(self, resource_type, content_settings=None, metadata=None, **k Name-value pairs associated with the file/directory as metadata. :type metadata: dict(str, str) :keyword lease: - Required if the file/directory has an active lease. Value can be a LeaseClient object + Required if the file/directory has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, @@ -113,14 +113,14 @@ async def _delete(self, **kwargs): :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str - :param ~datetime.datetime if_modified_since: + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. @@ -131,7 +131,7 @@ async def _delete(self, **kwargs): and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. :return: None """ @@ -176,7 +176,7 @@ async def set_access_control(self, owner=None, # type: Optional[str] :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -223,7 +223,7 @@ async def get_access_control(self, upn=None, # type: Optional[bool] :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -259,37 +259,39 @@ async def _rename_path(self, rename_source, :param rename_source: The value must have the following format: "/{filesystem}/{path}". :type rename_source: str - :param source_lease: A lease ID for the source path. If specified, + :keyword source_lease: A lease ID for the source path. If specified, the source path must have an active lease and the leaase ID must match. - :type source_lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str - :param ~azure.storage.filedatalake.ContentSettings content_settings: + :paramtype source_lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :keyword ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set path properties. - :param lease: + :keyword lease: Required if the file/directory has an active lease. Value can be a LeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str - :param str umask: Optional and only valid if Hierarchical Namespace is enabled for the account. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :keyword str umask: + Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766). - :param permissions: Optional and only valid if Hierarchical Namespace + :keyword permissions: + Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. :type permissions: str - :param ~datetime.datetime if_modified_since: + :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime if_unmodified_since: + :keyword ~datetime.datetime if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. @@ -300,13 +302,13 @@ async def _rename_path(self, rename_source, and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions match_condition: The match condition to use upon the etag. - :param ~datetime.datetime source_if_modified_since: + :keyword ~datetime.datetime source_if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. Specify this header to perform the operation only if the resource has been modified since the specified time. - :param ~datetime.datetime source_if_unmodified_since: + :keyword ~datetime.datetime source_if_unmodified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. If a date is passed in without timezone info, it is assumed to be UTC. @@ -317,9 +319,8 @@ async def _rename_path(self, rename_source, and act according to the condition specified by the `match_condition` parameter. :keyword ~azure.core.MatchConditions source_match_condition: The source match condition to use upon the etag. - :param int timeout: + :keyword int timeout: The timeout parameter is expressed in seconds. - :return: """ options = self._rename_path_options( rename_source, @@ -337,7 +338,7 @@ async def _get_path_properties(self, **kwargs): :keyword lease: Required if the directory or file has an active lease. Value can be a DataLakeLeaseClient object or the lease ID as a string. - :type lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -384,9 +385,10 @@ async def set_metadata(self, metadata=None, # type: Optional[Dict[str, str]] A dict containing name-value pairs to associate with the file system as metadata. Example: {'category':'test'} :type metadata: dict[str, str] - :keyword str or ~azure.storage.filedatalake.aio.DataLakeLeaseClient lease: + :keyword lease: If specified, set_file_system_metadata only succeeds if the file system's lease is active and matches this ID. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. @@ -428,9 +430,10 @@ async def set_http_headers(self, content_settings=None, # type: Optional[Conten :param ~azure.storage.filedatalake.ContentSettings content_settings: ContentSettings object used to set file/directory properties. - :keyword str or ~azure.storage.filedatalake.aio.DataLakeLeaseClient lease: + :keyword lease: If specified, set_file_system_metadata only succeeds if the file system's lease is active and matches this ID. + :paramtype lease: ~azure.storage.filedatalake.aio.DataLakeLeaseClient or str :keyword ~datetime.datetime if_modified_since: A DateTime value. Azure expects the date value passed in to be UTC. If timezone is included, any non-UTC datetimes will be converted to UTC. diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py index 75b72a76ca91..8b65417e9a9a 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py @@ -63,7 +63,7 @@ "blob": {"primary": "BlobEndpoint", "secondary": "BlobSecondaryEndpoint"}, "queue": {"primary": "QueueEndpoint", "secondary": "QueueSecondaryEndpoint"}, "file": {"primary": "FileEndpoint", "secondary": "FileSecondaryEndpoint"}, - "dfs": {"primary": "BlobEndpoint", "secondary": "BlobSecondaryEndpoint"}, + "dfs": {"primary": "BlobEndpoint", "secondary": "BlobEndpoint"}, } diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py index 75b72a76ca91..8b65417e9a9a 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py @@ -63,7 +63,7 @@ "blob": {"primary": "BlobEndpoint", "secondary": "BlobSecondaryEndpoint"}, "queue": {"primary": "QueueEndpoint", "secondary": "QueueSecondaryEndpoint"}, "file": {"primary": "FileEndpoint", "secondary": "FileSecondaryEndpoint"}, - "dfs": {"primary": "BlobEndpoint", "secondary": "BlobSecondaryEndpoint"}, + "dfs": {"primary": "BlobEndpoint", "secondary": "BlobEndpoint"}, }