v1

latestSwagger 2.02026-07-178567199.3 KB
databases

Create new database for a source

post/sources/{id}/dbs/

Path parameters

idstring required

ID of the data source

Request body

namestring required

The identifying name of the database

durationstring

the duration of the default retention policy

replicationinteger

how many copies of the data are stored in the cluster

shardDurationstring

the interval spanned by each shard group

Example request

{
  "name": "NOAA_water_database",
  "duration": "3d",
  "replication": 3,
  "shardDuration": "3h",
  "retentionPolicies": [
    {
      "name": "weekly",
      "duration": "7d",
      "replication": 1,
      "shardDuration": "7d",
      "default": true,
      "links": {
        "self": "/chronograf/v1/sources/1/dbs/NOAA_water_database/rps/liquid"
      }
    }
  ],
  "links": {
    "self": "/chronograf/v1/sources/1/dbs/NOAA_water_database",
    "rps": "/chronograf/v1/sources/1/dbs/NOAA_water_database/rps",
    "measurements": "/chronograf/v1/sources/1/dbs/NOAA_water_database/measurements?limit=100&offset=0"
  }
}

Response

Database successfully created.

namestring required

The identifying name of the database

durationstring

the duration of the default retention policy

replicationinteger

how many copies of the data are stored in the cluster

shardDurationstring

the interval spanned by each shard group

Example response

{
  "name": "NOAA_water_database",
  "duration": "3d",
  "replication": 3,
  "shardDuration": "3h",
  "retentionPolicies": [
    {
      "name": "weekly",
      "duration": "7d",
      "replication": 1,
      "shardDuration": "7d",
      "default": true,
      "links": {
        "self": "/chronograf/v1/sources/1/dbs/NOAA_water_database/rps/liquid"
      }
    }
  ],
  "links": {
    "self": "/chronograf/v1/sources/1/dbs/NOAA_water_database",
    "rps": "/chronograf/v1/sources/1/dbs/NOAA_water_database/rps",
    "measurements": "/chronograf/v1/sources/1/dbs/NOAA_water_database/measurements?limit=100&offset=0"
  }
}