API Documentation

A documentation for developer

Supervisord

POST Create supervisor job

HTTP Request

POST https://manage.runcloud.io/base-api/servers/<server.id>/supervisord

Arguments

Parameters Required Description
jobName YES Name of the Supervisor Job
user YES Linux System User that will be running this job
autoRestart NO Send true or false to enable auto restart if job failed
autoStart NO Send true or false to enable auto start once supervisord start running
numprocs YES Number of background job to run for this job
vendor YES You can get this from Server Object inside server._extra.supervisord.vendor
command YES String of command you wanted to run

Request

curl -X POST "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/supervisord" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "jobName": "my-first-job",
        "user": "runcloud",
        "numprocs": 1,
        "vendor": "/RunCloud/Packages/php72rc/bin/php",
        "command": "/home/runcloud/webapps/mywebapp/artisan queue:work --tries=3"
    }'

Response

{
    "redirect": "\/supervisord\/yO4VAbX2BkNz\/notconnected"
}

GET List jobs

List all supervisor jobs.

HTTP Request

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

Arguments

Parameters Required Description
page NO Page number of the resources
search NO Searching string if you wanted to search from list of jobs

Request

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

Response

{
    "data": [
        {
            "id": "yO4VAbX2BkNz",
            "name": "my-first-job",
            "user": "runcloud",
            "autoRestart": false,
            "autoStart": false,
            "numprocs": 1,
            "command": "\/RunCloud\/Packages\/php72rc\/bin\/php \/home\/runcloud\/webapps\/mywebapp\/artisan queue:work --tries=3",
            "_links": {
                "reload": {
                    "method": "patch",
                    "link": "\/api\/servers\/yO4VAbX2BkNz\/supervisord\/yO4VAbX2BkNz\/reload"
                },
                "delete": {
                    "method": "delete",
                    "link": "\/api\/servers\/yO4VAbX2BkNz\/supervisord\/yO4VAbX2BkNz"
                }
            }
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 20,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

GET List jobs status

HTTP Request

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

Request

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

Response

[
    {
        "name": "my-first-job",
        "status": "RUNNING"
    }
]

POST Rebuild jobs

Rebuild all supervisor jobs.

HTTP Request

POST https://manage.runcloud.io/base-api/servers/<server.id>/supervisord/rebuild

Request

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

Response

{
    "message": "Your Supervisor job will be rebuilt shortly."
}

GET Job object

Get supervisor job.

HTTP Request

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

Request

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

Response

{
    "id": "yO4VAbX2BkNz",
    "name": "my-first-job",
    "user": "runcloud",
    "autoRestart": false,
    "autoStart": false,
    "numprocs": 1,
    "command": "\/RunCloud\/Packages\/php72rc\/bin\/php \/home\/runcloud\/webapps\/mywebapp\/artisan queue:work --tries=3",
    "_links": {
        "reload": {
            "method": "patch",
            "link": "\/api\/servers\/yO4VAbX2BkNz\/supervisord\/yO4VAbX2BkNz\/reload"
        },
        "delete": {
            "method": "delete",
            "link": "\/api\/servers\/yO4VAbX2BkNz\/supervisord\/yO4VAbX2BkNz"
        }
    }
}

PATCH Reload job

Reload a supervisor job.

HTTP Request

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

Request

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

Response

{
    "message": "Your Supervisor job will reload shortly."
}

DELETE Delete job

Delete a supervisor job.

HTTP Request

DELETE https://manage.runcloud.io/base-api/servers/<server.id>/supervisord/<job.id>

Arguments

Parameters Required Description
jobName YES Name of the Supervisor Job

Request

curl -X DELETE "https://manage.runcloud.io/base-api/servers/yO4VAbX2BkNz/supervisord/yO4VAbX2BkNz" \
    -u YOUR_API_KEY:YOUR_API_SECRET \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    --data '{
        "jobName": "my-first-job"
    }'

Response

{
    "message": "Your Supervisor job my-first-job has been deleted."
}