Lotte: Befehlsreferenz¶
Lottes Befehle sind Laravel-Kommandos und werden im Verzeichnis der Anwendung über artisan aufgerufen. Anders als bei Anton wird der Mandant nicht mit --env gewählt, sondern als erstes Argument genannt: <tenant> ist sein Slug aus der Mandanten-Datei.
php artisan lotte:show beispiel 01944a8e-…
Jede Operation der API gibt es auch als Befehl. Objekte werden mit ihrer UUID genannt; wo ein Befehl mehrere Objekte nimmt, geht auch die OCFL-ID urn:uuid:…. Wie die Befehle im Betrieb zusammenspielen, steht unter Betrieb.
Nach Aufgabe¶
| Aufgabe | Befehle |
|---|---|
| Mandanten | lotte:tenant:init, lotte:migrate |
| Clients und Schlüssel | lotte:client:create, lotte:client:revoke |
| Übernahme | lotte:ingest, lotte:commit, lotte:discard, lotte:prune-packages |
| Objekte | lotte:show, lotte:get, lotte:metadata |
| Ableitungen und Text | lotte:derive, lotte:derivatives, lotte:ocr |
| Prüfung und Migration | lotte:verify, lotte:migrate-format |
| Änderungsfeed | lotte:changes |
| Zurückziehen und Löschen | lotte:withdraw, lotte:purge |
| Betrieb | lotte:work, lotte:health, lotte:rebuild-index |
lotte:migrate migriert die Datenbanken der Mandanten, nicht Formate; eine Formatmigration ist lotte:migrate-format. lotte:ocr, lotte:verify und lotte:migrate-format legen dieselben Aufträge an wie POST /t/<slug>/jobs und führen sie gleich aus, mit --queue in der Warteschlange des Mandanten.
Schreibende Befehle
lotte:migrate-format ohne --probe, lotte:metadata und lotte:withdraw legen eine neue Version an; lotte:purge --confirm entfernt den Inhalt eines Objekts endgültig. Vorher ohne --confirm bzw. mit --probe ansehen, was geschähe.
Vollständige Referenz¶
Die folgenden Abschnitte listen alle Befehle lotte:* mit Aufruf, Argumenten und Optionen, wie sie in ihrer eigenen --help-Ausgabe stehen.
Automatisch erzeugt
Dieser Abschnitt wird aus php artisan list lotte erzeugt (scripts/gen-command-reference.py); die Beschreibungen stehen in der Sprache des Codes (Englisch). Nicht aufgeführt sind die Optionen, die jeder Laravel-Befehl hat (--help, --quiet, --verbose …).
lotte:changes¶
List a customer's change feed after a sequence
php artisan lotte:changes [--since [SINCE]] [--limit [LIMIT]] [--] <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
--since=… |
the entries after this sequence | 0 |
--limit=… |
at most this many (1 to 1000) | 100 |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:client:create¶
Create a client with a key for one customer
php artisan lotte:client:create [--abilities [ABILITIES]] [--description [DESCRIPTION]] [--] <tenant> <name>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<name> |
||
--abilities=… |
comma-separated: read, ingest, jobs, withdraw, metadata | read |
--description=… |
||
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:client:revoke¶
Revoke all keys of a client of one customer
php artisan lotte:client:revoke <tenant> <name>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<name> |
||
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:commit¶
Commit a checked package of a customer into OCFL objects
php artisan lotte:commit <tenant> <package>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<package> |
||
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:derivatives¶
Keep a customer's derivative rows true to the store and make up missing or failed derivatives
php artisan lotte:derivatives [--reconcile] [--backfill] [--object [OBJECT]] [--limit [LIMIT]] [--dry-run] [--given-up] [--] <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
--reconcile |
align the derivative rows with the derivative and text store | |
--backfill |
queue missing derivatives, failed ones with fewer than three attempts, and claims older than a day | |
--object=… |
with --reconcile, only these objects | |
--limit=… |
with --backfill, at most this many per run | 500 |
--dry-run |
with --backfill, count only | |
--given-up |
list the derivatives failed three times, which the backfill no longer tries | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:derive¶
Queue (or with --sync make) a customer's missing derivatives and text
php artisan lotte:derive [--object [OBJECT]] [--conversion [CONVERSION]] [--retry-failed] [--sync] [--] <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
--object=… |
only these objects (UUID or urn:uuid:…) | |
--conversion=… |
only this conversion (web, thumb, poster, text …) | |
--retry-failed |
also what failed fewer than three times | |
--sync |
make them in this process instead of queueing | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:discard¶
Discard a package of a customer
php artisan lotte:discard <tenant> <package>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<package> |
||
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:export¶
Export a customer's OCFL objects into a storage root elsewhere, checked there with ocfl-py
php artisan lotte:export [--object [OBJECT]] [--all] [--to [TO]] [--] <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
--object=… |
only these objects (UUID or urn:uuid:…) | |
--all |
every object of the customer | |
--to=… |
the target: empty, missing, or a storage root an earlier export made | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:get¶
Copy a file of an OCFL object of a customer
php artisan lotte:get [--at [AT]] [--to [TO]] [--] <tenant> <object> <path>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<object> |
the object's UUID | |
<path> |
logical path, e.g. data/scan.tif | |
--at=… |
version v1, v2, …; the head by default | |
--to=… |
target file | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:health¶
Check the storage base and, per customer, database, folder and queue; Nagios output and exit code
php artisan lotte:health
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:ingest¶
Ingest the files of a folder as one package and check it
php artisan lotte:ingest [--reference-prefix [REFERENCE-PREFIX]] [--route [ROUTE]] [--] <tenant> <folder>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<folder> |
||
--reference-prefix=… |
reference = prefix + file name | |
--route=… |
the route the files came by; the format policy decides by it | upload |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:metadata¶
Give an object of a customer a new metadata copy (a new version)
php artisan lotte:metadata <tenant> <object> <file>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<object> |
the object's UUID | |
<file> |
a JSON file with the new metadata copy | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:migrate¶
Migrate the customers' databases
php artisan lotte:migrate [--tenant [TENANT]] [--all]
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
--tenant=… |
only these customers | |
--all |
every customer in the tenants file | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:migrate-format¶
Migrate objects of a customer by a format policy rule (with --probe: only report)
php artisan lotte:migrate-format [--rule [RULE]] [--object [OBJECT]] [--package [PACKAGE]] [--probe] [--queue] [--] <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
--rule=… |
the format policy rule to apply, e.g. tiff_zip | |
--object=… |
these objects (UUID or urn:uuid:…) | |
--package=… |
the committed objects of this package | |
--probe |
run the rule on copies and report per object; changes nothing | |
--queue |
hand the job to the customer's queue instead of running it here | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:ocr¶
Run an OCR job over objects or a package of a customer
php artisan lotte:ocr [--object [OBJECT]] [--package [PACKAGE]] [--queue] [--] <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
--object=… |
these objects (UUID or urn:uuid:…) | |
--package=… |
the committed objects of this package | |
--queue |
hand the job to the customer's queue instead of running it here | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:prune-packages¶
Discard forgotten packages
php artisan lotte:prune-packages [--tenant [TENANT]] [--all]
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
--tenant=… |
only these customers | |
--all |
every customer | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:purge¶
Purge a withdrawn object's content for good (operator only; the rule when this is allowed is not decided yet)
php artisan lotte:purge [--reason [REASON]] [--confirm] [--] <tenant> <object>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<object> |
the object's UUID | |
--reason=… |
why the content is purged (required) | |
--confirm |
remove for real; without it only say what would be removed | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:rebuild-index¶
Rebuild a customer's object index from its OCFL storage root
php artisan lotte:rebuild-index [--prune] [--] <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
--prune |
remove index rows whose object is not in the storage root | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:repair¶
Repair a damaged object from a copy in another storage root (operator only)
php artisan lotte:repair [--from [FROM]] [--confirm] [--] <tenant> <object>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<object> |
the object's UUID | |
--from=… |
the storage root of a copy, tried in the order given | |
--confirm |
repair for real; without it only say which copy would be taken | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:show¶
Show an OCFL object of a customer
php artisan lotte:show <tenant> <object>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<object> |
the object's UUID | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:tenant:init¶
Create a customer's folder and database and migrate it
php artisan lotte:tenant:init <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
slug from the tenants file | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:verify¶
Validate a customer's OCFL objects (fixity), with --ocfl also with ocfl-py
php artisan lotte:verify [--ocfl] [--object [OBJECT]] [--package [PACKAGE]] [--share [SHARE]] [--sample [SAMPLE]] [--report [REPORT]] [--queue] [--] <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
--ocfl |
also validate each object with ocfl-py | |
--object=… |
only these objects (UUID or urn:uuid:…) | |
--package=… |
only the committed objects of this package | |
--share=… |
only one Nth of the objects, never checked first, then the oldest check (12: a twelfth a month) | |
--sample=… |
only N objects drawn at random | |
--report=… |
write what was checked and the outcome per object to this JSON file | |
--queue |
hand the job to the customer's queue instead of running it here | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:withdraw¶
Withdraw an object of a customer: nothing served any more, derivatives and text removed, the content kept
php artisan lotte:withdraw [--reason [REASON]] [--] <tenant> <object>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
<object> |
the object's UUID | |
--reason=… |
why it is withdrawn (required) | |
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |
lotte:work¶
Work the queue of one customer
php artisan lotte:work [--once] [--stop-when-empty] [--] <tenant>
| Argument / Option | Beschreibung | Vorgabe |
|---|---|---|
<tenant> |
||
--once |
||
--stop-when-empty |
||
--operator=… |
Who runs the command (else SUDO_USER, else the Unix user) |