Create server
Creates a new server in your account. To be able to do this properly you will need 3 key values: plan
, region
and credential
.
These values are available here: Get server providers
You will also need to have server providers added to your account to be able to retrieve these. Setup new server providers in your account here: Server providers
POST api/servers
Parameters
Parameter | Type | Status | Description |
---|---|---|---|
name | string | required | The server name, cannot contain any special characters and is alpha-numeric |
plan | string | required | The plan ID to install the server with |
region | string | required | The region where to install the server with |
credential | integer | required | The server provider from your account - Get server providers |
type | string | required | Type of the server to install, must be either: server , load-balancer , database-server or redis-server |
database_type | string | required | The type of database to install, must be either: none , mysql , mariadb or postgresql |
webserver_type | string | required | The type of webserver to install, must be either: nginx or nginx-apache |
php_version | string | optional | PHP version to install, defaults to 7.1 |
description | string | optional | Allows you to send in an additional description for your server as note |
webhook_url | url | optional | This URL gets triggered by Ploi when installation has completed, you can use this for your own system, this will only send 1 signal, there is no retry schedule |
Example request:
curl -X POST "https://ploi.io/api/servers" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data '{
"name": "awesome-server",
"plan": "1xCPU-1GB",
"region": "nl-ams1",
"credential": 1,
"type": "server",
"database_type": "mysql",
"webserver_type" : "nginx"
}'
Example response:
HTTP/1.1 201 CREATED
Content-Type: application/json
{
"data": {
"id": 2,
"status": "created",
"type": "server",
"name": "awesome-server",
"ip_address": "12.34.56.78",
"php_version": 7.1,
"mysql_version": 5.7,
"sites_count": 0,
"monitoring": false,
"status_id": 0,
"created_at": "2019-01-01 09:00:00"
}
}