/cloud/stack/get


GET https://api.sitehost.nz/1.0/cloud/stack/get.json

Returns information about a stack.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client that the stack belongs to.Example: 1
serverstringYesThe server where the stack resides.Example: ch-servername
namestringYesThe name of the stack.Example: examplenz

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/cloud/stack/get.json?apikey=your_key_here&client_id=1&server=ch-servername&name=examplenz", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.0/cloud/stack/get.json?apikey=your_key_here&client_id=1&server=ch-servername&name=examplenz");
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/get.json?apikey=your_key_here&client_id=1&server=ch-servername&name=examplenz")
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/get.json?apikey=your_key_here&client_id=1&server=ch-servername&name=examplenz'

response = requests.get(uri)

Response

200:

application/json
{
    "return": {
        "client_id": "1",
        "server_id": "31462",
        "name": "test1nz",
        "label": "test1.nz",
        "docker_file": "docker file contents",
        "date_created": "2016-04-20 11:57:53",
        "pending": null,
        "is_missing": "0",
        "server_name": "ch-mycloud",
        "server_label": "My Cloud",
        "server_owner": true,
        "containers": [
            {
                "name": "test1.nz",
                "container_id": "58ae138422f1e92f9d5f0fe6a886f8666374a4024cee66369183f63e60ec0d7f",
                "state": "Up",
                "size": "265096",
                "date_created": "2016-04-20 11:57:53",
                "pending": null,
                "is_missing": "0",
                "ssl_enabled": false
            }
        ],
        "ip_addr_server": "192.168.11.152"
    },
    "msg": "Successful",
    "status": true
}