diff --git a/pandora_console/include/rest-api/readme.md b/pandora_console/include/rest-api/readme.md index 50f7bc74e2..e2ba8fcafe 100644 --- a/pandora_console/include/rest-api/readme.md +++ b/pandora_console/include/rest-api/readme.md @@ -6,109 +6,149 @@ path = `http://localhost/pandora_console/ajax.php` - ## Pedir token: - - **data:** - ```json - { - page: include/rest-api/index, - doLogin: 1, - id_user: xxxxxx, - password: xxxxx - } - ``` - - **ejemplo resultado:** - ``` - ce015de2941dac933621d23d3f32ac5ead8254b7ea3f390494cfcf586d38de27 - ``` +- **data:** - - **ejemplo peticion:** - ``` - curl "http://localhost/pandora_console/ajax.php?page=include/rest-api/index&doLogin=1&id_user=admin&password=pandora" - ``` +```json +{ + "page": include / rest - api / index, + "doLogin": 1, + "id_user": xxxxxx, + "password": xxxxx +} +``` + +- **ejemplo resultado:** + +``` +ce015de2941dac933621d23d3f32ac5ead8254b7ea3f390494cfcf586d38de27 +``` + +- **ejemplo peticion:** + +``` +curl "http://localhost/pandora_console/ajax.php?page=include/rest-api/index&doLogin=1&id_user=admin&password=pandora" +``` - ## Traer todos los elementos de una CV. - - **data:** - ```javascript - { - page: include/rest-api/index, - id_user: XXX, - getVisualConsoleItems: 1 - visualConsoleId: XX, - size: [ - widht => XXX, - height => YYY - ], - widthScreen: xxx - } - ``` +- **data:** - - **ejemplo resultado:** - ```javascript - [ - { - "aclGroupId":0, - "agentDisabled":false, - "cacheExpiration":0, - "colorStatus":"#B2B2B2", - "height":132, - "id":180, - "image":"worldmap", - "imageSrc":"http:\/\/localhost\/pandora_console\/images\/console\/icons\/worldmap.png", - "isLinkEnabled":true, - "isOnTop":false,"label":"", - "labelPosition":"down", - "link":"http:\/\/localhost\/pandora_console\/index.php?sec=network&sec2=operation%2Fvisual_console%2Fview&id=3&pure=0", - "linkedLayoutId":3, - "linkedLayoutNodeId":0,"linkedLayoutStatusType":"default","moduleDisabled":false, - "parentId":0, - "type":5, - "width":200, - "x":1675, - "y":184 - }, - { - "aclGroupId":0, - "agentDisabled":false, - "cacheExpiration":0, - "colorStatus":"#B2B2B2","height":132,"id":181,"image":"europemap","imageSrc":"http:\/\/localhost\/pandora_console\/images\/console\/icons\/europemap.png", - "isLinkEnabled":true, - "isOnTop":false, - "label":"", - "labelPosition":"down", - "link":"http:\/\/localhost\/pandora_console\/index.php?sec=network&sec2=operation%2Fvisual_console%2Fview&id=4&pure=0", - "linkedLayoutId":4, - "linkedLayoutNodeId":0,"linkedLayoutStatusType":"default","moduleDisabled":false, - "parentId":0, - "type":5, - "width":200, - "x":1673, - "y":340 - } - ... - ] - ``` +```javascript +{ + page: include/rest-api/index, + id_user: XXX, + getVisualConsoleItems: 1 + visualConsoleId: XX, + size: [ + widht => XXX, + height => YYY + ], + widthScreen: xxx +} +``` - - **ejemplo peticion:** - ``` - curl "http://localhost/pandora_console/ajax.php?page=include/rest-api/index&getVisualConsoleItems=1&auth_hash=ce015de2941dac933621d23d3f32ac5ead8254b7ea3f390494cfcf586d38de27&visualConsoleId=7&id_user=admin" - ``` +- **ejemplo resultado:** + +```javascript +[ + { + "aclGroupId":0, + "agentDisabled":false, + "cacheExpiration":0, + "colorStatus":"#B2B2B2", + "height":132, + "id":180, + "image":"worldmap", + "imageSrc":"http:\/\/localhost\/pandora_console\/images\/console\/icons\/worldmap.png", + "isLinkEnabled":true, + "isOnTop":false,"label":"", + "labelPosition":"down", + "link":"http:\/\/localhost\/pandora_console\/index.php?sec=network&sec2=operation%2Fvisual_console%2Fview&id=3&pure=0", + "linkedLayoutId":3, + "linkedLayoutNodeId":0,"linkedLayoutStatusType":"default","moduleDisabled":false, + "parentId":0, + "type":5, + "width":200, + "x":1675, + "y":184 + }, + { + "aclGroupId":0, + "agentDisabled":false, + "cacheExpiration":0, + "colorStatus":"#B2B2B2","height":132,"id":181,"image":"europemap","imageSrc":"http:\/\/localhost\/pandora_console\/images\/console\/icons\/europemap.png", + "isLinkEnabled":true, + "isOnTop":false, + "label":"", + "labelPosition":"down", + "link":"http:\/\/localhost\/pandora_console\/index.php?sec=network&sec2=operation%2Fvisual_console%2Fview&id=4&pure=0", + "linkedLayoutId":4, + "linkedLayoutNodeId":0,"linkedLayoutStatusType":"default","moduleDisabled":false, + "parentId":0, + "type":5, + "width":200, + "x":1673, + "y":340 + } + ... +] +``` + +- **ejemplo peticion:** + +``` +curl "http://localhost/pandora_console/ajax.php?page=include/rest-api/index&getVisualConsoleItems=1&auth_hash=ce015de2941dac933621d23d3f32ac5ead8254b7ea3f390494cfcf586d38de27&visualConsoleId=7&id_user=admin" +``` - ## Traer los datos del propio item. - - **data:** +- **data:** - ```javascript - { - page: include/rest-api/index, - , - getVisualConsoleItem: 1, - visualConsoleId: XX, - visualConsoleItemId: XX - } - ``` +```javascript +{ +page: include/rest-api/index, +, +getVisualConsoleItem: 1, +visualConsoleId: XX, +visualConsoleItemId: XX +} +``` - - **ejemplo resultado:** - `javascript { "aclGroupId":0, "agentDisabled":false, "cacheExpiration":0, "clockFormat":"time", "clockTimezone":"Europe\/Madrid", "clockTimezoneOffset":3600, "clockType":"digital", "color":"#FFFFFF", "colorStatus":"#B2B2B2", "height":50, "id":212, "isLinkEnabled":true, "isOnTop":false,"label":"", "labelPosition":"down", "link":null, "linkedLayoutId":0, "linkedLayoutNodeId":0, "linkedLayoutStatusType":"default", "moduleDisabled":false, "parentId":0, "showClockTimezone":true, "type":19, "width":100, "x":848, "y":941 }` +- **ejemplo resultado:** - - **ejemplo peticion:** - `curl "http://localhost/pandora_console/ajax.php?page=include/rest-api/index&getVisualConsoleItem=1&auth_hash=ce015de2941dac933621d23d3f32ac5ead8254b7ea3f390494cfcf586d38de27&visualConsoleId=7&visualConsoleItemId=212&id_user=admin"` +```javascript +{ + "aclGroupId":0, + "agentDisabled":false, + "cacheExpiration":0, + "clockFormat":"time", + "clockTimezone":"Europe\/Madrid", + "clockTimezoneOffset":3600, + "clockType":"digital", + "color":"#FFFFFF", + "colorStatus":"#B2B2B2", + "height":50, + "id":212, + "isLinkEnabled":true, + "isOnTop":false, + "label":"", + "labelPosition":"down", + "link":null, + "linkedLayoutId":0, + "linkedLayoutNodeId":0, + "linkedLayoutStatusType":"default", + "moduleDisabled":false, + "parentId":0, + "showClockTimezone":true, + "type":19, + "width":100, + "x":848 + "y":941 +} +``` + +- **ejemplo peticion:** + +``` +curl "http://localhost/pandora_console/ajax.php?page=include/rest-api/index&getVisualConsoleItem=1&auth_hash=ce015de2941dac933621d23d3f32ac5ead8254b7ea3f390494cfcf586d38de27&visualConsoleId=7&visualConsoleItemId=212&id_user=admin" +```