diff options
author | ramon <ramongomez@us.es> | 2016-04-08 08:41:34 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2016-04-08 08:41:34 +0000 |
commit | 492bf9cfb8ab1043da8f65e9576aa534a1eeedb5 (patch) | |
tree | 7e974464237b60452316f7de5cb8c156358d5d53 /admin/WebConsole/rest/index.php | |
parent | 1feb465524bd9a0d10de0af0ea97201a716f3476 (diff) |
#708: Adaptar algunas respuestas REST a la documentación y comentar cambios futuros.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@4868 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'admin/WebConsole/rest/index.php')
-rw-r--r-- | admin/WebConsole/rest/index.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/admin/WebConsole/rest/index.php b/admin/WebConsole/rest/index.php index 2f19f34d..f43ebda5 100644 --- a/admin/WebConsole/rest/index.php +++ b/admin/WebConsole/rest/index.php @@ -144,8 +144,8 @@ function checkAdmin($adminid) { /** - * @#fn sendCommand($serverip, $serverport, $reqframe, &$values) - * @brief Send a command to OpenGnsys ogAdmServer and get request. + * @#fn sendCommand($serverip, $serverport, $reqframe, &$values) + * @brief Send a command to an OpenGnsys ogAdmServer and get request. * @param string serverip Server IP address. * @param string serverport Server port. * @param string reqframe Request frame (field's separator is "\r"). @@ -451,8 +451,8 @@ $app->get('/ous/:ouid/labs/:labid/clients/:clntid', 'validateApiKey', $response['clientname'] = $rs->campos["nombreordenador"]; $response['netiface'] = $rs->campos["netiface"]; $response['netdriver'] = $rs->campos["netdriver"]; - $response['macaddress'] = $rs->campos["mac"]; - $response['ipaddress'] = $rs->campos["ip"]; + $response['mac'] = $rs->campos["mac"]; + $response['ip'] = $rs->campos["ip"]; $response['netmask'] = $rs->campos["mascara"]; $response['routerip'] = $rs->campos["router"]; $response['repoid'] = $rs->campos["idrepositorio"]; @@ -563,8 +563,10 @@ EOD; $tmp['usage'] = $rs->campos["uso"]; if ($rs->campos["nombreso"] != null) { $tmp['os'] = $rs->campos["nombreso"]; - $tmp['idimage'] = $rs->campos["idimagen"]; + $tmp['imageid'] = $rs->campos["idimagen"]; $tmp['deploydate'] = $rs->campos["fechadespliegue"]; + // Comprobar si la imagen está actualizada. + //$tmp['updated'] = indica si la imagen está actualizada } //$tmp['cachedata'] = $rs->campos["cache"]; } @@ -600,6 +602,10 @@ EOD; if (!$rs->Abrir()) return(false); // Error al abrir recordset $rs->Primero(); if (checkParameter($rs->campos["idordenador"])) { + // + // Probar primero el estado de OGAgent y luego de ogAdmClient + // + $serverip = $rs->campos["ipserveradm"]; $serverport = $rs->campos["portserveradm"]; $clientid = $rs->campos["idordenador"]; @@ -717,7 +723,7 @@ $app->get('/ous/:ouid/repos/:repoid', 'validateApiKey', $response['reponame'] = $rs->campos["nombrerepositorio"]; $response['description'] = $rs->campos["comentarios"]; $response['ipaddress'] = $rs->campos["ip"]; - $response['port'] = $rs->campos["puertorepo"]; + //$response['port'] = $rs->campos["puertorepo"]; jsonResponse(200, $response); } $rs->Cerrar(); @@ -790,6 +796,7 @@ $app->get('/ous/:ouid/images/:imgid', 'validateApiKey', $response['disk'] = $rs->campos["numdisk"]; $response['partition'] = $rs->campos["numpar"]; $response['creationdate'] = $rs->campos["fechacreacion"]; + //$response['imagerelease'] = revisión de la aimagen } jsonResponse(200, $response); } |