filedatalake package

Packages

aio

Classes

DataLakeServiceClient

A client to interact with the DataLake Service at the account level.

This client provides operations to retrieve and configure the account properties as well as list, create and delete file systems within the account. For operations relating to a specific file system, directory or file, clients for those entities can also be retrieved using the get_client functions.

FileSystemClient

A client to interact with a specific file system, even if that file system may not yet exist.

For operations relating to a specific directory or file within this file system, a directory client or file client can be retrieved using the get_directory_client(directory) or get_file_client(file_path) functions.

DataLakeFileClient

A client to interact with the DataLake file, even if the file may not yet exist.

DataLakeDirectoryClient

A client to interact with the DataLake directory, even if the directory may not yet exist.

For operations relating to a specific subdirectory or file under the directory, a directory client or file client can be retrieved using the get_sub_directory_client(sub_directory) or get_file_client(file) functions.

DataLakeLeaseClient

Creates a new DataLakeLeaseClient.

This client provides lease operations on a FileSystemClient, DataLakeDirectoryClient or DataLakeFileClient.

ExponentialRetry

Exponential retry.

LinearRetry

Linear retry.

LocationMode

Specifies the location the request should be sent to. This mode only applies for RA-GRS accounts which allow secondary read access. All other account types must use PRIMARY.

PublicAccess

Specifies whether data in the file system may be accessed publicly and the level of access.

AccessPolicy

Access Policy class used by the set and get access policy methods in each service.

A stored access policy can specify the start time, expiry time, and permissions for the Shared Access Signatures with which it's associated. Depending on how you want to control access to your resource, you can specify all of these parameters within the stored access policy, and omit them from the URL for the Shared Access Signature. Doing so permits you to modify the associated signature's behavior at any time, as well as to revoke it. Or you can specify one or more of the access policy parameters within the stored access policy, and the others on the URL. Finally, you can specify all of the parameters on the URL. In this case, you can use the stored access policy to revoke the signature, but not to modify its behavior.

Together the Shared Access Signature and the stored access policy must include all fields required to authenticate the signature. If any required fields are missing, the request will fail. Likewise, if a field is specified both in the Shared Access Signature URL and in the stored access policy, the request will fail with status code 400 (Bad Request).

ResourceTypes

Specifies the resource types that are accessible with the account SAS.

StorageErrorCode

An enumeration.

UserDelegationKey

Represents a user delegation key, provided to the user by Azure Storage based on their Azure Active Directory access token.

The fields are saved as simple strings since the user does not have to interact with this object; to generate an identify SAS, the user can simply pass it to the right API.

FileSystemProperties

File System properties class.

Returned FileSystemProperties instances expose these values through a dictionary interface, for example: file_system_props["last_modified"]. Additionally, the file system name is available as file_system_props["name"].

FileSystemPropertiesPaged

An Iterable of File System properties.

DirectoryProperties
PathProperties

Path properties listed by get_paths api.

PathPropertiesPaged

An Iterable of Path properties.

LeaseProperties

DataLake Lease Properties.

ContentSettings

The content settings of a file or directory.

AccountSasPermissions
FileSystemSasPermissions

FileSystemSasPermissions class to be used with the generate_file_system_sas(account_name, file_system_name, credential, permission=None, expiry=None, **kwargs) function.

DirectorySasPermissions

DirectorySasPermissions class to be used with the generate_directory_sas(account_name, file_system_name, directory_name, credential, permission=None, expiry=None, **kwargs) function.

FileSasPermissions

FileSasPermissions class to be used with the generate_file_sas(account_name, file_system_name, directory_name, file_name, credential, permission=None, expiry=None, **kwargs) function.

StorageStreamDownloader

A streaming object to download from Azure Storage.

Functions

generate_account_sas(account_name, account_key, resource_types, permission, expiry, **kwargs)

Generates a shared access signature for the DataLake service.

Use the returned signature as the credential parameter of any DataLakeServiceClient, FileSystemClient, DataLakeDirectoryClient or DataLakeFileClient.

generate_account_sas(account_name, account_key, resource_types, permission, expiry, **kwargs)

Parameters

account_name
str

The storage account name used to generate the shared access signature.

account_key
str

The access key to generate the shared access signature.

resource_types
str or ResourceTypes

Specifies the resource types that are accessible with the account SAS.

permission
str or AccountSasPermissions

The permissions associated with the shared access signature. The user is restricted to operations allowed by the permissions. Required unless an id is given referencing a stored access policy which contains this field. This field must be omitted if it has been specified in an associated stored access policy.

expiry
datetime.datetime or str

The time at which the shared access signature becomes invalid. Required unless an id is given referencing a stored access policy which contains this field. This field must be omitted if it has been specified in an associated stored access policy. Azure will always convert values to UTC. If a date is passed in without timezone info, it is assumed to be UTC.

Returns

A Shared Access Signature (sas) token.

