Servers

Servers management

List servers

GET https://api.rahona.network/services/servers

Retrieves the list of servers.

[
    {
        "id": "123",
        "name": "vm1"
    },
    ...
]

Get server

GET https://api.rahona.network/services/servers/:id

Retrieves the server.

Path Parameters

NameTypeDescription

id

integer

server id

{  
     "id": 123
     "name": "vm1",
     "status": "UP",
     "cpus": 2,
     "cpu": 8.39,
     "mem": 3807158272, # Bytes
     "maxmem": 4294967296, # Bytes
     "network": [
          {
               "ip": "198.51.100.71",
               "reverse": "71.100.51.198.ip.rahona.network."
               "mask": "255.255.255.255",
               "mac": "	02:00:00:00:00:00",
               "gateway": "198.51.100.254"
          },
          ...
     ]
}

Start server

GET https://api.rahona.network/services/servers/:id/start

Start the server.

Path Parameters

NameTypeDescription

id

integer

server id

{    "message": "Server start successfully"    }

Restart server

GET https://api.rahona.network/services/servers/:id/restart

Restart the server.

Path Parameters

NameTypeDescription

id

integer

server id

{    "message": "Server restart successfully"    }

Stop server

GET https://api.rahona.network/services/servers/:id/stop

Stop the server.

Path Parameters

NameTypeDescription

id

integer

server id

{    "message": "Server stop successfully"    }

Get server graphics

POST https://api.rahona.network/services/servers/:id/graphs

Get servers graphics.

Path Parameters

NameTypeDescription

id

integer

server id

Request Body

NameTypeDescription

timeframe

string

hour | day | week | month

{
    [
        {
            "maxdisk" => 322122547200
            "diskread" => 1888.7111111111
            "diskwrite" => 27991.665777778
            "netout" => 411.74677777778
            "time" => 1589769000
            "maxmem" => 4294967296
            "maxcpu" => 2
            "mem" => 3800528486.4
            "disk" => 0
            "netin" => 646.29266666667
            "cpu" => 0.074558249080812
        },
        {
            "diskwrite" => 32698.481777778
            "diskread" => 3895.7511111111
            "maxdisk" => 322122547200
            "netout" => 346.94211111111
            "time" => 1589830200
            "maxmem" => 4294967296
            "netin" => 611.06288888889
            "disk" => 0
            "mem" => 3815129024.2844
            "maxcpu" => 2
            "cpu" => 0.073981276889674
        }
        ...
    ]
}

Other error codes

403
{    "error": "This service is suspended"    }

Please check in the invoices section.

405
{    "error": "Server already running"    }

You cannot start an already running server 🙄

405
{    "error": "Server already stopped"    }

You cannot stop an already stopped server 🙄

405
{    "error": "Server down, could not restart"    }

You cannot restart an already stopped server 🙄

500
{    "error": "Could not connect to the node"    }

Could not connect to the node : An internal problem has occurred, contact a staff member.

Dernière mise à jour