Installation of a dedicated server from the API

Requirements:

You can also launch the installation of a dedicated server from our API.
This advanced features allows you for example to automatise the installation with your own scripts.
You can find more information about the API in the API documentation.

The API call is has to be made as POST request, at the following endpoint /api/v1/server/install/$server_id.

General configuration

Following a list of available parameters:

“os_id”, type=“int”
The ID of the OS that shall be installed. A complete list of the available OS can be found with the following call GET /server/operatingSystems/$server_id.

“hostname”, type=“string”, nullable=true
The desired hostname for the installation

“hostname”, type=“string”, nullable=true
Activation (or not) of Hardware watch

“hardware_watch_phone”, type=“bool”, default=true
If you want to be called before an intervention is launched on the server

“send_mail_monitoring”, type=“bool”, default=true
Send an email in case the server does not ping any more

“partitioning”, type=“array”, nullable=true, array=true
One of the two methods to specify the partition layout

“partitioning_template_ref”, type=“string”, nullable=true
One of the two methods to specify the partition layout

“user_login”, type=“string”, nullable=true
Login of the user

“user_password”, type=“string”, nullable=true
Password of the user

“root_password”, type=“string”, nullable=true
Root password (Note: Not required for certain distributions like Ubuntu)

“panel_password”, type=“string”, nullable=true
Panel password (Note: Only required for certain distributions like Plesk, cPanel or Owncloud)

“ssh_keys”, type=“json”, nullable=true
UUID of the SSH keys of the user to login without a password.
You can manage your keys directly from the management console

Partitioning

"RAW" partitioning

You can send the complete partitioning of each disk directly via the API call:

  • Mount point
  • Size
  • Partiton type (Logical, Primary, Extended)
  • Filesystem
  • RAID level

The following method has to be used to send the details: “partitioning”, type=“array”, nullable=true, array=true.
Following an example for a server in RAID0 on three disks:

"partitioning": {        
    "A": {
          "type": ["P","P","P"],
          "fstype": ["ext4","ext4","swap"],
          "mount": ["/boot","/",""],
          "size": ["200","100000","1024"],            
          "raid": ["1","0","non"]        },        
    "B": {            
          "type": ["P","P","P"],
          "fstype": ["ext4","ext4","swap"],            
          "mount": ["/boot","/",""],            
          "size": ["200","100000","1024"],            
          "raid": ["1","0","non"]        },        
    "C": {            
          "type": ["P","P","P"],            
          "fstype": ["ext4","ext4","swap"],            
          "mount": ["/boot","/",""],            
          "size": ["200","100000","1024"],            
          "raid": ["1","0","non"]        
         }    
        }

"Predefined" partitioning

You can define pre-established partition schemes for reuse without problems.
You will define the schema in your console, as you would do it during a classical installation.
“Partitioning_template_ref”, type = “string”, nullable = true
This allows you to simplify the installations. To create a new template in your account, go to “API” for in the template management:

You can then consult the list of available templates, and their UUIDs:

You see that you can create a new template. You can also “Create from a server” by filling in the server ID.
The system will create a new template that can be used by the API from an already installed server.
Finally, on the creation view, as during an installation, you are able to define the different states of the partitions.

The installation via the API uses the same system as the management console. We remind you to:
  • Always use a / and /boot partition
  • Prefer the EXT4 file stystem
  • Not to configure RAID on SWAP partitions
  • Not to configure / & /boot in RAID0