The operations shown here are used to access your data through the Treasure Data’s Database API.

GET database/list

This operation gets the list of all the databases of the account. Returns 401 for unauthorized requests.

HTTP Verb

URI

GET

/v3/database/list

Sample Response

Status: 200 OK

{
  "databases": [
    {
      "count": 5,
      "created_at": "2020-12-31 11:22:33 UTC",
      "delete_protected": true,
      "datatank": true,
      "id": "7",
      "name": "Alpha",
      "organization": "Treasure Data",
      "permission": "string",
      "updated_at": "2020-12-31 11:22:33 UTC"
    }
  ]
}

GET database/show/:database_name

This operation gets a specific database by name.

HTTP Verb

URI

GET

/v3/database/show/:database_name

URI Parameters

Parameter Name

Required

Type

Description

database_name

Yes

String

name of database to be retrieved

Example

Alpha

Sample Response

Status: 200 OK

{
  "count": 5,
  "created_at": "2020-12-31 11:22:33 UTC",
  "delete_protected": true,
  "datatank": true,
  "id": "7",
  "name": "Alpha",
  "organization": "Treasure Data",
  "permission": "string",
  "updated_at": "2020-12-31 11:22:33 UTC"
}

POST database/create/:database_name

This operation creates a new database with a given name.

HTTP Verb

URI

POST

/v3/database/create/:database_name

URI parameters

Parameter Name

Required

Type

Description

database_name

Yes

String

name of the new database to be created

Example

Alpha

Sample Response

Status: 200 OK

{
  "database": "Alpha"
}

POST database/delete/:database_name

This operation deletes a specific database by name.

HTTP Verb

URI

POST

/v3/database/delete/:database_name

URI parameters

Parameter Name

Required

Type

Description

database_name

Yes

String

name of database to be deleted

Sample Response

Status: 200 OK

{
  "database": "Alpha"
}


  • No labels