メインコンテンツへスキップ

create-datahub-dataset

dci create-datahub-dataset [body]

Creates a new DataHub dataset. A dataset is a logical grouping of events that share the same provider name. Creating a dataset allows you to define metadata such as name and description before ingesting events.

Pass the request body as name: value arguments or pipe JSON on stdin — see Command structure.

Examples

# Create a dataset; its name is the `provider` you will send events under.
dci create-datahub-dataset name: litellm-usage
# Add a description and a preset logo for the DoiT console.
dci create-datahub-dataset name: litellm-usage, logoName: litellm, description: "Token spend exported nightly from LiteLLM"
# Print the created dataset as JSON, for scripts.
dci create-datahub-dataset name: warehouse-costs --output json

Request

Content-Type: application/json

FieldTypeRequiredDescription
namestringyesThe name of the dataset. Allowed characters: alphanumeric (0-9,a-z,A-Z), underscore (_), dash (-), and spaces between words.
descriptionstringAn optional description for the dataset.
displayNamestringOptional human-readable name shown in the DoiT console and in report results instead of name. 1-64 characters after trimming; must not be unique. Ingest always uses name.
logoNamestringAn optional preset logo shown next to the dataset in the DoiT console. One of: "anthropic", "atlassian", "aws", "azure", "chatgpt", "cloudflare", "copilot", "figma", "gcp", "github", "gitlab", "hotjar", ….
Raw JSON schema
{
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the dataset. Allowed characters: alphanumeric (0-9,a-z,A-Z), underscore (_), dash (-), and spaces between words.",
"example": "My Custom Dataset",
"pattern": "^[a-zA-Z0-9_-]+( [a-zA-Z0-9_-]+)*$"
},
"description": {
"type": "string",
"description": "An optional description for the dataset.",
"example": "Dataset for tracking custom business metrics"
},
"displayName": {
"type": "string",
"description": "Optional human-readable name shown in the DoiT console and in report results instead of `name`. 1-64 characters after trimming; must not be unique. Ingest always uses `name`.",
"example": "Datadog (prod)",
"maxLength": 64
},
"logoName": {
"type": "string",
"description": "An optional preset logo shown next to the dataset in the DoiT console.",
"example": "litellm",
"enum": [
"anthropic",
"atlassian",
"aws",
"azure",
"chatgpt",
"cloudflare",
"copilot",
"figma",
"gcp",
"github",
"gitlab",
"hotjar",
"jira",
"litellm",
"miro",
"notion",
"slack",
"wordpress"
]
}
}
}

Output

Created - Dataset created successfully.

By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.

FieldTypeDescription
namestringThe name of the dataset.
descriptionstringThe description of the dataset.
recordsinteger (int64)The number of records in the dataset.
updatedBystringThe email of the user who last updated the dataset.
lastUpdatedstringThe timestamp of the last update.
displayNamestringHuman-readable name shown in the DoiT console and in report results instead of name. Absent when the dataset is displayed by its name. Does not affect ingest, which always uses name as the provider.
logoNamestringThe preset logo shown next to the dataset in the DoiT console. Absent when the dataset has no preset logo.
Raw JSON schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the dataset.",
"example": "My Custom Dataset"
},
"description": {
"type": "string",
"description": "The description of the dataset.",
"example": "Dataset for tracking custom business metrics"
},
"records": {
"type": "integer",
"format": "int64",
"description": "The number of records in the dataset.",
"example": null,
"nullable": true
},
"updatedBy": {
"type": "string",
"description": "The email of the user who last updated the dataset.",
"example": "[email protected]"
},
"lastUpdated": {
"type": "string",
"description": "The timestamp of the last update.",
"example": "2024-03-10T23:00:00Z"
},
"displayName": {
"type": "string",
"description": "Human-readable name shown in the DoiT console and in report results instead of `name`. Absent when the dataset is displayed by its `name`. Does not affect ingest, which always uses `name` as the provider.",
"example": "Datadog (prod)"
},
"logoName": {
"type": "string",
"description": "The preset logo shown next to the dataset in the DoiT console. Absent when the dataset has no preset logo.",
"example": "litellm"
}
}
}

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 to exit code mapping
HTTP statusExit codeError codeMeaning
40030VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
50040API_SERVER_ERRORThe API failed to process the request. Retryable; contact DoiT support if it persists.

Aliases: createdatahubdataset