cloud events¶
NAME¶
phyware cloud events — ingest and query events in PhyCloud.
SYNOPSIS¶
phyware cloud events send [OPTIONS] --source-id <ID> --payload <JSON>
phyware cloud events batch [OPTIONS] --file <NDJSON>
phyware cloud events list [OPTIONS]
phyware cloud events get [OPTIONS] <EVENT_ID>
DESCRIPTION¶
send¶
Ingests a single structured event into the PhyCloud ledger. The payload must be a valid JSON object. The event is assigned a unique ID and appended to the hash-chain for the given source.
batch¶
Ingests multiple events from a newline-delimited JSON (NDJSON) file. Each line must be a valid JSON object. Useful for bulk imports.
list¶
Lists events with optional filters. Returns a paginated list.
get¶
Fetches a single event by its ID.
OPTIONS¶
| Flag | Type | Required | Default | Env |
|---|---|---|---|---|
--url | string | No | http://localhost:8000 | PHYCLOUD_URL |
--api-key | string | No | — | PHYCLOUD_API_KEY |
--output | enum | No | table | — |
| --source-id | string | Yes (send/batch) | — | — | | --payload | string | Yes (send) | — | — | | --file | path | Yes (batch) | — | — | | --tenant-id | string | No | (active) | — | | --limit | int | No | 20 | — | | --cursor | string | No | — | — |
ARGUMENTS¶
| Name | Required | Description |
|---|---|---|
EVENT_ID | Yes (get) | Unique event identifier |
INPUT¶
For send, the --payload flag accepts a JSON string. For batch, a path to an NDJSON file (one JSON object per line).
OUTPUT¶
| Field | Type | Description |
|---|---|---|
event_id | string | Assigned event ID |
status | string | accepted or rejected |
events | array | (list) array of event objects |
EXIT CODES¶
| Code | Meaning |
|---|---|
0 | Success |
1 | Generic / connection error |
2 | Authentication / authorisation error |
3 | Resource not found |
4 | Validation error |
5 | Server-side error |
EXAMPLES¶
# Send a single event
phyware cloud events send --source-id src_xyz --payload '{"temperature":22.5}'
# Batch ingest from file
phyware cloud events batch --file ./events.ndjson
# List recent events
phyware cloud events list --limit 50
# List events for a specific tenant
phyware cloud events list --tenant-id ten_abc123 --output json
# Get a specific event
phyware cloud events get evt_abc123
AGENT NOTES¶
For machine ingestion prefer batch over repeated send calls. Use --output json when capturing event IDs programmatically. The list command is paginated — follow cursor until next_cursor is null. Requires write:events (send/batch) or read:events (list/get) scope.
SEE ALSO¶
ERRORS¶
| Code | Message | Remediation |
|---|---|---|
INVALID_JSON | Payload is not valid JSON | Fix the JSON payload |
NOT_FOUND | Source not found | Check --source-id |
UNAUTHORIZED | Invalid API key | Run phyware auth login |