API Documentation

A documentation for developer

Database

POST Create database user

HTTP Request

POST https://manage.runcloud.io/base-api/servers/<server.id>/databaseusers

Arguments

Parameters Required Description
databaseUser YES Username of the database user
password YES Password for the user
verifyPassword YES Must be same as "Password"

Request

curl -X POST "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/databaseusers" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "databaseUser": "myfirstuser",
        "password": "sup3rs3cr37p455w0rd",
        "verifyPassword": "sup3rs3cr37p455w0rd"
    }'

Response

{
    "message": "Successfully added new database user myfirstuser",
    "redirect": "\/servers\/yO4VAbX2BkNz\/databases"
}

GET List database users

HTTP Request

GET https://manage.runcloud.io/base-api/servers/<server.id>/databaseusers

Arguments

Parameters Required Description
page NO Page number of the resources
name NO Searching string if you wanted to search from list of database user

Request

curl -X GET "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/databaseusers?page=1" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Response

{
    "data": [
        {
            "id": "w749ly7rayrg",
            "name": "myfirstuser",
            "_links": {
                "changepassword": {
                    "method": "patch",
                    "link": "\/api\/servers\/yO4VAbX2BkNz\/databaseusers\/w749ly7rayrg"
                },
                "delete": {
                    "method": "delete",
                    "link": "\/api\/servers\/yO4VAbX2BkNz\/databaseusers\/w749ly7rayrg"
                },
                "revoke": {
                    "method": "delete",
                    "links": []
                }
            }
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 10,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

PATCH Change password for database user

HTTP Request

PATCH https://manage.runcloud.io/base-api/servers/<server.id>/databaseusers/<databaseuser.id>

Arguments

Parameters Required Description
password YES Password for the user
verifyPassword YES Must be same as "password"

Request

curl -X PATCH "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/databaseusers/w749ly7rayrg" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "password": "ch4ng3dmyp4ssw0rd",
        "verifyPassword": "ch4ng3dmyp4ssw0rd"
    }'

Response

{
    "message": "Successfully changed password for myfirstuser.",
    "redirect": "\/servers\/yO4VAbX2BkNz\/databases"
}

POST Create a database

HTTP Request

POST https://manage.runcloud.io/base-api/servers/<server.id>/databases

Arguments

Parameters Required Description
databaseName YES Name of the Database
databaseCollation NO Database collation

Request

curl -X POST "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/databases" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "databaseName": "myfirstdatabase",
        "databaseCollation": "dec8_swedish_ci"
    }'

Response

{
    "message": "Successfully added new database myfirstdatabase.",
    "redirect": "\/servers\/yO4VAbX2BkNz\/databases"
}

GET List databases

HTTP Request

GET https://manage.runcloud.io/base-api/servers/<server.id>/databases

Arguments

Parameters Required Description
page NO Page number of the resources
name NO Searching string if you wanted to search from list of database

Request

curl -X GET "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/databases?page=1" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"

Response

{
    "data": [
        {
            "id": "5xbKlEMeleXZ",
            "name": "myfirstdatabase",
            "collation": "dec8_swedish_ci",
            "restorationStatus": "IDLE",
            "_links": {
                "attachuser": {
                    "method": "patch",
                    "link": "\/api\/servers\/yO4VAbX2BkNz\/databases\/5xbKlEMeleXZ\/attach-user"
                },
                "delete": {
                    "method": "delete",
                    "link": "\/api\/servers\/yO4VAbX2BkNz\/databases\/5xbKlEMeleXZ\/destroy"
                }
            },
            "databaseUsers": []
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 10,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

POST Attach database user to database

HTTP Request

POST https://manage.runcloud.io/base-api/servers/<server.id>/databases/<database.id>/attachuser

Arguments

Parameters Required Description
databaseUser YES Username of a database user that you wanted to attach to this database

Request

curl -X POST "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/databases/5xbKlEMeleXZ/attachuser" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "databaseUser": "myfirstuser"
    }'

Response

{
    "message": "Successfully attach user myfirstuser to database myfirstdatabase",
    "redirect": "\/servers\/yO4VAbX2BkNz\/databases"
}

DELETE Revoke database user from database

HTTP Request

DELETE https://manage.runcloud.io/base-api/servers/<server.id>/databases/<database.id>/attachuser

Arguments

Parameters Required Description
databaseUser YES Username of a database user that you wanted to revoke from this database

Request

curl -X DELETE "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/databases/5xbKlEMeleXZ/attachuser" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "databaseUser": "myfirstuser"
    }'

Response

{
    "message": "Successfully revoke myfirstuser access from myfirstdatabase"
}

DELETE Delete database user

HTTP Request

DELETE https://manage.runcloud.io/base-api/servers/<server.id>/databaseusers/<databaseuser.id>

Arguments

Parameters Required Description
databaseUser YES Username of a database user that you wanted to delete

Request

curl -X DELETE "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/databaseusers/w749ly7rayrg" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "databaseUser": "myfirstuser"
    }'

Response

{
    "message": "Successfully deleted database user myfirstuser"
}

DELETE Delete database

HTTP Request

DELETE https://manage.runcloud.io/base-api/servers/<server.id>/databases/<database.id>

Arguments

Parameters Required Description
databaseName YES Nmae of the database that you wanted to delete

Request

curl -X DELETE "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/databases/5xbKlEMeleXZ" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "databaseName": "myfirstdatabase"
    }'

Response

{
    "message": "Succesfully deleted database myfirstdatabase."
}