omero.plugins.fs module

fs plugin for querying repositories, filesets, and the like.

class plugins.fs.Entry(level, id, path, mimetype)

Bases: tuple

id

Alias for field number 1

level

Alias for field number 0

mimetype

Alias for field number 3

path

Alias for field number 2

class plugins.fs.FsControl(*args: Any, **kwargs: Any)[source]

Bases: CmdControl

get_managed_repo(client)[source]

For the moment this assumes there’s only one.

images(args)[source]

List images, filtering for archives, etc.

This command is useful for showing pre-FS (i.e. OMERO 4.4 and before) images which have original data archived with them. It may be possible to convert these to OMERO 5 filesets.

Examples: ` omero fs images --archived       # List only OMERO4 images omero fs images --order=newest   # Default omero fs images --order=largest  # Most used space omero fs images --limit=500      # Longer listings omero fs images --extended       # More details `

importtime(args)[source]

Find out how long it took to import an existing fileset

logfile(args)[source]

Return the logfile associated with a fileset

ls(args)[source]

List all the original files contained in a fileset

mkdir(args)

Make a new directory (admin-only)

Creates a new empty directory in the managed repository. A new storage volume may then be mounted at that location and the import template (omero.fs.repo.path) adjusted to target it. Once created, the directory may be deleted from the underlying filesystem and replaced with a symbolic link. Directories that violate the root-owned prefix components of omero.fs.repo.path are all set to be owned by the root user.

rename(args)

Moves an existing fileset to a new location (admin-only)

After the import template (omero.fs.repo.path) has been changed, it may be useful to rename an existing fileset to match the new template. By default the original files and import log are also moved.

repos(args)[source]

List all repositories.

These repositories are where OMERO stores all binary data for your system. Most useful is likely the ManagedRepository where OMERO 5 imports to.

Examples: ` omero fs repos            # Show all omero fs repos --managed  # Show only the managed repo or print only the directory under Unix  # noqa omero fs repos --managed --style=plain | cut -d, -f5 `

sets(args)[source]

List filesets by various criteria

Filesets are bundles of original data imported into OMERO 5 and above which represent 1 or more images.

Examples:

` omero fs sets --order=newest        # Default omero fs sets --order=oldest omero fs sets --order=largest omero fs sets --without-images      # Corrupt filesets omero fs sets --with-transfer=ln_s  # Symlinked filesets omero fs sets --check               # Proof the checksums `

usage(args)[source]

Shows the disk usage for various objects.

This command shows the total disk usage of various objects including: ExperimenterGroup, Experimenter, Project, Dataset, Folder, Screen, Plate, Well, WellSample, Image, Pixels, Annotation, Job, Fileset, OriginalFile. The total size returned will comprise the disk usage by all related files. Thus an image’s size would typically include the files uploaded to a fileset, import log (Job), thumbnails, and, possibly, associated pixels or original files. These details can be displayed using the –report option.

Examples:

` omero fs usage             # total usage for current user omero fs usage --report    # more detailed usage for current user omero fs usage --groups    # total usage for current user's groups # total usage for five images with minimal output omero fs usage Image:1,2,3,4,5 --size_only # total usage for all images with in a human readable format omero fs usage Image:* --human-readable # total usage for all users broken down by user and group omero fs usage Experimenter:* --report --sum-by user group # total usage for two projects and one dataset Megabytes omero fs usage Project:1,2 Dataset:5 --units M # in this last case if the dataset was within project 1 or 2 # then the size returned would be identical to: omero fs usage Project:1,2 --units M `

class plugins.fs.ImportTime(ctx, query)[source]

Bases: object

get_cache()[source]

Retrieve import metrics from a map annotation on the fileset

print_report()[source]

Report how long it took to import an existing fileset

print_summary()[source]

Report import metrics from map annotations on filesets

print_summary_line()[source]

Report import metrics from the map annotations on a fileset

query_counts()[source]

Determine values for the per-item counts for the import metrics

query_durations()[source]

Determine values for the phase durations for the import metrics

write_cache(update)[source]

Write import metrics to a map annotation on the fileset

plugins.fs.contents(mrepo, path, ctx=None)[source]

Yield Entry namedtuples for each return value from treeList for the given path.

plugins.fs.get_logfile(query, fid)[source]
plugins.fs.prep_directory(client, mrepo)[source]

Create an empty FS directory by performing an import and then deleting the created fileset.

plugins.fs.rename_fileset(client, mrepo, fileset, new_dir, ctx=None)[source]

Loads each OriginalFile found under orig_dir and updates its path field to point at new_dir. Files are not yet moved.