GET /views

Obtiene la lista de vistas definidas en el sistema.

GET /views.json Obtiene todas las vistas
GET /views/22.json
GET /viewss.json?id=22
Obtiene la vista cuyo id es el 22.
GET /viewss.json?type=Servicio Internet Obtiene las vistas que cumplen los criterios de filtrado especificados.
En este caso de tipo "Servicio Internet"

Parámetros 

Nombre Tipo Necesario Valor por defecto Descrpción
id Entero No Ninguno Es el identificador del dispositivo
redalerts Entero No Ninguno Número de alertas rojas
orangealerts Entero No Ninguno Número de alertas noaranjas
yellowalerts Entero No Ninguno Número de alertas amarillas
bluealerts Entero No Ninguno Número de alertas azules
nmetrics Entero No Ninguno Número de métricas en la vista.
nremote Entero No Ninguno Número de alertas remotas en la vista.
sev Entero No Ninguno Severidad
name Texto No Ninguno Nombre de la vista
itil Texto No Ninguno Categoria ITIL de la vista
type Texto No Ninguno Tipo de la vista
livemetric Texto No Ninguno Indica si las métricas se actualizan automáticamente
liveremote Texto No Ninguno Indica si las alertas remotas se actualizan automáticamente  

Códigos de respuesta

Código Descripción
200 Resultado correcto
400 Error en la petición.
401 Error de autenticación.
403 Error por falta de permisos.
500 Error interno del servidor

Valor devuelto

Devuelve un vector de datos codificado en json.

{"id":"15","redalerts":"0","orangealerts":"0","yellowalerts":"0","bluealerts":"0","nmetrics":"0","nremote":"0","sev":"6","name":"Internet - Servicio DNS","itil":"4","type":"Servicios","livemetric":"0","liveremote":"0"}

Los campos se corresponden con los parámetros especificados previamente.

Ejemplos

cnm@cnm-devel:/opt/cnm/onm/api# curl -ki -H "Authorization: 32c47fc221f9b5c0c7b7b500a6e08c83" "https://localhost/onm/api/1.0/views.json"

HTTP/1.1 200 OK
Date: Thu, 13 Feb 2014 17:20:42 GMT
Server: Apache/2.2.16 (Debian) PHP/5.3.3-7 with Suhosin-Patch proxy_html/3.0.1
mod_ssl/2.2.16 OpenSSL/0.9.8o mod_perl/2.0.4 Perl/v5.10.1
X-Powered-By: PHP/5.3.3-7
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
:
Vary: Accept-Encoding
Content-Length: 3409
Content-Type: text/html; charset=utf-8

[{"id":"18","redalerts":"1","orangealerts":"0","yellowalerts":"0","bluealerts":"0","nmetrics":"0", "nremote":"0","sev":"6","name":"Madrid Central - Servidores de Desarrollo 2","itil":"4","type":"Infrastructura","livemetric":"0","liveremote":"1"},{"id":"21","redalerts":"1","orangealerts":"0","yellowalerts":"0","bluealerts":"0","nmetrics":"8", "nremote":"0","sev":"1","name":"Madrid Central - Infraestructura Virtual","itil":"4","type":"Infrastructura","livemetric":"0","liveremote":"0"},{"id":"22","redalerts":"2","orangealerts":"0","yellowalerts":"0","bluealerts":"1","nmetrics":"2", "nremote":"3","sev":"1","name":"S30LABS - Servicios de TI","itil":"4","type":"Servicios","livemetric":"0","liveremote":"0"},{"id":"26","redalerts":"0","orangealerts":"0","yellowalerts":"0","bluealerts":"0","nmetrics":"1", "nremote":"0","sev":"6","name":"Resumen atmosf\u00e9rico","itil":"1","type":"Infrastructura","livemetric":"0","liveremote":"0"},{"id":"27","redalerts":"11","orangealerts":"2","yellowalerts":"1","bluealerts":"5","nmetrics":"92", "nremote":"136","sev":"1","name":"probando2","itil":"1","type":"Infrastructura", "livemetric":"1","liveremote":"1"},{"id":"28","redalerts":"0","orangealerts":"0","yellowalerts":"0","bluealerts":"0","nmetrics":"6", "nremote":"3","sev":"6","name":"Trafico de Interfaces","itil":"3","type":"Infrastructura","livemetric":"0","liveremote":"0"}]