Client CLI¶
The client_cli module provides a minimal command-line interface around the DOIP client.
Running¶
Options:
--host: DOIP server host (defaultdoip.staging.mardi4nfdi.org)--port: DOIP server port (default3567)--no-tls: Disable TLS wrapping (useful for local plaintext servers)--secure: Enable TLS certificate/hostname verification--object-id: Object identifier (defaultQ123; omit forlist_opsto ask the service)--action: One ofdemo,hello,list_ops,retrieve,create,update,search,describe,invoke,purge(defaultdemo). Every action exceptdemois a server operation taken fromdoip_shared/operations.py, so this list cannot drift from what the server advertises. Run--action list_opsto ask a specific deployment.--component: Component ID to retrieve (retrieve/demo actions)--input: File path to upload forupdate--media-type: Explicit media type forupdate; defaults toapplication/octet-stream--update-token: Shared secret forupdate; defaults toDOIP_UPDATE_TOKEN--workflow: Workflow name (invoke action, defaultequation_extraction)--params: Workflow parameters as JSON string (invoke action)--output: Path or directory to save the first retrieved component (retrieve action)
When saving to a directory, the original filename provided by the server is preserved when present.
Actions¶
demo: Runshellothenretrieve.hello: Runs only the hello operation; reports the server's operations and type registry.list_ops: Lists the operations available on a target, with their DOIP identifiers. Without--object-idit answers for the service; with a type (types/Workflow) or an object PID it returns that type's applicable operations, intersected with what the server implements.retrieve: Runs retrieve for the given object (and optional component).describe: Returns the FDO record (kernel, profile, provenance) for--object-id.create: Creates a new object in the knowledge graph.search: Searches the knowledge graph and returns matching object ids.update: Uploads one component to an existing object and creates a lakeFS commit.invoke: Runs a workflow for the given object with optional params.purge: Evicts the cached manifest for--object-idfrom the server's in-memory cache.
Update authorization¶
updaterequests must include a shared secret.- The CLI reads that secret from
--update-tokenorDOIP_UPDATE_TOKEN. - On the server, the expected token is currently the configured lakeFS password.
Example: Download a PDF¶
PYTHONPATH=. python -m client_cli.main --action retrieve --object-id Q6190920 --component fulltext.pdf --output .
Example: Download a RO-CRATE¶
python -m client_cli.main --host localhost --no-tls --action retrieve --object-id Q6032968 --component rocrate --output crate.zip
Example: Update One Component¶
PYTHONPATH=. python -m client_cli.main --host 127.0.0.1 --no-tls --action update --object-id Q6190920 --component fulltext.pdf --input pdf.pdf --media-type application/pdf --update-token "$DOIP_UPDATE_TOKEN"
update is component-scoped. It updates or adds the specified component and leaves all other components unchanged.
Component IDs are exact storage names. If you upload fulltext, retrieve fulltext. If you upload fulltext.pdf, retrieve fulltext.pdf.