Services

List services

GET /servers/{serverId}/services

HTTP Request
GET https://manage.runcloud.io/api/v2/servers/{serverId}/services
Request
curl --request GET \
  --url https://manage.runcloud.io/api/v2/servers/7/services \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
{
	"beanstalk": {
		"realName": "beanstalkd",
		"name": "Beanstalk",
		"memory": "1.2 MB",
		"cpu": "0.0000%",
		"running": true,
		"version": "1.10-3"
	},
	"httpd": {
		"realName": "apache2-rc",
		"name": "HTTPD/Apache",
		"memory": "30 MB",
		"cpu": "0.0024%",
		"running": true,
		"version": "2.4.39-1+ubuntu16.04+1"
	},
	"mariadb": {
		"realName": "mysql",
		"name": "MariaDB",
		"memory": "50 MB",
		"cpu": "0.0939%",
		"running": true,
		"version": "10.2.22+maria~xenial"
	},
	"memcached": {
		"realName": "memcached",
		"name": "Memcached",
		"memory": "Service stopped",
		"cpu": "Service stopped",
		"running": false,
		"version": "1.4.25-2ubuntu1.4"
	},
	"nginx": {
		"realName": "nginx-rc",
		"name": "NGiNX",
		"memory": "24 MB",
		"cpu": "0.0003%",
		"running": true,
		"version": "1.15.10-1+ubuntu16.04+1"
	},
	"redis": {
		"realName": "redis-server",
		"name": "Redis",
		"memory": "4.2 MB",
		"cpu": "0.0557%",
		"running": true,
		"version": "2:3.0.6-1ubuntu0.3"
	},
	"supervisor": {
		"realName": "supervisord",
		"name": "Supervisor",
		"memory": "Service stopped",
		"cpu": "Service stopped",
		"running": false,
		"version": "3.3.5"
	}
}

Trigger systemctl command

Parameters
actionrequiredStringThe action will be one of these: start,stop,restart,reload
realNamerequiredStringYou can get this from service.realName. E.g: redis-server

PATCH /servers/{serverId}/services

HTTP Request
PATCH https://manage.runcloud.io/api/v2/servers/{serverId}/services
Request
curl --request PATCH \
  --url https://manage.runcloud.io/api/v2/servers/7/services \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{
    "action": "start",
    "realName": "apache2-rc"
}'
Response
{
	"action": "start",
	"realName": "apache2-rc",
	"name": "apache2-rc"
}