/cloud/stack/image/list_all
GET https://api.sitehost.nz/1.0/cloud/stack/image/list_all.json
Returns a list of stack images.
Query Parameters
Parameter | Type | Required | Description |
client_id | integer | Yes | The ID for the client that the stack images belongs to. |
filters[sort_by] | string | The field name to sort the results by. | |
filters[sort_dir] | string | The direction to sort in. Valid options are ASC and DESC | |
filters[page_size] | integer | The number of items to return per page. | |
filters[page_number] | integer | The page number to return. |
Code Samples
JavaScript PHP Rails Pythonvar xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/cloud/stack/image/list_all.json?apikey=your_key_here", false);
xmlHttp.send();
var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.0/cloud/stack/image/list_all.json?apikey=your_key_here");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
require 'net/http'
require 'uri'
uri = URI.parse("https://api.sitehost.nz/1.0/cloud/stack/image/list_all.json?apikey=your_key_here")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
import requests
uri = 'https://api.sitehost.nz/1.0/cloud/stack/image/list_all.json?apikey=your_key_here'
response = requests.get(uri)
Response
200:application/json
{
"return": [
{
"id": "1",
"client_id": "0",
"label": "Nginx + PHP 7.0",
"code": "sitehost-php7-nginx",
"labels": {
"nz.sitehost.image.volumes": {
"source": "",
"hash": "",
"volumes": {
"crontabs": {
"dest": "/cron",
"mode": "ro"
},
"application": {
"dest": "/container/application",
"mode": "rw"
},
"config": {
"dest": "/container/config",
"mode": "ro"
},
"logs": {
"dest": "/container/logs",
"mode": "rw"
}
}
},
"nz.sitehost.image.provider": "SiteHost",
"nz.sitehost.image.type": "www",
"nz.sitehost.image.label": "Nginx + PHP 7.0",
"nz.sitehost.image.ports": {
"80": {
"protocol": "tcp",
"publish": false,
"exposed": true
}
}
},
"changelog": "",
"date_added": "2016-07-26 16:49:44",
"date_updated": "2021-09-20 13:18:55",
"is_public": "1",
"is_missing": "0",
"project_id": "0",
"registry_id": "0",
"forked_from": null,
"pending": null,
"versions": [
{
"id": "542",
"client_id": "0",
"image_id": "116",
"version": "1.0.0",
"labels": "",
"date_added": "2016-09-08 15:32:28",
"date_updated": "2020-06-09 17:31:52",
"is_missing": "1",
"force_config": "1",
"build_id": "0",
"build_status": "success",
"pending": null
}
]
}
],
"msg": "Successful",
"status": true
}
"return": [
{
"id": "1",
"client_id": "0",
"label": "Nginx + PHP 7.0",
"code": "sitehost-php7-nginx",
"labels": {
"nz.sitehost.image.volumes": {
"source": "",
"hash": "",
"volumes": {
"crontabs": {
"dest": "/cron",
"mode": "ro"
},
"application": {
"dest": "/container/application",
"mode": "rw"
},
"config": {
"dest": "/container/config",
"mode": "ro"
},
"logs": {
"dest": "/container/logs",
"mode": "rw"
}
}
},
"nz.sitehost.image.provider": "SiteHost",
"nz.sitehost.image.type": "www",
"nz.sitehost.image.label": "Nginx + PHP 7.0",
"nz.sitehost.image.ports": {
"80": {
"protocol": "tcp",
"publish": false,
"exposed": true
}
}
},
"changelog": "",
"date_added": "2016-07-26 16:49:44",
"date_updated": "2021-09-20 13:18:55",
"is_public": "1",
"is_missing": "0",
"project_id": "0",
"registry_id": "0",
"forked_from": null,
"pending": null,
"versions": [
{
"id": "542",
"client_id": "0",
"image_id": "116",
"version": "1.0.0",
"labels": "",
"date_added": "2016-09-08 15:32:28",
"date_updated": "2020-06-09 17:31:52",
"is_missing": "1",
"force_config": "1",
"build_id": "0",
"build_status": "success",
"pending": null
}
]
}
],
"msg": "Successful",
"status": true
}