Available binary

GET /servers/{serverId}/supervisors/binaries

HTTP Request
GET https://manage.runcloud.io/api/v2/servers/{serverId}/supervisors/binaries
Request
curl --request GET \
  --url https://manage.runcloud.io/api/v2/servers/7/supervisors/binaries \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
[
    "",
    "/RunCloud/Packages/php55rc/bin/php",
    "/RunCloud/Packages/php56rc/bin/php",
    "/RunCloud/Packages/php70rc/bin/php",
    "/RunCloud/Packages/php71rc/bin/php",
    "/RunCloud/Packages/php72rc/bin/php",
    "/RunCloud/Packages/php73rc/bin/php",
    "/usr/bin/node"
]

Create job

POST /servers/{serverId}/supervisors

Parameters
label requiredStringLabel of the job
username requiredStringLinux System User that will be running this job
autoRestart optionalBooleanAuto restart if job failed
autoStart optionalBooleanAuto start once supervisors start running
numprocs requiredIntegerNumber of background job to run for this job
binary optionalStringUse one of the available binary selection
directory optionalStringDirectory which you wanted supervisor job to start
command requiredStringCommand you wanted to run
HTTP Request
POST https://manage.runcloud.io/api/v2/servers/{serverId}/supervisors
Request
curl --request POST \
  --url https://manage.runcloud.io/api/v2/servers/7/supervisors \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{
    "label": "my-first-job",
    "username": "runcloud",
    "numprocs": 5,
    "autoStart": true,
    "autoRestart": true,
    "binary": "/RunCloud/Packages/php73rc/bin/php",
    "command": "/home/runcloud/queue.php"
}'
Response
{
    "id": 12,
    "label": "my-first-job",
    "username": "runcloud",
    "numprocs": 5,
    "autoStart": true,
    "autoRestart": true,
    "directory": "/",
    "command": "/RunCloud/Packages/php73rc/bin/php /home/runcloud/queue.php",
    "created_at": "2019-06-22 09:35:01"
}

List jobs

GET /servers/{serverId}/supervisors

List all supervisor jobs.

Query String Parameters
search optionalStringSearch job label
HTTP Request
GET https://manage.runcloud.io/api/v2/servers/{serverId}/supervisors
Request
curl --request GET \
  --url https://manage.runcloud.io/api/v2/servers/7/supervisors \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
{
    "data": [
        {
            "id": 12,
            "label": "my-first-job",
            "username": "runcloud",
            "numprocs": 5,
            "autoStart": true,
            "autoRestart": true,
            "directory": "/",
            "command": "/RunCloud/Packages/php73rc/bin/php /home/runcloud/queue.php",
            "created_at": "2019-06-22 09:35:01"
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": {}
        }
    }
}

List jobs status

GET /servers/{serverId}/supervisors/status

HTTP Request
GET https://manage.runcloud.io/api/v2/servers/{serverId}/supervisors/status
Request
curl --request GET \
  --url https://manage.runcloud.io/api/v2/servers/7/supervisors/status \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
{
    "my-first-job": [
        {
            "process": "my-first-job_0",
            "status": "RUNNING",
            "pid": "35200",
            "uptime": "0:00:36"
        },
        {
            "process": "my-first-job_1",
            "status": "RUNNING",
            "pid": "35201",
            "uptime": "0:00:36"
        },
        {
            "process": "my-first-job_2",
            "status": "RUNNING",
            "pid": "35198",
            "uptime": "0:00:36"
        },
        {
            "process": "my-first-job_3",
            "status": "RUNNING",
            "pid": "35199",
            "uptime": "0:00:36"
        },
        {
            "process": "my-first-job_4",
            "status": "RUNNING",
            "pid": "35197",
            "uptime": "0:00:36"
        }
    ]
}

Rebuild jobs

Rebuild all supervisor jobs.

POST /servers/{serverId}/supervisors/rebuild

HTTP Request
POST https://manage.runcloud.io/api/v2/servers/{serverId}/supervisors/rebuild
Request
curl --request POST \
  --url https://manage.runcloud.io/api/v2/servers/7/supervisors/rebuild \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response

Job object

Get supervisor job.

GET /servers/{serverId}/supervisors/{supervisorId}

HTTP Request
GET https://manage.runcloud.io/api/v2/servers/{serverId}/supervisors/{supervisorId}
Request
curl --request GET \
  --url https://manage.runcloud.io/api/v2/servers/7/supervisors/13 \
  -u YOUR_API_KEY:YOUR_API_SECRET \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
{
    "id": 13,
    "label": "my-first-job",
    "username": "runcloud",
    "numprocs": 5,
    "autoStart": true,
    "autoRestart": true,
    "directory": "/",
    "command": "/RunCloud/Packages/php73rc/bin/php /home/runcloud/queue.php",
    "created_at": "2019-06-22 09:55:07"
}

Reload job

Reload a supervisor job.

PATCH /servers/{serverId}/supervisors/{supervisorId}/reload

HTTP Request
PATCH https://manage.runcloud.io/api/v2/servers/{serverId}/supervisors/{supervisorId}/reload
Request
curl --request POST \
  --url https://manage.runcloud.io/api/v2/servers/7/supervisors/13/reload \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
{
    "id": 13,
    "label": "my-first-job",
    "username": "runcloud",
    "numprocs": 5,
    "autoStart": true,
    "autoRestart": true,
    "directory": "/",
    "command": "/RunCloud/Packages/php73rc/bin/php /home/runcloud/queue.php",
    "created_at": "2019-06-22 09:55:07"
}

Delete job

Delete a job.

DELETE /servers/{serverId}/supervisors/{supervisorId}

HTTP Request
DELETE https://manage.runcloud.io/api/v2/servers/{serverId}/supervisors/{supervisorId}
Request
curl --request DELETE \
  --url https://manage.runcloud.io/api/v2/servers/7/supervisors/13 \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response
{
    "id": 13,
    "label": "my-first-job",
    "username": "runcloud",
    "numprocs": 5,
    "autoStart": true,
    "autoRestart": true,
    "directory": "/",
    "command": "/RunCloud/Packages/php73rc/bin/php /home/runcloud/queue.php",
    "created_at": "2019-06-22 09:55:07"
}