core.cli.commands

Attributes

cli

Classes

SmsEventHandler

EnhancedInteractiveConsole

Wraps the InteractiveConsole with some basic shell features:

Functions

delete(group_context) → collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None]

Deletes a single instance matching the selector.

sendmail(group_context, queue, limit) → None

Sends mail from a specific mail queue.

sendsms(group_context) → collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None]

Sends the SMS in the smsdir for a given instance.

sms_spooler(group_context) → None

Continuously spools the SMS in the smsdir for all instances using

transfer(group_context, server, remote_config, ...) → None

Transfers the database and all files from a server running a

upgrade(group_context, dry_run) → tuple[collections.abc.Callable[..., Any], ...]

Upgrades all application instances of the given namespace(s).

shell() → collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None]

Enters an interactive shell.

Module Contents

core.cli.commands.cli[source]
core.cli.commands.delete(group_context: onegov.core.cli.core.GroupContext) → collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Deletes a single instance matching the selector.

Selectors matching multiple organisations are disabled for saftey reasons.

core.cli.commands.sendmail(group_context: onegov.core.cli.core.GroupContext, queue: str, limit: int) → None[source]

Sends mail from a specific mail queue.

core.cli.commands.sendsms(group_context: onegov.core.cli.core.GroupContext) → collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Sends the SMS in the smsdir for a given instance.

For example:

onegov-core --select '/onegov_town6/meggen' sendsms
class core.cli.commands.SmsEventHandler(queue_processors: list[onegov.core.sms_processor.SmsQueueProcessor])[source]

Bases: watchdog.events.PatternMatchingEventHandler

queue_processors[source]
on_moved(event: watchdog.events.FileSystemEvent) → None[source]
on_created(event: watchdog.events.FileSystemEvent) → None[source]
core.cli.commands.sms_spooler(group_context: onegov.core.cli.core.GroupContext) → None[source]

Continuously spools the SMS in the smsdir for all instances using a watchdog that monitors the smsdir for newly created files.

For example:

onegov-core sms-spooler
core.cli.commands.transfer(group_context: onegov.core.cli.core.GroupContext, server: str, remote_config: str, confirm: bool, no_filestorage: bool, no_database: bool, transfer_schema: str | None, add_admins: bool, delta: bool) → None[source]

Transfers the database and all files from a server running a onegov-cloud application and installs them locally, overwriting the local data!

This command expects to have access to the remote server via ssh (no password) and to be run sudo without password. If this is too scary for you, feel free to write something saner.

Only namespaces which are present locally and remotely are considered.

So if you have a ‘cities’ namespace locally and a ‘towns’ namespace on the remote, nothing will happen.

It’s also possible to transfer only a given schema, e.g. /town6/govikon or /town6/*. But beware, global files are copied in any case!

WARNING: This may delete local content!

core.cli.commands.upgrade(group_context: onegov.core.cli.core.GroupContext, dry_run: bool) → tuple[collections.abc.Callable[..., Any], ...][source]

Upgrades all application instances of the given namespace(s).

class core.cli.commands.EnhancedInteractiveConsole(locals: dict[str, Any] | None = None)[source]

Bases: code.InteractiveConsole

Wraps the InteractiveConsole with some basic shell features:

  • horizontal movement (e.g. arrow keys)

  • history (e.g. up and down keys)

  • very basic tab completion

init_completer() → None[source]
core.cli.commands.shell() → collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None][source]

Enters an interactive shell.