author: | Josh Moore, josh at glencoesoftware.com |
---|
OMERO Grid admin controller
This is a python wrapper around icegridregistry/icegridnode for master and various other tools needed for administration.
Copyright 2008-2016 Glencoe Software, Inc. All Rights Reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.plugins.prefs.WriteableConfigControl, omero.cli.UserGroupControl
Used to generate an icegridadmin command line argument list
Returns a file after “deploy”, “start”, or “startasync” and otherwise delegates to the BaseControl
Return path to directory containing configuration files
Return path to directory containing Gridconfiguration files
Return path to directory containing templates
Overrides the regular node() logic to return the value of OMERO_MASTER or “master”
Check that the given path belongs to or is accessible by the current user on Linux systems.
Check that ‘var’ is accessible by the current user.
Issue a warning if any of the top ”.omero” directories contain a lock file. This isn’t a conclusive test this we don’t have access to the DB to get the UUID for this instance. Usually there should only be one though.
If the args argparse.Namespace argument has no “node” attribute, then assign one.
Checks for Ice version compatibility.
See ticket:2514, ticket:1260
Checks whether a server upgrade is available, exits with return code 0: this is the latest version 1: an upgrade is available 2: an error occurred whilst checking
Checks that the templates file as defined in etcWindows.cfg can be found.
Display JVM settings from the current configuration
If present, get the wait time from the args argument and calculate the number of loops and the wait time needed. If not present in args, use a default value.
Callers are responsible for closing the returned ConfigXml object.
Regenerate all the template files under the configuration directory
First checks for a valid installation, then checks the grid, then registers the action: “node HOST start”
Returns true if the server was already stopped
Since the stop and start are separately protected by the lock on config.xml, we need to wait for some time to hopefully let the icegridnode process release the file locks.
Returns true if the server went down
Loops 30 times with 10 second pauses waiting for status() to return 0. If it does not, then ctx.die() is called.
load, quit, version, help plugins
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
The load plugin is used to read in files with omero cli commands (omitting the omero). For example,
./omero load some/file.osh
The help, quit, and version plugins are self-explanatory.
Copyright 2008 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.BaseControl
Defined here since the background loading might be too slow to have all help available
This is something of a hack. This should either be a part of the context interface, or we should put it somewhere in a utility. FIXME.
Create heading for command or topic help
Print the help for all commands and topics
Print help for a single command and optionally its subcommand
Print a list of all commands
Print the help for a command or a topic
Bases: omero.cli.BaseControl
Bases: omero.cli.BaseControl
Bases: omero.cli.BaseControl
Bases: omero.cli.BaseControl
chgrp plugin
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
chown plugin
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
Plugin for our managing the OMERO database.
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
Bases: omero.cli.BaseControl
Get a value from a flag arg, positional arg, or default properties
See #2689
Startup plugin for command-line deletes
Copyright 2009-2015 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.GraphControl
Don’t delete these three types of Annotation by default
download plugin
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
Copyright 2007 - 2014 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.BaseControl
Plugin for duplicating object graphs
Bases: omero.cli.GraphControl
Startup plugin for command-line exporter
Copyright 2009 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
fs plugin for querying repositories, filesets, and the like.
Bases: tuple
Entry(level, id, path, mimetype)
Return a new dict which maps field names to their values
Make a new Entry object from a sequence or iterable
Return a new Entry object replacing specified fields with new values
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
itemgetter(item, ...) –> itemgetter object
Return a callable object that fetches the given item(s) from its operand. After, f=itemgetter(2), the call f(r) returns r[2]. After, g=itemgetter(2,5,3), the call g(r) returns (r[2], r[5], r[3])
Bases: omero.cli.CmdControl
Print a breakdown of disk usage in table form, including user, group and component information according to the args.
Convert from bytes to KiB, MiB, GiB, TiB or PiB.
Take the positional arguments and marshal them into a dictionary and a list for the command argument.
Output the total bytes used or the error, optionally provide more details.
For the moment this assumes there’s only one.
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:
bin/omero fs images –archived # List only OMERO4 images bin/omero fs images –order=newest # Default bin/omero fs images –order=largest # Most used space bin/omero fs images –limit=500 # Longer listings bin/omero fs images –extended # More details
Return the logfile associated with a fileset
List all the original files contained in a fileset
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.
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.
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:
bin/omero fs repos # Show all bin/omero fs repos –managed # Show only the managed repo
# Or to print only the directory # under Unix:bin/omero fs repos –managed –style=plain | cut -d, -f5
Change configuration properties for single repositories
List filesets by various criteria
Filesets are bundles of original data imported into OMERO 5 and above which represent 1 or more images.
Examples:
bin/omero fs sets –order=newest # Default bin/omero fs sets –order=oldest bin/omero fs sets –order=largest bin/omero fs sets –without-images # Corrupt filesets bin/omero fs sets –with-transfer=ln_s # Symlinked filesets bin/omero fs sets –check # Proof the checksums
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:
bin/omero fs usage # total usage for current user bin/omero fs usage –report # more detailed usage for current user bin/omero fs usage –groups # total usage for current user’s groups # total usage for five images with minimal output bin/omero fs usage Image:1,2,3,4,5 –size_only # total usage for all images with in a human readable format bin/omero fs usage Image:* –human-readable # total usage for all users broken down by user and group bin/omero fs usage Experimenter:* –report –sum-by user group # total usage for two projects and one dataset Megabytes bin/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: bin/omero fs usage Project:1,2 –units M
Yield Entry namedtuples for each return value from treeList for the given path.
Create an empty FS directory by performing an import and then deleting the created fileset.
Loads each OriginalFile found under orig_dir and updates its path field to point at new_dir. Files are not yet moved.
Group administration plugin
Copyright 2009-2015 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.UserGroupControl
HQL plugin
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
Copyright 2008 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.BaseControl
Startup plugin for command-line importer.
Bases: object
Set the connection arguments
Set the arguments to skip steps during import
Bases: omero.cli.BaseControl
Bases: omero.plugins.import.ImportControl
User administration plugin (LDAP extension)
Copyright 2011 - 2016 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.UserGroupControl
Metadata plugin
Copyright 2015 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: object
A general helper object which providers higher-level accessors and mutators for a particular object.
Bases: omero.cli.BaseControl
Format an annotation as a string, optionally pretty-printed
Provide a list of all annotations linked to the given object
Provide a list of the NSBULKANNOTATION tables linked to the given object
Provide a list of all MapAnnotations linked to the given object
Provide a list of the NSMEASUREMENT tables linked to the given object
Print the original metadata in ini format
Add metadata (bulk-annotations) to an object
Add ROIs to an object
Manage ROIs
Provide a general summary of available metadata
Bases: exceptions.Exception
Raised when a requested object could not be loaded
author: | Josh Moore, josh at glencoesoftware.com |
---|
OMERO Grid node controller
This is a python wrapper around icegridnode.
Copyright 2008, 2016 Glencoe Software, Inc. All Rights Reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.BaseControl
Set the return value from nzrc on the context, and print out the last two lines of any error messages if present.
Plugin for performing OMERO transactional changes (DML) from a simple script. This macro like language is intended to be used simply from the command-line as well as in scripts and tests.
Bases: omero.plugins.obj.NonFieldTxAction
Bases: omero.plugins.obj.NonFieldTxAction
Bases: omero.plugins.obj.NonFieldTxAction
Bases: omero.plugins.obj.TxAction
Bases: omero.plugins.obj.TxAction
Base class for use with command actions which don’t take the standard a=b c=d fields.
Bases: omero.plugins.obj.NonFieldTxAction
Bases: omero.cli.BaseControl
Create, Update and Query OMERO objects
The obj command allows inserting any objects into the OMERO database as well as updating and querying existing ones. This is likely useful for preparing datasets for import and similar.
Examples:
$ bin/omero obj new Dataset name=foo Dataset:123 $ bin/omero obj update Dataset:123 description=bar Dataset:123 $ bin/omero obj get Dataset:123 name foo $ bin/omero obj get Dataset:123 description=bar id=123 name=foo version= $ bin/omero obj null Dataset:123 description Dataset:123 $ bin/omero obj get Dataset:123 description
$ bin/omero obj new MapAnnotation ns=example.com MapAnnotation:456 $ bin/omero obj map-set MapAnnotation:456 mapValue foo bar MapAnnotation:456 $ bin/omero obj map-set MapAnnotation:456 mapValue fu baa MapAnnotation:456 $ bin/omero obj map-get MapAnnotation:456 mapValue foo bar $ bin/omero obj get MapAnnotation:456 mapValue (foo,bar),(fu,baa) $ bin/omero obj list-get MapAnnotation:456 mapValue 0 (foo,bar)
Bash examples:
$ project=$(bin/omero obj new Project name=’my Project’) $ dataset=$(bin/omero obj new Dataset name=’my Dataset’) $ bin/omero obj new ProjectDatasetLink parent=$project child=$dataset ProjectDatasetLink:456 $ bin/omero import -d $dataset ...
Takes a single command list and turns it into a TxAction object
Bases: omero.plugins.obj.NonFieldTxAction
Bases: object
Parsed operation provided by the user chosen based on the first non-variable field of the command. Implementations can choose how they will handle the fields parsed by TxCmd.
Bases: object
Bases: object
Bases: object
Bases: omero.plugins.obj.TxAction
Plugin for measuring the performance of an OMERO installation.
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
Copyright 2008, 2016 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.BaseControl
prefs plugin
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
The pref plugin makes use of prefs.class from the common component.
Copyright 2007-2013 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.plugins.prefs.WriteableConfigControl
Bases: omero.cli.BaseControl
Base class for controls which need write access to the OMERO configuration using the @with_rw_config decorator
Note BaseControl should be used for read-only access using @with_config
Kept around temporarily for upgrading users from pre-4.2 configurations.
opens a config and passes it as the second argument.
opens a config and passes it as the second argument. Requires that the returned config be writeable
script plugin
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
The script plugin is used to run arbitrary blitz scripts which take as their sole input Ice configuration arguments, including –Ice.Config=file1,file2.
The first parameter, the script itself, should be natively executable on a given platform. I.e. invokable by subprocess.call([file,...])
Copyright 2008 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.BaseControl
Returns a file after “upload” and otherwise delegates to the BaseControl
Parses a list of scripts to self.ctx.out
Parses who items of the form: “user”, “group”, “user=1”, “group=6”
Use signal.SIGALRM to wait for the timeout to signal
Note: currently simply fails. An implementation might be possible using msvcrt. See: http://stackoverflow.com/questions/3471461/raw-input-and-timeout/3911560
Simple command-line searching. Similar to the hql plugin.
Bases: omero.plugins.hql.HqlControl
Startup plugin for our various server components, called typically by icegridnode after parsing etc/grid/templates.xml.
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
Copyright 2008, 2016 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.BaseControl
Plugin for viewing and controlling active sessions for a local user.
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
Bases: omero.cli.BaseControl
alias of SessionsStore
Parse a connection string of form (user@)server(:port)
Checks for conflicts in the settings for this session, and if there are none, then attempts an “attach()”. If that fails, the session is removed.
Either creates or returns the exiting omero.client instance. Uses the comm() method with the same signature.
Return the file associated with the current active session
Handles a new connection
Return the key associated with the current active session
Login to a given server, and store session key locally.
USER, HOST, and PORT are set as args or in a ssh-style connection string. PASSWORD can be entered interactively, or passed via -w (insecure!). Alternatively, a session KEY can be passed with ‘-k’. Admin users can use –sudo=ADMINUSER to login for others.
submit plugin
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
Copyright 2007 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: exceptions.Exception
Bases: exceptions.Exception
Bases: omero.cli.CLI
Bases: omero.cli.BaseControl
Tag plugin for command-line tag manipulation
author: | Sam Hart <sam@glencoesoftware.com> |
---|
Copyright (C) 2013-2015 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: object
Bases: object
Bases: omero.cli.BaseControl
create a tag command.
Creates a new tag object. Returns the new tag object.
If name parameter is None, the user will be prompted to input it.
The “text” parameter should be the text description to use upon user input. For example, if we were creating a tag, this would be “tag” (the default). If we were creating a tagset, this could be “tag set”.
Create a tag set command.
Will attempt to determine console size based upon the current platform.
Returns tuple of width and length.
Given a list of empty tagsets, return a list of lines representing the empty tagset output.
Given a list of orphaned tags, return a list of lines representing the orphan output.
Given a dict of tags and mappings for parent/child relationships return a list of lines representing the tagset output.
Links an object to a tag annotation.
List tags command.
Returns a TagCollection object
Returns a TagCollection object
Returns a TagCollection of just the tagsets.
If tag is provided, will return the tagsets with those tags.
List tag sets command.
Import new tag(s) from json.
Given a string, s, and a width, will clip the string to that width or fill it with spaces up to that width.
Returns modified string
given a command, will execute it in the parent environment Returns a list containing the output
upload plugin
Plugin read by omero.cli.Cli during initialization. The method(s) defined here will be added to the Cli class for later use.
Copyright 2007-2016 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.BaseControl
Returns a file after “upload” and otherwise delegates to the BaseControl
User administration plugin
Copyright 2009-2014 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.UserGroupControl
Plugin for our configuring the OMERO.web installation
Copyright 2009-2016 University of Dundee. All rights reserved. Use is subject to license terms supplied in LICENSE.txt
Bases: omero.cli.BaseControl
Get Django Process ID
Clean out expired sessions.
Ensure that static media is copied to the correct location
Generate a configuration file from a template
Return extended help
Decorator validating OMERO.web deployment dependencies
Decorator validating Django dependencies and omeroweb/settings.py