Deprecation Notice - RunCloud API Beta is deprecated effective 31 May 2019. New API will be released and it's not backward compatible.

Supervisord

Create supervisor job

Arguments
jobNamerequiredName of the Supervisor Job
userrequiredLinux System User that will be running this job
autoRestartoptionalSend true or false to enable auto restart if job failed
autoStartoptionalSend true or false to enable auto start once supervisord start running
numprocsrequiredNumber of background job to run for this job
vendorrequiredYou can get this from Server Object inside server._extra.supervisord.vendor
commandrequiredString of command you wanted to run

POST /servers/<server.id>/supervisord

HTTP Request
POST https://manage.runcloud.io/base-api/servers/<server.id>/supervisord
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"
}

List jobs

List all supervisor jobs.

Arguments
pageoptionalPage number of the resources
searchoptionalSearching string if you wanted to search from list of jobs

GET /servers/<server.id>/supervisord

HTTP Request
GET https://manage.runcloud.io/base-api/servers/<server.id>/supervisord
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": []
		}
	}
}

List jobs status

GET /servers/<server.id>/supervisord/statuscheck

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"
	}
]

Rebuild jobs

Rebuild all supervisor jobs.

POST /servers/<server.id>/supervisord/rebuild

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."
}

Job object

Get supervisor job.

GET /servers/<server.id>/supervisord/<job.id>

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"
		}
	}
}

Reload job

Reload a supervisor job.

PATCH /servers/<server.id>/supervisord/<job.id>/reload

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 job

Delete a supervisor job.

Arguments
jobNamerequiredName of the Supervisor Job

DELETE /servers/<server.id>/supervisord/<job.id>

HTTP Request
DELETE https://manage.runcloud.io/base-api/servers/<server.id>/supervisord/<job.id>
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."
}