tapis_cli.commands.taccapis.v2.files.helpers package

Submodules

tapis_cli.commands.taccapis.v2.files.helpers.constants module

Globals pertaining to the Tapis files API

tapis_cli.commands.taccapis.v2.files.helpers.error module

Exceptions and error handlers

exception tapis_cli.commands.taccapis.v2.files.helpers.error.AgaveError

Bases: Exception

exception tapis_cli.commands.taccapis.v2.files.helpers.error.HTTPError(*args, **kwargs)

Bases: requests.exceptions.RequestException

An HTTP error occurred.

exception tapis_cli.commands.taccapis.v2.files.helpers.error.HTTPNotFoundError(*args, **kwargs)

Bases: requests.exceptions.HTTPError

exception tapis_cli.commands.taccapis.v2.files.helpers.error.TapisOperationFailed

Bases: agavepy.errors.AgaveError

exception tapis_cli.commands.taccapis.v2.files.helpers.error.ImportNotCompleteError(*args, **kwargs)

Bases: tapis_cli.commands.taccapis.v2.files.helpers.error.HTTPNotFoundError

exception tapis_cli.commands.taccapis.v2.files.helpers.error.FileExcludedError

Bases: OSError

tapis_cli.commands.taccapis.v2.files.helpers.error.read_tapis_http_error(http_error_object)

Extract useful details from an exception raised by interactting with a Tapis API

tapis_cli.commands.taccapis.v2.files.helpers.error.handle_http_error(httperror)

tapis_cli.commands.taccapis.v2.files.helpers.manage module

tapis_cli.commands.taccapis.v2.files.helpers.manage.copy(file_path, system_id='data-tacc-sandbox', destination=None, permissive=False, agave=None)
tapis_cli.commands.taccapis.v2.files.helpers.manage.delete(file_path, system_id='data-tacc-sandbox', permissive=False, agave=None)
tapis_cli.commands.taccapis.v2.files.helpers.manage.makedirs(file_path, system_id='data-tacc-sandbox', destination='/', exist_ok=True, permissive=False, agave=None)
tapis_cli.commands.taccapis.v2.files.helpers.manage.move(file_path, system_id='data-tacc-sandbox', destination=None, permissive=False, agave=None)

tapis_cli.commands.taccapis.v2.files.helpers.pems_list module

tapis_cli.commands.taccapis.v2.files.helpers.pems_list.pems_list(file_path, system_id='data-tacc-sandbox', limit=200, offset=0, root_dir='/', permissive=False, agave=None, **kwargs)

tapis_cli.commands.taccapis.v2.files.helpers.stat module

Web service implementations of files-list operations

tapis_cli.commands.taccapis.v2.files.helpers.stat.stat(file_path, system_id='data-tacc-sandbox', root_dir='/', permissive=False, agave=None, **kwargs)

Retrieve attributes for a given path on a Tapis storageSystem

Parameters:
  • file_path (str) – The path from which to fetch attributes
  • system_id (str, optional) – The Tapis storageSystem for file_path
  • root_dir (str, optional) – Base path on the storageSystem if file_path is relative
  • permissive (bool, optional) – Whether to raise an Exception on failure
  • agave (Agave, optional) – An active Tapis client
Returns:

A dictionary containing Tapis files API attributes

Return type:

dict

Raises:
  • HTTPError – A transport or web services error was encountered
  • TapisOperationFailed – Some other error prevented the operation
tapis_cli.commands.taccapis.v2.files.helpers.stat.rsrc_type(file_path, system_id='data-tacc-sandbox', root_dir='/', permissive=False, agave=None, **kwargs)

Retrieve the type for a given path on a Tapis storageSystem

Parameters:
  • file_path (str) – The path from which to fetch attributes
  • system_id (str, optional) – The Tapis storageSystem for file_path
  • root_dir (str, optional) – Base path on the storageSystem if file_path is relative
  • permissive (bool, optional) – Whether to raise an Exception on failure
  • agave (Agave, optional) – An active Tapis client
Returns:

Either file or dir

Return type:

string

Raises:
  • HTTPError – A transport or web services error was encountered
  • TapisOperationFailed – Some other error prevented the operation
tapis_cli.commands.taccapis.v2.files.helpers.stat.exists(file_path, system_id='data-tacc-sandbox', root_dir='/', permissive=False, agave=None, **kwargs)

Determine if a path exists on a Tapis storageSystem

