summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/rest/index.php
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2015-08-05 09:04:14 +0000
committerramon <ramongomez@us.es>2015-08-05 09:04:14 +0000
commit4454169b9cbc4e9ec7d14cdacfa8a335ed37aee2 (patch)
treec610b1d3038093ee15e1a74abc57837ed565a32e /admin/WebConsole/rest/index.php
parent6f62a1aae165c2b9c6b16d59aae5f2d226d78b4b (diff)
#708 #711: Añadir porcentaje de uso de S.F. a los datos devueltos por la API REST.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4668 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/rest/index.php')
-rw-r--r--admin/WebConsole/rest/index.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/admin/WebConsole/rest/index.php b/admin/WebConsole/rest/index.php
index 994c9063..762f810f 100644
--- a/admin/WebConsole/rest/index.php
+++ b/admin/WebConsole/rest/index.php
@@ -37,7 +37,7 @@ $app = new \Slim\Slim(array(
$app->setName('opengnsys');
// Global variables.
-$userid = NULL; // Usuer id. with access to REST API.
+$userid = NULL; // User id. with access to REST API.
// Auxiliar functions.
@@ -50,11 +50,11 @@ $userid = NULL; // Usuer id. with access to REST API.
*/
function jsonResponse($status, $response) {
$app = \Slim\Slim::getInstance();
- // Código HTTP.
+ // HTTP status code.
$app->status($status);
- // Cabecera con tipo de contenido.
+ // Content-type HTTP header.
$app->contentType('application/json');
- // Respuesta JSON.
+ // JSON response.
echo json_encode($response);
}
@@ -97,7 +97,7 @@ function validateApiKey() {
jsonResponse(500, $response);
}
} else {
- # Error: falta clave de la API.
+ // Error: missing API key.
$response['error'] = true;
$response['message'] = 'Missing API key';
jsonResponse(400, $response);
@@ -546,8 +546,9 @@ EOD;
} else {
$tmp['partition'] = $rs->campos["numpar"];
$tmp['parttype'] = $rs->campos["tipopar"];
- $tmp['size'] = $rs->campos["tamano"];
$tmp['filesystem'] = $rs->campos["nemonico"];
+ $tmp['size'] = $rs->campos["tamano"];
+ $tmp['usage'] = $rs->campos["uso"];
if ($rs->campos["nombreso"] != null) {
$tmp['os'] = $rs->campos["nombreso"];
$tmp['idimage'] = $rs->campos["idimagen"];