databases

Create new database for a source

post/sources/{id}/dbs/

Request

  • Base URL
    /chronograf/v1 (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /chronograf/v1/sources/{id}/dbs/
  • Auth
    none declared

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"
  }
}

Changes

No recorded changes to this operation across all 71 revisions of this API.