Server

On this page, we'll dive into the different server endpoints you can use to manage servers programmatically. We'll look at how to query, create, update, and delete servers.

The server model

The server model contains all the information about your servers, such as their hostname, configuration, and status.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the server.

  • Name
    hostname
    Type
    string
    Description

    The hostname for the server.

  • Name
    uuid
    Type
    string
    Description

    The uuid for the server.

  • Name
    status
    Type
    string
    Description

    The current status of the server

  • Name
    node
    Type
    string
    Description

    The name of the node where the server is running

  • Name
    os
    Type
    string
    Description

    The name of the installed operating system

  • Name
    specifications
    Type
    array
    Description

    List of the server specifications

  • Name
    ip_addresses
    Type
    array
    Description

    List of all ip addresses

  • Name
    usage
    Type
    array
    Description

    Current usage statistics from the server

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the contact was created.


GET/v1/servers

List all servers

This endpoint allows you to retrieve a full list of all your servers.

Request

GET
/v1/servers
curl -G https://evotic.io/api/v1/servers \
  -H "Authorization: Bearer {token}" \

Response

[
  {
    "id": 1,
    "hostname": "srv-evotic",
    "uuid": "74614dff-9c08-55ee-9b2f-01a3b405039a",
    "status": "started",
    "node": "srv-compute-01",
    "os": "Ubuntu 22.04",
    "specifications": {
      "cpu": 1,
      "ram": 2048,
      "disk": 20
    },
    "ip_addresses": [
      {
        "ip": "0.0.0.0",
        "is_primary": true
      }
    ],
    "usage": {
      "cpu": 0,
      "disk": 17.1,
      "ram": 1456,
      "traffic": {
        "incoming": {
          "value": 3930800510,
          "prev": 213530096,
          "is_exceeded": false
        },
        "outgoing": {
          "value": 1467085038,
          "prev": 158715701,
          "is_exceeded": false
        }
      }
    },
    "created_at": "2023-11-03T18:23:02.000000Z"
  }
]

GET/api/v1/servers/{id}

Get server data

This endpoint allows you to retrieve the data for a server.

Request

GET
/api/v1/servers/{id}
curl -G https://evotic.io/api/v1/servers/1 \
  -H "Authorization: Bearer {token}" \

Response

{
    "id": 1,
    "hostname": "srv-evotic",
    "uuid": "74614dff-9c08-55ee-9b2f-01a3b405039a",
    "status": "started",
    "node": "srv-compute-01",
    "os": "Ubuntu 22.04",
    "specifications": {
      "cpu": 1,
      "ram": 2048,
      "disk": 20
    },
    "ip_addresses": [
      {
        "ip": "0.0.0.0",
        "is_primary": true
      }
    ],
    "usage": {
      "cpu": 0,
      "disk": 17.1,
      "ram": 1456,
      "traffic": {
        "incoming": {
          "value": 3930800510,
          "prev": 213530096,
          "is_exceeded": false
        },
        "outgoing": {
          "value": 1467085038,
          "prev": 158715701,
          "is_exceeded": false
        }
      }
    },
    "created_at": "2023-11-03T18:23:02.000000Z"
}

POST/v1/servers

Create a server

This endpoint allows you to create a server.

Required attributes

  • Name
    name
    Type
    string
    Description

    This will be the hostname of the machine.

  • Name
    location_id
    Type
    integer
    Description

    The id from the location where the server should be created.

  • Name
    os_id
    Type
    integer
    Description

    The id from the operating system that should be installed.

  • Name
    password
    Type
    string
    Description

    Sets the password for the root user.

  • Name
    initialCommands
    Type
    array
    Description

    List of commands that should be executed after the installation.

  • Name
    cpu
    Type
    integer
    Description

    The number of CPU cores the server should have.

  • Name
    ram
    Type
    integer
    Description

    The amount of Memory the server should have in MB.

  • Name
    disk
    Type
    integer
    Description

    The amount of disk space the server should have in GB.

Request

POST
/api/v1/servers
curl https://evotic.io/api/v1/servers/1 \
  -H "Authorization: Bearer {token}" \
  -d name="evo-test" \
  ...

Response

{
    "id": 1,
    "hostname": "evo-test",
    "uuid": "74614dff-9c08-55ee-9b2f-01a3b405039a",
    "status": "started",
    "node": "srv-compute-01",
    "os": "Ubuntu 22.04",
    "specifications": {
      "cpu": 1,
      "ram": 1024,
      "disk": 10
    },
    "ip_addresses": [
      {
        "ip": "0.0.0.0",
        "is_primary": true
      }
    ],
    "usage": {
      "cpu": 0,
      "disk": 17.1,
      "ram": 1456,
      "traffic": {
        "incoming": {
          "value": 3930800510,
          "prev": 213530096,
          "is_exceeded": false
        },
        "outgoing": {
          "value": 1467085038,
          "prev": 158715701,
          "is_exceeded": false
        }
      }
    },
    "created_at": "2023-11-03T18:23:02.000000Z"
}

DELETE/api/v1/servers/{id}

Delete a server

This endpoint allows you to delete a server.

Request

DELETE
/api/v1/servers/{id}
curl -X DELETE https://evotic.io/api/v1/servers/1 \
  -H "Authorization: Bearer {token}" \

Response

{
  "message": "Server deleted successfully"
}

GET/api/v1/servers/{id}/status

Retrieve server status

This endpoint allows you to retrieve the data for a server.

Request

GET
/api/v1/servers/{id}/status
curl -G https://evotic.io/api/v1/servers/1 \
  -H "Authorization: Bearer {token}" \

Response

{
    "status": "creating the backup",
    "real_status": "started",
    "is_processing": true,
    "progress": 53,
}