vserver_graph ()
This function returns requested VPS graph in base64 encoded PNG format.
HTTP Method: | GET | |
---|---|---|
Parameters: | sid | session id* |
vserver_id | unique id of VPS* | |
graph_type | graph type (virt_cpu_total, if_octets, if_packets, disk_octets, disk_ops) | |
Returns: | HTTP code | 200 (OK) |
Function call successful. Reply portion reply contains encoded image data. |
Return errors
Error code | HTTP response code | Description |
---|---|---|
1 | 400 (Bad request) | Function was not performed, because all required parameters were not entered. Reply portion reply is empty. |
3 | 403 (Forbidden) | Function call failed, invalid sid parameter. Create new sid using /api/login function. Reply portion reply is empty. |
4 | 400 (Bad request) | Function call failed, some parameter(s) have invalid value (e.g. contains invalid characters. Reply portion reply specifies invalid parameters. |
5 | 403 (Forbidden) | Function has not been performed, because it is probably an attempt to manipulate VPS that is not in your administration. Reply portion reply is empty. |
6 | 400 (Bad request) | Function call failed, image is temporarily unavailable. Please try it later. |
CURL
curl "https://admin.hosting90.eu/api/vserver_graph?sid=%sid%&virtual_id=%virtual_id%&graph_type=%graph_type%"
PHP Library
$api->vserver_graph(array(
'virtual_id' => %virtual_id%,
'graph_type' => %graph_type%,
));
Example of data output
<?xml version="1.0" encoding="UTF-8"?>
<reply>
<status>
<code>1</code>
<text>Bad parameters (required: sid, vserver_id, graph_type)</text>
</status>
</reply>