baricadr.file package

Module contents

class baricadr.file.FileClient(url, login, password, endpoints)

Bases: baricadr.client.Client

Manipulate files managed by Baricadr

freeze(path, force=False, dry_run=False, email='')

Launch a freeze task

Parameters
  • path (str) – Local path to a file or folder to freeze

  • force (bool) – Force freezing, even if the freezing delay was not reached

  • dry_run (bool) – Do not make any deletion, just list changes that would be made

  • email (str) – User email adress for notification

Return type

str

Returns

Id associated to the freeze task

list(path, full=False, missing=False, max_depth=1, from_root=False)

List files available from a remote repository for a local path

Parameters
  • path (str) – Local path

  • missing (bool) – Only list files missing from the local path

  • full (bool) – List full information for each file (size (in bytes), mtime, etc..)

  • max_depth (int) – Restrict to a max depth. Set to 0 for all files.

  • from_root (bool) – Return full paths from root of the repo (instead of relative to given path)

Return type

list

Returns

List of file relative paths

pull(path, email='', dry_run=False)

Launch a pull task

Parameters
  • path (str) – Local path to a missing file or folder

  • email (str) – User email adress for notification

  • dry_run (bool) – Do not make any pull, just list changes that would be made

Return type

str

Returns

Id associated to the pull task

tree(path, max_depth=0)

List files available from a remote repository for a local path as a tree

Parameters
  • path (str) – Local path

  • max_depth (int) – Restrict to a max depth. Set to 0 for all files.

Return type

None

Returns

None