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 to retrieve (defaultQ123)--action: One ofdemo,hello,retrieve,update,invoke,purge(defaultdemo)--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.retrieve: Runs retrieve for the given object (and optional component).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.