Create Database

Creates a new database in your server

POST api/servers/{server}/databases

Parameters

Parameter Type Status Description
name string required Allowed: alpha-numeric characters, as well as dashes and underscores. Minimum: 2 Maximum: 64 Not in: database
user string optional Allowed: alpha-numeric characters, as well as dashes and underscores. Minimum: 2 Maximum: 64
password string optional

Example request:

curl -X POST "https://ploi.io/api/servers/{server}/databases" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
    -d "name"="voluptas" \
    -d "user"="voluptas" \
    -d "password"="voluptas" \

Example response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "data": {
        "id": 1,
        "type": "mysql",
        "name": "my_database",
        "server_id": 1,
        "status": "created",
        "created_at": "2019-07-16 13:05:58"
    }
}