Return type

str

generate_file_system_sas(account_name, file_system_name, credential, permission=None, expiry=None, **kwargs)

Generates a shared access signature for a file system.

Use the returned signature with the credential parameter of any DataLakeServiceClient, FileSystemClient, DataLakeDirectoryClient or DataLakeFileClient.

generate_file_system_sas(account_name, file_system_name, credential, permission=None, expiry=None, **kwargs)

Parameters

account_name
str

The storage account name used to generate the shared access signature.

file_system_name
str

The name of the file system.

credential
str or UserDelegationKey

Credential could be either account key or user delegation key. If use account key is used as credential, then the credential type should be a str. Instead of an account key, the user could also pass in a user delegation key. A user delegation key can be obtained from the service by authenticating with an AAD identity; this can be accomplished by calling get_user_delegation_key(key_start_time, key_expiry_time, **kwargs). When present, the SAS is signed with the user delegation key instead.

permission
str or FileSystemSasPermissions
default value: None

The permissions associated with the shared access signature. The user is restricted to operations allowed by the permissions. Permissions must be ordered read, write, delete, list. Required unless an id is given referencing a stored access policy which contains this field. This field must be omitted if it has been specified in an associated stored access policy.

expiry
datetime or str
default value: None

The time at which the shared access signature becomes invalid. Required unless an id is given referencing a stored access policy which contains this field. This field must be omitted if it has been specified in an associated stored access policy. Azure will always convert values to UTC. If a date is passed in without timezone info, it is assumed to be UTC.

Returns

A Shared Access Signature (sas) token.

Return type

str

generate_directory_sas(account_name, file_system_name, directory_name, credential, permission=None, expiry=None, **kwargs)

Generates a shared access signature for a directory.

Use the returned signature with the credential parameter of any DataLakeServiceClient, FileSystemClient, DataLakeDirectoryClient or DataLakeFileClient.

generate_directory_sas(account_name, file_system_name, directory_name, credential, permission=None, expiry=None, **kwargs)

Parameters

account_name
str

The storage account name used to generate the shared access signature.

file_system_name
str

The name of the file system.

directory_name
str

The name of the directory.

credential
str or UserDelegationKey

Credential could be either account key or user delegation key. If use account key is used as credential, then the credential type should be a str. Instead of an account key, the user could also pass in a user delegation key. A user delegation key can be obtained from the service by authenticating with an AAD identity; this can be accomplished by calling get_user_delegation_key(key_start_time, key_expiry_time, **kwargs). When present, the SAS is signed with the user delegation key instead.

permission
str or FileSasPermissions
default value: None

The permissions associated with the shared access signature. The user is restricted to operations allowed by the permissions. Permissions must be ordered read, write, delete, list. Required unless an id is given referencing a stored access policy which contains this field. This field must be omitted if it has been specified in an associated stored access policy.

expiry
datetime.datetime or str
default value: None

The time at which the shared access signature becomes invalid. Required unless an id is given referencing a stored access policy which contains this field. This field must be omitted if it has been specified in an associated stored access policy. Azure will always convert values to UTC. If a date is passed in without timezone info, it is assumed to be UTC.

Returns

A Shared Access Signature (sas) token.

Return type

str

generate_file_sas(account_name, file_system_name, directory_name, file_name, credential, permission=None, expiry=None, **kwargs)

Generates a shared access signature for a file.

Use the returned signature with the credential parameter of any BDataLakeServiceClient, FileSystemClient, DataLakeDirectoryClient or DataLakeFileClient.

generate_file_sas(account_name, file_system_name, directory_name, file_name, credential, permission=None, expiry=None, **kwargs)

Parameters

account_name
str

The storage account name used to generate the shared access signature.

file_system_name
str

The name of the file system.

directory_name
str

The name of the directory.

file_name
str

The name of the file.

credential
str or UserDelegationKey

Credential could be either account key or user delegation key. If use account key is used as credential, then the credential type should be a str. Instead of an account key, the user could also pass in a user delegation key. A user delegation key can be obtained from the service by authenticating with an AAD identity; this can be accomplished by calling get_user_delegation_key(key_start_time, key_expiry_time, **kwargs). When present, the SAS is signed with the user delegation key instead.

permission
str or FileSasPermissions
default value: None

The permissions associated with the shared access signature. The user is restricted to operations allowed by the permissions. Permissions must be ordered read, write, delete, list. Required unless an id is given referencing a stored access policy which contains this field. This field must be omitted if it has been specified in an associated stored access policy.

expiry
datetime.datetime or str
default value: None

The time at which the shared access signature becomes invalid. Required unless an id is given referencing a stored access policy which contains this field. This field must be omitted if it has been specified in an associated stored access policy. Azure will always convert values to UTC. If a date is passed in without timezone info, it is assumed to be UTC.

Returns

A Shared Access Signature (sas) token.

Return type

str