Commands¶
ralph¶
The cli is a stream-based tool to play with your logs.
It offers functionalities to: - Validate or convert learning data in different standards - Read and write learning data to various databases or servers - Manage an instance of a Ralph LRS server
Usage:
ralph [OPTIONS] COMMAND [ARGS]...
Options:
-v, --verbosity LVL Either CRITICAL, ERROR, WARNING, INFO (default) or
DEBUG
--version Show the version and exit.
--help Show this message and exit.
ralph auth¶
Generate credentials for LRS HTTP basic authentication.
Usage:
ralph auth [OPTIONS]
Options:
-u, --username TEXT The user for which we generate credentials.
[required]
-p, --password TEXT The password to encrypt for this user. Will
be prompted if missing. [required]
-s, --scope TEXT The user scope(s). This option can be
provided multiple times. [required]
-M, --agent-ifi-mbox TEXT The mbox Inverse Functional Identifier of
the associated agent.
-S, --agent-ifi-mbox-sha1sum TEXT
The mbox-sha1sum Inverse Functional
Identifier of the associated agent.
-O, --agent-ifi-openid TEXT The openid Inverse Functional Identifier of
the associated agent.
-A, --agent-ifi-account TEXT...
Input "{name} {homePage}". The account
Inverse Functional Identifier of the
associated agent.
-N, --agent-name TEXT The name of the associated agent.
-w, --write-to-disk Write new credentials to the LRS
authentication file.
--help Show this message and exit.
ralph convert¶
Convert input events to a given format.
Usage:
ralph convert [OPTIONS]
Options:
From edX to xAPI converter options:
-u, --uuid-namespace TEXT The UUID namespace to use for the `ID` field
generation
-p, --platform-url TEXT The `actor.account.homePage` to use in the
xAPI statements [required]
-f, --from [edx] Input events format to convert [required]
-t, --to [xapi] Output events format [required]
-I, --ignore-errors Continue writing regardless of raised errors
-F, --fail-on-unknown Stop converting at first unknown event
--help Show this message and exit.
ralph extract¶
Extract input events from a container format using a dedicated parser.
Usage:
ralph extract [OPTIONS]
Options:
-p, --parser [gelf|es] Container format parser used to extract events
[required]
--help Show this message and exit.
ralph list¶
List available archives from a configured storage backend.
Usage:
ralph list [OPTIONS]
Options:
-b, --backend [ldp|fs|swift|s3]
Backend [required]
s3 backend:
--s3-endpoint-url TEXT
--s3-bucket-name TEXT
--s3-default-region TEXT
--s3-session-token TEXT
--s3-secret-access-key TEXT
--s3-access-key-id TEXT
swift backend:
--swift-os-identity-api-version TEXT
--swift-os-auth-url TEXT
--swift-os-project-domain-name TEXT
--swift-os-user-domain-name TEXT
--swift-os-storage-url TEXT
--swift-os-region-name TEXT
--swift-os-password TEXT
--swift-os-username TEXT
--swift-os-tenant-name TEXT
--swift-os-tenant-id TEXT
fs backend:
--fs-path TEXT
ldp backend:
--ldp-stream-id TEXT
--ldp-service-name TEXT
--ldp-consumer-key TEXT
--ldp-application-secret TEXT
--ldp-application-key TEXT
--ldp-endpoint TEXT
-n, --new / -a, --all List not fetched (or all) archives
-D, --details / -I, --ids Get archives detailed output (JSON)
--help Show this message and exit.
ralph read¶
Read an archive or records from a configured backend.
Usage:
ralph read [OPTIONS] [ARCHIVE]
Options:
-b, --backend [es|mongo|clickhouse|lrs|ldp|fs|swift|s3|ws]
Backend [required]
ws backend:
--ws-uri TEXT
s3 backend:
--s3-endpoint-url TEXT
--s3-bucket-name TEXT
--s3-default-region TEXT
--s3-session-token TEXT
--s3-secret-access-key TEXT
--s3-access-key-id TEXT
swift backend:
--swift-os-identity-api-version TEXT
--swift-os-auth-url TEXT
--swift-os-project-domain-name TEXT
--swift-os-user-domain-name TEXT
--swift-os-storage-url TEXT
--swift-os-region-name TEXT
--swift-os-password TEXT
--swift-os-username TEXT
--swift-os-tenant-name TEXT
--swift-os-tenant-id TEXT
fs backend:
--fs-path TEXT
ldp backend:
--ldp-stream-id TEXT
--ldp-service-name TEXT
--ldp-consumer-key TEXT
--ldp-application-secret TEXT
--ldp-application-key TEXT
--ldp-endpoint TEXT
lrs backend:
--lrs-statements-endpoint TEXT
--lrs-status-endpoint TEXT
--lrs-headers KEY=VALUE,KEY=VALUE
--lrs-password TEXT
--lrs-username TEXT
--lrs-base-url TEXT
clickhouse backend:
--clickhouse-client-options KEY=VALUE,KEY=VALUE
--clickhouse-password TEXT
--clickhouse-username TEXT
--clickhouse-event-table-name TEXT
--clickhouse-database TEXT
--clickhouse-port INTEGER
--clickhouse-host TEXT
mongo backend:
--mongo-client-options KEY=VALUE,KEY=VALUE
--mongo-collection TEXT
--mongo-database TEXT
--mongo-connection-uri TEXT
es backend:
--es-op-type TEXT
--es-client-options KEY=VALUE,KEY=VALUE
--es-index TEXT
--es-hosts VALUE1,VALUE2,VALUE3
-c, --chunk-size INTEGER Get events by chunks of size #
-t, --target TEXT Endpoint from which to read events (e.g.
`/statements`)
-q, --query '{"KEY": "VALUE", "KEY": "VALUE"}'
Query object as a JSON string (database and
HTTP backends ONLY)
--help Show this message and exit.
ralph runserver¶
Run the API server for the development environment.
Starts uvicorn programmatically for convenience and documentation.
Usage:
ralph runserver [OPTIONS]
Options:
-b, --backend [es|mongo|clickhouse]
Backend [required]
clickhouse backend:
--clickhouse-client-options KEY=VALUE,KEY=VALUE
--clickhouse-password TEXT
--clickhouse-username TEXT
--clickhouse-event-table-name TEXT
--clickhouse-database TEXT
--clickhouse-port INTEGER
--clickhouse-host TEXT
mongo backend:
--mongo-client-options KEY=VALUE,KEY=VALUE
--mongo-collection TEXT
--mongo-database TEXT
--mongo-connection-uri TEXT
es backend:
--es-op-type TEXT
--es-client-options KEY=VALUE,KEY=VALUE
--es-index TEXT
--es-hosts VALUE1,VALUE2,VALUE3
-h, --host TEXT LRS server host name
-p, --port INTEGER LRS server port
--help Show this message and exit.
ralph validate¶
Validate input events of given format.
Usage:
ralph validate [OPTIONS]
Options:
-f, --format [edx|xapi] Input events format to validate [required]
-I, --ignore-errors Continue validating regardless of raised errors
-F, --fail-on-unknown Stop validating at first unknown event
--help Show this message and exit.
ralph write¶
Write an archive to a configured backend.
Usage:
ralph write [OPTIONS] [ARCHIVE]
Options:
-b, --backend [es|mongo|clickhouse|ldp|fs|swift|s3|lrs]
Backend [required]
lrs backend:
--lrs-statements-endpoint TEXT
--lrs-status-endpoint TEXT
--lrs-headers KEY=VALUE,KEY=VALUE
--lrs-password TEXT
--lrs-username TEXT
--lrs-base-url TEXT
s3 backend:
--s3-endpoint-url TEXT
--s3-bucket-name TEXT
--s3-default-region TEXT
--s3-session-token TEXT
--s3-secret-access-key TEXT
--s3-access-key-id TEXT
swift backend:
--swift-os-identity-api-version TEXT
--swift-os-auth-url TEXT
--swift-os-project-domain-name TEXT
--swift-os-user-domain-name TEXT
--swift-os-storage-url TEXT
--swift-os-region-name TEXT
--swift-os-password TEXT
--swift-os-username TEXT
--swift-os-tenant-name TEXT
--swift-os-tenant-id TEXT
fs backend:
--fs-path TEXT
ldp backend:
--ldp-stream-id TEXT
--ldp-service-name TEXT
--ldp-consumer-key TEXT
--ldp-application-secret TEXT
--ldp-application-key TEXT
--ldp-endpoint TEXT
clickhouse backend:
--clickhouse-client-options KEY=VALUE,KEY=VALUE
--clickhouse-password TEXT
--clickhouse-username TEXT
--clickhouse-event-table-name TEXT
--clickhouse-database TEXT
--clickhouse-port INTEGER
--clickhouse-host TEXT
mongo backend:
--mongo-client-options KEY=VALUE,KEY=VALUE
--mongo-collection TEXT
--mongo-database TEXT
--mongo-connection-uri TEXT
es backend:
--es-op-type TEXT
--es-client-options KEY=VALUE,KEY=VALUE
--es-index TEXT
--es-hosts VALUE1,VALUE2,VALUE3
-c, --chunk-size INTEGER Get events by chunks of size #
-f, --force Overwrite existing archives or records
-I, --ignore-errors Continue writing regardless of raised errors
-s, --simultaneous With HTTP backend, POST all chunks
simultaneously (instead of sequentially)
-m, --max-num-simultaneous INTEGER
The maximum number of chunks to send at
once, when using `--simultaneous`. Use `-1`
to not set a limit.
-t, --target TEXT Endpoint in which to write events (e.g.
`statements`)
--help Show this message and exit.