API Documentation

A documentation for developer

Services

GET List services

HTTP Request

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

Request

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

Response

{
    "data": [
        {
            "realName": "nginx-rc",
            "name": "NGiNX",
            "Memory": "81 MB",
            "CPU": "0.0006%",
            "Running": true,
            "Version": "1.13.7-0ubuntu2"
        },
        {
            "realName": "apache2-rc",
            "name": "HTTPD\/Apache",
            "Memory": "24 MB",
            "CPU": "0.0022%",
            "Running": true,
            "Version": "2.4.29-0ubuntu2"
        },
        {
            "realName": "mysql",
            "name": "MariaDB",
            "Memory": "18 MB",
            "CPU": "0.0241%",
            "Running": true,
            "Version": "10.1.30+maria-1~xenial"
        },
        {
            "realName": "supervisord",
            "name": "Supervisord",
            "Memory": "11 MB",
            "CPU": "0.0110%",
            "Running": true,
            "Version": "3.3.1"
        },
        {
            "realName": "redis-server",
            "name": "Redis",
            "Memory": "1.7 MB",
            "CPU": "0.0559%",
            "Running": true,
            "Version": "2:3.0.6-1"
        },
        {
            "realName": "memcached",
            "name": "Memcached",
            "Memory": "Service stopped",
            "CPU": "Service stopped",
            "Running": false,
            "Version": "1.4.25-2ubuntu1.2"
        },
        {
            "realName": "beanstalkd",
            "name": "Beanstalkd",
            "Memory": "Service stopped",
            "CPU": "Service stopped",
            "Running": false,
            "Version": "1.10-3"
        }
    ]
}

PATCH Trigger systemctl command

HTTP Request

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

Arguments

Parameters Required Description
action YES The action will be one of these: start,stop,restart,reload
realName YES You can get this from service.realName. E.g: redis-server
name YES The name of the service. You can get this from service.name. E.g: Redis

Request

curl -X PATCH "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/services" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "action": "start",
        "realName": "redis-server",
        "name": "Redis"
    }'

Response

{
    "message": "Successfully start service Redis. Changes will happen in a few moments."
}