Parameters:
  • file_path (str) – The path from which to fetch attributes
  • system_id (str, optional) – The Tapis storageSystem for file_path
  • root_dir (str, optional) – Base path on the storageSystem if file_path is relative
  • permissive (bool, optional) – Whether to raise an Exception on failure
  • agave (Agave, optional) – An active Tapis client
Returns:

True if the path exists and False if not

Return type:

bool

Raises:
  • HTTPError – A transport or web services error was encountered
  • TapisOperationFailed – Some other error prevented the operation
tapis_cli.commands.taccapis.v2.files.helpers.stat.isfile(file_path, system_id='data-tacc-sandbox', root_dir='/', permissive=False, agave=None, **kwargs)

Determine if a path exists and is a file on a Tapis storageSystem

Parameters:
  • file_path (str) – The path from which to fetch attributes
  • system_id (str, optional) – The Tapis storageSystem for file_path
  • root_dir (str, optional) – Base path on the storageSystem if file_path is relative
  • permissive (bool, optional) – Whether to raise an Exception on failure
  • agave (Agave, optional) – An active Tapis client
Returns:

True if the path is a file and False if not

Return type:

bool

Raises:
  • HTTPError – A transport or web services error was encountered
  • TapisOperationFailed – Some other error prevented the operation
tapis_cli.commands.taccapis.v2.files.helpers.stat.isdir(file_path, system_id='data-tacc-sandbox', root_dir='/', permissive=False, agave=None, **kwargs)

Determine if a path exists and is a directory on a Tapis storageSystem

Parameters:
  • file_path (str) – The path from which to fetch attributes
  • system_id (str, optional) – The Tapis storageSystem for file_path
  • root_dir (str, optional) – Base path on the storageSystem if file_path is relative
  • permissive (bool, optional) – Whether to raise an Exception on failure
  • agave (Agave, optional) – An active Tapis client
Returns:

True if the path is a directory and False if not

Return type:

bool

Raises:
  • HTTPError – A transport or web services error was encountered
  • TapisOperationFailed – Some other error prevented the operation

tapis_cli.commands.taccapis.v2.files.helpers.sync module

Web service implementations of files sync operations.

tapis_cli.commands.taccapis.v2.files.helpers.sync.download(source, system_id, destination='.', includes=None, excludes=None, force=False, sync=False, atomic=False, progress=False, agave=None)

tapis_cli.commands.taccapis.v2.files.helpers.upload module

tapis_cli.commands.taccapis.v2.files.helpers.upload.upload(local_file_path, system_id, destination='/', excludes=None, includes=None, force=False, sync=False, atomic=False, progress=True, agave=None)

tapis_cli.commands.taccapis.v2.files.helpers.walk module

Web service implementations of the walk operation.

Provides both walk and listdir functions via recursive files-list web service operations.

tapis_cli.commands.taccapis.v2.files.helpers.walk.walk(directory_path, system_id='data-tacc-sandbox', root_dir='/', directories=False, dotfiles=False, sort=False, page_size=100, agave=None, **kwargs)

Recursively lists contents of a Tapis files directory.

Parameters:
  • directory_path (str) – Full or relative path of directory to walk
  • system_id (str, optional) – Tapis storageSystem for directory_path
  • root_dir (str, optional) – Base path if directory_path is relative
  • directories (bool, optional) – Whether result should include directories
  • dotfiles (bool, optional) – Whether result should include dotfiles
  • page_size (int, optional) – Override default Tapis files-list page size
  • agave (Agave, optional) – Tapis (Agave) API client
Returns:

List of Tapis-canonical absolute paths as AnnotatedFile objects

Return type:

list

Raises:

TapisOperationFailed – An exception or error happened

tapis_cli.commands.taccapis.v2.files.helpers.walk.listdir(directory_path, system_id='data-tacc-sandbox', root_dir='/', directories=True, dotfiles=False, page_size=100, sort=True, agave=None, **kwargs)

Lists immediate contents of a Tapis files directory.

Parameters:
  • directory_path (str) – Full or relative path of directory to walk
  • system_id (str, optional) – Tapis storageSystem for directory_path
  • root_dir (str, optional) – Base path if directory_path is relative
  • directories (bool, optional) – Whether result should include directories
  • dotfiles (bool, optional) – Whether result should include dotfiles
  • agave (Agave, optional) – Tapis (Agave) API client
Returns:

List of paths relative to directory_path

Return type:

list

Raises:

TapisOperationFailed – Some error prevented the action from completing