datahub-events
dci datahub-events
Sends a batch of events to DataHub.
Request
Content-Type: application/json
Schema
{
"type": "object",
"properties": {
"events": {
"type": "array",
"minItems": 1,
"maxItems": 50000,
"items": {
"type": "object",
"required": [
"provider",
"time"
],
"properties": {
"provider": {
"type": "string",
"description": "The identifier of the data provider. Allowed characters: alphanumeric (0-9,a-z,A-Z), underscore (_), space, dash (-).",
"example": "Datadog"
},
"id": {
"type": "string",
"description": "The event id. Must be unique within the dataset. If not set, a UUIDv4 will be generated at ingestion time.",
"example": "beb21d99-a8c9-4dc0-8a69-5d684cc41e6c"
},
"dimensions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"example": "project_id",
"description": "If the type is `fixed`, the key must be a valid fixed value. See the [DataHub API Guide](https://developer.doit.com/docs/datahub-api) for more information."
},
"type": {
"type": "string",
"description": "The dimension type.",
"x-type": "string",
"enum": [
"fixed",
"label",
"project_label",
"system_label"
]
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "boolean"
}
],
"example": "production-project"
}
}
}
},
"time": {
"type": "string",
"format": "date-time",
"description": "The timestamp of the event in RFC3339 format.",
"example": "2024-03-10T23:00:00Z"
},
"metrics": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": "number",
"format": "double",
"description": "The value of the metric.",
"example": 10.5
},
"type": {
"type": "string",
"description": "The type of the metric. If you choose \"cost\" or \"usage\", it will map to the basic \"Cost\" or \"Usage\" metric in Cloud Analytics reports. You can also use this field to define custom metric types, such as \"working_hours\", \"ride\", etc.",
"example": "cost"
}
}
}
}
}
}
}
}
}
Output
OK - Ingestion succeeded.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
message | string |
Raw JSON schema
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Ingestion success"
}
}
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 500 | 40 | API_SERVER_ERROR | The API failed to process the request. Retryable; contact DoiT support if it persists. |
Aliases: datahubevents