From 26e5e7f535181686059c546880565f8780ef4b7b Mon Sep 17 00:00:00 2001 From: loiclau Date: Tue, 26 Feb 2019 14:02:53 +0100 Subject: [PATCH] feat(clapi) add acknowledgement in clapi * add acknowledgement by clapi * add doc * add acceptance --- .../objects/realtime_acknowledgement.rst | 145 + .../objects/realtime_acknowledgement.rst | 145 + .../api/clapi/objects/realtime_downtimes.rst | 2 +- .../Acknowledgement/RtAcknowledgement.php | 131 + .../realtime_rest_api.postman_collection.json | 13306 ++++++++-------- .../centreon-clapi/centreonAPI.class.php | 7 + .../centreonRtAcknowledgement.class.php | 530 + www/class/centreonExternalCommand.class.php | 25 +- 8 files changed, 8009 insertions(+), 6282 deletions(-) create mode 100644 doc/en/api/clapi/objects/realtime_acknowledgement.rst create mode 100644 doc/fr/api/clapi/objects/realtime_acknowledgement.rst create mode 100644 lib/Centreon/Object/Acknowledgement/RtAcknowledgement.php create mode 100644 www/class/centreon-clapi/centreonRtAcknowledgement.class.php diff --git a/doc/en/api/clapi/objects/realtime_acknowledgement.rst b/doc/en/api/clapi/objects/realtime_acknowledgement.rst new file mode 100644 index 00000000000..4e62a6a9feb --- /dev/null +++ b/doc/en/api/clapi/objects/realtime_acknowledgement.rst @@ -0,0 +1,145 @@ +========================= +Real time Acknowledgement +========================= + +Overview +-------- + +Object name: **RTACKNOWLEDGEMENT** + +Show host real time acknowledgement +----------------------------------- + +In order to list available real time acknowledgement, use the **SHOW** action:: +You can use the value "HOST" to display all the acknowledgement:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a show -v "HOST;generic-host" + id;host_name;entry_time;author;comment_data;sticky;notify_contacts;persistent_comment + 6;generic-host;2017/09/28 14:21;admin;'generic-comment';2;0;1 + +Columns are the following : + +================================= ================================================================================== +Column Description +================================= ================================================================================== +Id Id of the acknowledgement + +Host_name Name of the host + +Entry_time Beginning of acknowledgement + +Author Name of the author + +Comment_data Short description of the acknowledgement + +Sticky Acknowledgement will be maintained in case of a change of Not-OK status (0/2) + +Notify_contacts Notification send to the contacts linked to the object (0/1) + +Persistent_comment Acknowledgement will be maintained in the case of a restart of the scheduler (0/1) + +================================= ================================================================================== + +Show service real time acknowledgement +-------------------------------------- + +In order to list available real time acknowledgement, use the **SHOW** action:: +You can use the value "SVC" to display all the acknowledgement:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a show -v "SVC;generic-host,generic-service" + id;host_name;service_name;entry_time;author;comment_data;sticky;notify_contacts;persistent_comment + 42;generic-host;generic-service;2017/09/28 14:21;admin;'generic-comment';2;0;1 + +Columns are the following : + +================================= =========================================================================== +Column Description +================================= =========================================================================== +Id Id of the acknowledgement + +Host_name Name of the host + +Service_name Name of the service + +Entry_time Beginning of acknowledgement + +Author Name of the author + +Comment_data Short description of the acknowledgement + +Sticky Acknowledgement will be maintained in case of a change of Not-OK status (0/2) + +Notify_contacts Notification send to the contacts linked to the object (0/1) + +Persistent_comment Acknowledgement will be maintained in the case of a restart of the scheduler (0/1) + +================================= ================================================================================== + +Real time Acknowledgement for : Addhost +--------------------------------------- + +If you want to associate a host to a real time acknowledgement, use the **ADD** action:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a add -v "HOST;central;my comments;2;0;1" + +The required parameters are the following : + +========= =============================================================================================== +Order Description +========= =============================================================================================== +1 Value you want to associate + +2 Name of the host (Name of the service) + +3 Short description of the real time acknowledgement + +4 Acknowledgement maintained in case of a change of status (Sticky use 0 or 2) + +5 Notification send to the contacts linked to the object (Notify use 0 or 1) + +6 Maintained th acknowledgement in the case of a restart of the scheduler (Persistent use 0 or 1) + +========= =============================================================================================== + + +Real time Acknowledgement for : addservice +------------------------------------------ + +If you want to associate a service or service group to a real time acknowledgement, use the **ADD** action:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a add -v "SVC;central,ping|central,memory;my comments;2;0;1" + +The required parameters are the following : + +========= =============================================================================================== +Order Description +========= =============================================================================================== +1 Value you want to associate + +2 Name of the host , name of the service + +3 Short description of the real time acknowledgement + +4 Acknowledgement maintained in case of a change of status (Sticky use 0 or 2) + +5 Notification send to the contacts linked to the object (Notify use 0 or 1) + +6 Maintained th acknowledgement in the case of a restart of the scheduler (Persistent use 0 or 1) +========= =============================================================================================== + + +Cancel a real time acknowledgement +---------------------------------- + +In order to cancel a real time acknowledgement, use the **CANCEL** action:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a CANCEL -v "central,ping" + +The required parameters are the following : + +========= ============================================ +Order Description +========= ============================================ +1 Name of acknowledged resource(s) + +========= ============================================ diff --git a/doc/fr/api/clapi/objects/realtime_acknowledgement.rst b/doc/fr/api/clapi/objects/realtime_acknowledgement.rst new file mode 100644 index 00000000000..4e62a6a9feb --- /dev/null +++ b/doc/fr/api/clapi/objects/realtime_acknowledgement.rst @@ -0,0 +1,145 @@ +========================= +Real time Acknowledgement +========================= + +Overview +-------- + +Object name: **RTACKNOWLEDGEMENT** + +Show host real time acknowledgement +----------------------------------- + +In order to list available real time acknowledgement, use the **SHOW** action:: +You can use the value "HOST" to display all the acknowledgement:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a show -v "HOST;generic-host" + id;host_name;entry_time;author;comment_data;sticky;notify_contacts;persistent_comment + 6;generic-host;2017/09/28 14:21;admin;'generic-comment';2;0;1 + +Columns are the following : + +================================= ================================================================================== +Column Description +================================= ================================================================================== +Id Id of the acknowledgement + +Host_name Name of the host + +Entry_time Beginning of acknowledgement + +Author Name of the author + +Comment_data Short description of the acknowledgement + +Sticky Acknowledgement will be maintained in case of a change of Not-OK status (0/2) + +Notify_contacts Notification send to the contacts linked to the object (0/1) + +Persistent_comment Acknowledgement will be maintained in the case of a restart of the scheduler (0/1) + +================================= ================================================================================== + +Show service real time acknowledgement +-------------------------------------- + +In order to list available real time acknowledgement, use the **SHOW** action:: +You can use the value "SVC" to display all the acknowledgement:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a show -v "SVC;generic-host,generic-service" + id;host_name;service_name;entry_time;author;comment_data;sticky;notify_contacts;persistent_comment + 42;generic-host;generic-service;2017/09/28 14:21;admin;'generic-comment';2;0;1 + +Columns are the following : + +================================= =========================================================================== +Column Description +================================= =========================================================================== +Id Id of the acknowledgement + +Host_name Name of the host + +Service_name Name of the service + +Entry_time Beginning of acknowledgement + +Author Name of the author + +Comment_data Short description of the acknowledgement + +Sticky Acknowledgement will be maintained in case of a change of Not-OK status (0/2) + +Notify_contacts Notification send to the contacts linked to the object (0/1) + +Persistent_comment Acknowledgement will be maintained in the case of a restart of the scheduler (0/1) + +================================= ================================================================================== + +Real time Acknowledgement for : Addhost +--------------------------------------- + +If you want to associate a host to a real time acknowledgement, use the **ADD** action:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a add -v "HOST;central;my comments;2;0;1" + +The required parameters are the following : + +========= =============================================================================================== +Order Description +========= =============================================================================================== +1 Value you want to associate + +2 Name of the host (Name of the service) + +3 Short description of the real time acknowledgement + +4 Acknowledgement maintained in case of a change of status (Sticky use 0 or 2) + +5 Notification send to the contacts linked to the object (Notify use 0 or 1) + +6 Maintained th acknowledgement in the case of a restart of the scheduler (Persistent use 0 or 1) + +========= =============================================================================================== + + +Real time Acknowledgement for : addservice +------------------------------------------ + +If you want to associate a service or service group to a real time acknowledgement, use the **ADD** action:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a add -v "SVC;central,ping|central,memory;my comments;2;0;1" + +The required parameters are the following : + +========= =============================================================================================== +Order Description +========= =============================================================================================== +1 Value you want to associate + +2 Name of the host , name of the service + +3 Short description of the real time acknowledgement + +4 Acknowledgement maintained in case of a change of status (Sticky use 0 or 2) + +5 Notification send to the contacts linked to the object (Notify use 0 or 1) + +6 Maintained th acknowledgement in the case of a restart of the scheduler (Persistent use 0 or 1) +========= =============================================================================================== + + +Cancel a real time acknowledgement +---------------------------------- + +In order to cancel a real time acknowledgement, use the **CANCEL** action:: + + [root@centreon ~]# ./centreon -u admin -p centreon -o RTACKNOWLEDGEMENT -a CANCEL -v "central,ping" + +The required parameters are the following : + +========= ============================================ +Order Description +========= ============================================ +1 Name of acknowledged resource(s) + +========= ============================================ diff --git a/doc/fr/api/clapi/objects/realtime_downtimes.rst b/doc/fr/api/clapi/objects/realtime_downtimes.rst index d11b53e490d..e78eaac790f 100644 --- a/doc/fr/api/clapi/objects/realtime_downtimes.rst +++ b/doc/fr/api/clapi/objects/realtime_downtimes.rst @@ -22,7 +22,7 @@ Columns are the following : ================================= =========================================================================== Column Description ================================= =========================================================================== -id Name of the downtime +id Id of the downtime Host_name Name of the host diff --git a/lib/Centreon/Object/Acknowledgement/RtAcknowledgement.php b/lib/Centreon/Object/Acknowledgement/RtAcknowledgement.php new file mode 100644 index 00000000000..e1b9b058708 --- /dev/null +++ b/lib/Centreon/Object/Acknowledgement/RtAcknowledgement.php @@ -0,0 +1,131 @@ +. + * + * Linking this program statically or dynamically with other modules is making a + * combined work based on this program. Thus, the terms and conditions of the GNU + * General Public License cover the whole combination. + * + * As a special exception, the copyright holders of this program give CENTREON + * permission to link this program with independent modules to produce an executable, + * regardless of the license terms of these independent modules, and to copy and + * distribute the resulting executable under terms of CENTREON choice, provided that + * CENTREON also meet, for each linked independent module, the terms and conditions + * of the license of that module. An independent module is a module which is not + * derived from this program. If you modify this program, you may extend this + * exception to your version of the program, but you are not obliged to do so. If you + * do not wish to do so, delete this exception statement from your version. + * + * For more information : contact@centreon.com + * + */ + +require_once "Centreon/Object/ObjectRt.php"; + +/** + * Used for interacting with acknowledge objects + * + * @author Laurent Loic + */ +class Centreon_Object_RtAcknowledgement extends Centreon_ObjectRt +{ + protected $table = "acknowledgements"; + protected $primaryKey = "acknowledgement_id"; + protected $uniqueLabelField = "comment_data"; + + /** + * @param array $hostList + * @return array + */ + public function getHostAcknowledgement($hostList = array()) + { + $hostFilter = ''; + if (!empty($hostList)) { + $hostFilter = "AND h.name IN ('" . implode("','", $hostList) . "') "; + } + + $query = "SELECT DISTINCT a.acknowledgement_id, h.name, MAX(a.entry_time) as entry_time, a.author, " . + "a.comment_data, a.sticky, a.notify_contacts, a.persistent_comment " . + "FROM acknowledgements a, hosts h " . + "WHERE a.host_id = h.host_id " . + "AND h.acknowledged = 1 " . + "AND service_id IS NULL " . + $hostFilter . + " GROUP BY h.name ORDER BY a.entry_time, h.name"; + + return $this->getResult($query); + } + + /** + * @param array $svcList + * @return array + */ + public function getSvcAcknowledgement($svcList = array()) + { + $serviceFilter = ''; + + if (!empty($svcList)) { + $serviceFilter = 'AND ('; + $filterTab = array(); + for ($i = 0; $i < count($svcList); $i += 2) { + $hostname = $svcList[$i]; + $serviceDescription = $svcList[$i + 1]; + $filterTab[] = '(h.name = "' . $hostname . '" AND s.description = "' . $serviceDescription . '")'; + } + $serviceFilter .= implode(' AND ', $filterTab) . ') '; + } + + $query = "SELECT a.acknowledgement_id, h.name, s.description, MAX(a.entry_time) as entry_time, a.author, " . + "a.comment_data , a.sticky, a.notify_contacts, a.persistent_comment " . + "FROM acknowledgements a, hosts h, services s " . + "WHERE a.service_id = s.service_id " . + "AND a.host_id = s.host_id " . + "AND s.host_id = h.host_id " . + "AND s.acknowledged = 1 " . + $serviceFilter . + " GROUP BY h.name, s.description ORDER BY a.entry_time, h.name, s.description"; + + return $this->getResult($query); + } + + /** + * @param $serviceId + * @return bool + */ + public function svcIsAcknowledged($serviceId) + { + $query = "SELECT acknowledged FROM services WHERE service_id = ? "; + if ($this->getResult($query, array($serviceId), 'fetch')['acknowledged'] == 1) { + return true; + } else { + return false; + } + } + + /** + * @param $hostId + * @return bool + */ + public function hostIsAcknowledged($hostId) + { + $query = "SELECT acknowledged FROM hosts WHERE host_id = ? "; + if ($this->getResult($query, array($hostId), 'fetch')['acknowledged'] == 1) { + return true; + } else { + return false; + } + } +} diff --git a/tests/rest_api/realtime_rest_api.postman_collection.json b/tests/rest_api/realtime_rest_api.postman_collection.json index 90fee475aa0..4648be64a48 100644 --- a/tests/rest_api/realtime_rest_api.postman_collection.json +++ b/tests/rest_api/realtime_rest_api.postman_collection.json @@ -1,6282 +1,7028 @@ { - "variables": [], - "info": { - "name": "Centreon Web Rest API realtime", - "_postman_id": "fd65edd2-237b-e7c0-1623-430a15d0b0b7", - "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" - }, - "item": [ - { - "name": "00-Authenticate", - "item": [ - { - "name": "Authenticate", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "postman.setEnvironmentVariable(\"token\",jsonData.authToken);", - "", - "postman.setGlobalVariable(\"loadHelpers\", function loadHelpers() {", - " \"use strict\";", - " let helpers = {};", - "", - " /** Test function to show this kludge is working. */", - " helpers.test200 = function test200() {", - " tests[\"Response returned 200\"] = responseCode.code === 200;", - " }", - " ", - " helpers.testJson = function testJson() {", - " tests[\"Content-Type header is application/json\"] = postman.getResponseHeader(\"Content-Type\") === 'application/json;charset=utf-8';", - " ", - " let result;", - " try {", - " JSON.parse(responseBody);", - " } catch (e) {", - " result = false;", - " }", - " result = true;", - " ", - " tests[\"Response body uses json format\"] = result;", - " }", - " ", - " helpers.notEmpty = function notEmpty() {", - " tests[\"Result is not empty\"] = JSON.parse(responseBody).length > 0;", - " }", - " ", - " helpers.checkHostListFormat = function checkHostListFormat(columns) {", - " if (typeof columns === 'undefined') {", - " columns = [\"id\", \"name\", \"alias\", \"address\", \"state\", \"state_type\", \"output\", \"max_check_attempts\", \"check_attempt\", \"last_check\", \"last_state_change\", \"last_hard_state_change\", \"acknowledged\", \"instance_name\", \"criticality\"];", - " }", - " ", - " let hostListSchema = {", - " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", - " \"type\": \"array\",", - " \"items\": {\t\t", - " \"type\": \"object\",", - " \"required\": columns,", - " \"properties\": {", - " \"id\": { \"type\": \"string\" },", - " \"name\": { \"type \": \"string\" },", - " \"alias\": { \"type \": \"string\" },", - " \"address\": { \"type\": \"string\" },", - " \"state\": { \"type\": \"string\" },", - " \"state_type\": { \"type \": \"string\" },", - " \"output\": { \"type \": \"string\" },", - " \"max_check_attempts\": { \"type\": \"string\" },", - " \"check_attempt\": { \"type\": \"string\" },", - " \"last_check\": { \"type\": [\"string\", \"null\"] },", - " \"last_state_change\": { \"type\": [\"string\", \"null\"] },", - " \"last_hard_state_change\": { \"type\": [\"string\", \"null\"] },", - " \"acknowledged\": { \"type \": \"string\" },", - " \"instance_name\": { \"type \": \"string\" },", - " \"criticality\": { \"type\": [\"string\", \"null\"] }", - " },", - " \"additionalProperties\": true", - " }", - " };", - " tests[\"host list is well formated\"] = tv4.validate(JSON.parse(responseBody), hostListSchema);", - " }", - " ", - " helpers.checkServiceListFormat = function checkServiceListFormat(columns) {", - " if (typeof columns === 'undefined') {", - " columns = [\"host_id\", \"name\", \"description\", \"service_id\", \"state\", \"state_type\", \"output\", \"perfdata\", \"max_check_attempts\", \"check_attempt\", \"last_check\", \"last_state_change\", \"last_hard_state_change\", \"acknowledged\", \"criticality\"];", - " }", - " ", - " let serviceListSchema = {", - " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", - " \"type\": \"array\",", - " \"items\": {\t\t", - " \"type\": \"object\",", - " \"required\": columns,", - " \"properties\": {", - " \"host_id\": { \"type\": \"string\" },", - " \"name\": { \"type \": \"string\" },", - " \"description\": { \"type \": \"string\" },", - " \"service_id\": { \"type\": \"string\" },", - " \"state\": { \"type\": \"string\" },", - " \"state_type\": { \"type \": \"string\" },", - " \"output\": { \"type \": \"string\" },", - " \"perfdata\": { \"type \": \"string\" },", - " \"max_check_attempts\": { \"type\": \"string\" },", - " \"check_attempt\": { \"type\": \"string\" },", - " \"last_check\": { \"type\": [\"string\", \"null\"] },", - " \"last_state_change\": { \"type\": [\"string\", \"null\"] },", - " \"last_hard_state_change\": { \"type\": [\"string\", \"null\"] },", - " \"acknowledged\": { \"type \": \"string\" },", - " \"criticality\": { \"type\": [\"string\", \"null\"] }", - " },", - " \"additionalProperties\": true", - " }", - " };", - " tests[\"service list is well formated\"] = tv4.validate(JSON.parse(responseBody), serviceListSchema);", - " }", - " ", - " helpers.checkHostList = function checkHostList(columns) {", - " helpers.test200();", - " helpers.testJson();", - " helpers.notEmpty();", - " helpers.checkHostListFormat(columns);", - " }", - " ", - " helpers.checkServiceList = function checkServiceList(columns) {", - " helpers.test200();", - " helpers.testJson();", - " helpers.notEmpty();", - " helpers.checkServiceListFormat(columns);", - " }", - "", - " return helpers;", - "} + '; loadHelpers();'); // when eval'd out of globals, execute it", - "tests[\"helpers initialized\"] = true;", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/x-www-form-urlencoded" - } - ], - "body": { - "mode": "urlencoded", - "urlencoded": [ - { - "key": "username", - "type": "text", - "value": "{{api_user}}" - }, - { - "key": "password", - "type": "text", - "value": "{{api_password}}" - } - ] - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=authenticate", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "authenticate" - } - ] - } - }, - "response": [] - } - ] - }, - { - "name": "01-Base configuration", - "item": [ - { - "name": "10-Timeperiods", - "item": [ - { - "name": "Add tp", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"tp\",\n \"values\": \"{{tp_name}};{{tp_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam sunday", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};sunday;{{tp_sunday}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam monday", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};monday;{{tp_monday}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam tuesday", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};tuesday;{{tp_tuesday}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam wednesday", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};wednesday;{{tp_wednesday}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam thursday", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};thursday;{{tp_thursday}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam friday", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};friday;{{tp_friday}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam saturday", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};saturday;{{tp_saturday}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "11-Commands", - "description": "Tests all commands to manage commands.", - "item": [ - { - "name": "Add command", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"cmd\",\n \"values\": \"{{command_name}};{{command_type}};{{command_line}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "21-Contacts", - "description": "Tests all commands to manage contact.", - "item": [ - { - "name": "Add contact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"contact\",\n \"values\": \"{{contact_name}};{{contact_alias}};test@localhost;{{contact_pwd}};0;0;en_US;Idap\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam hostnotifcmd", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};hostnotifcmd;{{command_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam svcnotifcmd", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};svcnotifcmd;{{command_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam hostnotifperiod", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};hostnotifperiod;{{tp_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam svcnotifperiod", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};svcnotifperiod;{{tp_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam hostnotifopt", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};hostnotifopt;{{contact_hostnotifopt}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam svcnotifopt", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};servicenotifopt;{{contact_svcnotifopt}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "22-Contactgroups", - "description": "Tests all commands to manage contact groups.", - "item": [ - { - "name": "Add contact group", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"cg\",\n \"values\": \"{{cg_name}};{{cg_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Addcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"addcontact\",\n \"object\": \"cg\",\n \"values\": \"{{cg_name}};{{contact_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "23-Hostgroups", - "description": "Tests all commands to manage host groups.", - "item": [ - { - "name": "Add hostgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name}};{{hg_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "24-Hosts_Categories", - "description": "Tests all commands to manage host categories.", - "item": [ - { - "name": "Add host category", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{hc_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Set hc severity", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{hc_severity_level}};{{hc_severity_icon}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "25-Services_Categories", - "description": "Tests all commands to manage service categories.", - "item": [ - { - "name": "Add service category", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{sc_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Set sc severity", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{sc_severity_level}};{{sc_severity_image}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "26-Servicegroups", - "description": "Tests all commands to manage service groups.", - "item": [ - { - "name": "Add service group", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{sg_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "30-Hosts_Templates", - "item": [ - { - "name": "Create host template", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{htpl_name}};{{host_address}};;central;\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam check_command", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};check_command;{{command_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam check_period", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};check_period;{{tp_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam max_check_attempts", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};max_check_attempts;{{host_max_check_attempts}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam snmp_community", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};snmp_community;{{host_snmp_community}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam snmp_version", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};snmp_version;{{host_snmp_version}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Addcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"addcontactgroup\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{cg_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setcontact\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{contact_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setseverity", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{hc_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "31-Hosts", - "description": "Tests all commands to manage hosts", - "item": [ - { - "name": "Add host", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{host_alias}};{{host_address}};{{htpl_name}};Central;\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam check_command", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"setparam\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};check_command;{{command_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Addtemplate", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"addtemplate\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};{{htpl_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Applytpl", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\":\"applytpl\",\n \"object\":\"host\",\n \"values\": \"{{host_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setcontactgroup\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{cg_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setcontact\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{contact_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Sethostgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"sethostgroup\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{hg_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setseverity", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{hc_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Add host 2", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"host\",\n \"values\": \"{{host_name2}};{{host_alias}};0.0.0.0;{{htpl_name}};Central;\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "40-Services_Templates", - "description": "Tests all commands to manage service templates.", - "item": [ - { - "name": "Add service template", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{stpl_alias}};\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam check_period", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};check_period;{{tp_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam check_command", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};check_command;{{command_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam max_check_attempts", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};max_check_attempts;{{stpl_max_check}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action" - }, - { - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Sethosttemplate", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"sethosttemplate\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{htpl_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setcontact\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{contact_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setcontactgroup\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{cg_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "41-Services", - "description": "Tests all commands to manage services.", - "item": [ - { - "name": "Add service", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{stpl_description}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setparam template", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setparam\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};template;{{stpl_description}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setseverity", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{sc_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setcontact\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{contact_alias}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Setcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setcontactgroup\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{cg_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Set servicegroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"setservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{host_name}},{{service_description}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "99-Generate", - "item": [ - { - "name": "Generate configuration", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;", - "", - "function wait(millis) {", - " var date = new Date();", - " var curDate = null;", - " do { curDate = new Date(); }", - " while(curDate-date < millis);", - "}", - "", - "wait(2000);" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"APPLYCFG\",\n \"values\": \"Central\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - } - ] - }, - { - "name": "10-Host", - "item": [ - { - "name": "host list without parameters", - "item": [ - { - "name": "host list", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "Host list with limit parameter", - "item": [ - { - "name": "Limit", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "limit", - "value": "{{my_limit}}" - } - ] - } - }, - "response": [] - }, - { - "name": "Limit with field name", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList([\"name\"]);" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit=2&fields=name", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "limit", - "value": "2" - }, - { - "equals": true, - "key": "fields", - "value": "name" - } - ] - } - }, - "response": [] - }, - { - "name": "Limit with all fields", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList([\"id\", \"name\", \"alias\", \"address\", \"state\", \"state_type\", \"output\", \"max_check_attempts\", \"check_attempt\", \"last_check\", \"next_check\", \"last_state_change\", \"last_hard_state_change\", \"acknowledged\", \"instance_name\", \"instance_id\", \"criticality\", \"passive_checks\", \"active_checks\", \"notify\", \"action_url\", \"notes_url\", \"notes\", \"icon_image\", \"icon_image_alt\", \"scheduled_downtime_depth\", \"flapping\"]);" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit=2&fields=id,name,alias,address,state,state_type,output,max_check_attempts,check_attempt,last_check,next_check,last_state_change,last_hard_state_change,acknowledged,instance,instance_id,criticality,passive_checks,active_checks,notify,action_url,notes_url,notes,icon_image,icon_image_alt,scheduled_downtime_depth,flapping", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "limit", - "value": "2" - }, - { - "equals": true, - "key": "fields", - "value": "id,name,alias,address,state,state_type,output,max_check_attempts,check_attempt,last_check,next_check,last_state_change,last_hard_state_change,acknowledged,instance,instance_id,criticality,passive_checks,active_checks,notify,action_url,notes_url,notes,icon_image,icon_image_alt,scheduled_downtime_depth,flapping" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "Host list with viewType parameter", - "item": [ - { - "name": "list with viewType", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&viewType=all,unhandled,problems", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "viewType", - "value": "all,unhandled,problems" - } - ] - } - }, - "response": [] - }, - { - "name": "with viewType all", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&viewType=all", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "viewType", - "value": "all" - } - ] - } - }, - "response": [] - }, - { - "name": "with viewType unhandled", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&viewType=unhandled", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "viewType", - "value": "unhandled" - } - ] - } - }, - "response": [] - }, - { - "name": "with viewType problems", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&viewType=problems", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "viewType", - "value": "problems" - } - ] - } - }, - "response": [] - }, - { - "name": "viewType with limit", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&viewType=all,unhandled,problems", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "limit", - "value": "{{my_limit}}" - }, - { - "equals": true, - "key": "viewType", - "value": "all,unhandled,problems" - } - ] - } - }, - "response": [] - }, - { - "name": "viewType all with limit", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&viewType=all", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "limit", - "value": "{{my_limit}}" - }, - { - "equals": true, - "key": "viewType", - "value": "all" - } - ] - } - }, - "response": [] - }, - { - "name": "viewType unhandled with limit", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&viewType=unhandled", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "limit", - "value": "{{my_limit}}" - }, - { - "equals": true, - "key": "viewType", - "value": "unhandled" - } - ] - } - }, - "response": [] - }, - { - "name": "viewType problems with limit", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&viewType=problems", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "limit", - "value": "{{my_limit}}" - }, - { - "equals": true, - "key": "viewType", - "value": "problems" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "Host list with status filter", - "item": [ - { - "name": "status up with state and name", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&status=up&fields=name, state", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "status", - "value": "up" - }, - { - "equals": true, - "key": "fields", - "value": "name, state" - } - ] - } - }, - "response": [] - }, - { - "name": "status down with state and name", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&status=down&fields=name, state", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "status", - "value": "down" - }, - { - "equals": true, - "key": "fields", - "value": "name, state" - } - ] - } - }, - "response": [] - }, - { - "name": "status unreachable with state and name", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&status=unreachable&fields=name, state", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "status", - "value": "unreachable" - }, - { - "equals": true, - "key": "fields", - "value": "name, state" - } - ] - } - }, - "response": [] - }, - { - "name": "status pending with state and name", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&status=pending&fields=name, state", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "status", - "value": "pending" - }, - { - "equals": true, - "key": "fields", - "value": "name, state" - } - ] - } - }, - "response": [] - }, - { - "name": "status all with limit", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList([\"name\", \"state\"]);" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&status=all&fields=name, state", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "limit", - "value": "{{my_limit}}" - }, - { - "equals": true, - "key": "status", - "value": "all" - }, - { - "equals": true, - "key": "fields", - "value": "name, state" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "Host list by Host", - "item": [ - { - "name": "search by host name", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "search", - "value": "{{host_name}}" - } - ] - } - }, - "response": [] - }, - { - "name": "search by host name with status up", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&status=up", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "search", - "value": "{{host_name}}" - }, - { - "equals": true, - "key": "status", - "value": "up" - } - ] - } - }, - "response": [] - }, - { - "name": "search by host name with status down", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&status=down", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "search", - "value": "{{host_name}}" - }, - { - "equals": true, - "key": "status", - "value": "down" - } - ] - } - }, - "response": [] - }, - { - "name": "search by host name with status pending", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&status=pending", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "search", - "value": "{{host_name}}" - }, - { - "equals": true, - "key": "status", - "value": "pending" - } - ] - } - }, - "response": [] - }, - { - "name": "search by host name with status unreachable", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&status=unreachable", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "search", - "value": "{{host_name}}" - }, - { - "equals": true, - "key": "status", - "value": "unreachable" - } - ] - } - }, - "response": [] - }, - { - "name": "search by host name with id field", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList([\"id\"]);" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&fields=id", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "search", - "value": "{{host_name}}" - }, - { - "equals": true, - "key": "fields", - "value": "id" - } - ] - } - }, - "response": [] - }, - { - "name": "search by host name with all fields", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkHostList([\"id\", \"name\", \"alias\", \"address\", \"state\", \"state_type\", \"output\", \"max_check_attempts\", \"check_attempt\", \"last_check\", \"next_check\", \"last_state_change\", \"last_hard_state_change\", \"acknowledged\", \"instance_name\", \"instance_id\", \"criticality\", \"passive_checks\", \"active_checks\", \"notify\", \"action_url\", \"notes_url\", \"notes\", \"icon_image\", \"icon_image_alt\", \"scheduled_downtime_depth\", \"flapping\"]);" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&fields=id,name,alias,address,state,state_type,output,max_check_attempts,check_attempt,last_check,next_check,last_state_change,last_hard_state_change,acknowledged,instance,instance_id,criticality,passive_checks,active_checks,notify,action_url,notes_url,notes,icon_image,icon_image_alt,scheduled_downtime_depth,flapping", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_hosts" - }, - { - "equals": true, - "key": "search", - "value": "{{host_name}}" - }, - { - "equals": true, - "key": "fields", - "value": "id,name,alias,address,state,state_type,output,max_check_attempts,check_attempt,last_check,next_check,last_state_change,last_hard_state_change,acknowledged,instance,instance_id,criticality,passive_checks,active_checks,notify,action_url,notes_url,notes,icon_image,icon_image_alt,scheduled_downtime_depth,flapping" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - } - ] - }, - { - "name": "20-Service", - "item": [ - { - "name": "Service list without parameters", - "item": [ - { - "name": "Service List", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkServiceList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_services" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "Service list by host and service", - "item": [ - { - "name": "Service List by host name", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkServiceList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&searchHost={{host_name}}", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_services" - }, - { - "equals": true, - "key": "searchHost", - "value": "{{host_name}}" - } - ] - } - }, - "response": [] - }, - { - "name": "Service List by service description", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkServiceList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&searchHost={{host_name}}&searchService={{service_description}}", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_services" - }, - { - "equals": true, - "key": "searchHost", - "value": "{{host_name}}" - }, - { - "equals": true, - "key": "searchService", - "value": "{{service_description}}" - } - ] - } - }, - "response": [] - }, - { - "name": "Service List by host name and service description", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkServiceList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&searchHost={{host_name}}&searchService={{service_description}}", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_services" - }, - { - "equals": true, - "key": "searchHost", - "value": "{{host_name}}" - }, - { - "equals": true, - "key": "searchService", - "value": "{{service_description}}" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "Service list with limit parameter", - "item": [ - { - "name": "Service List with limit", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkServiceList();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&limit={{my_limit}}", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_services" - }, - { - "equals": true, - "key": "limit", - "value": "{{my_limit}}" - } - ] - } - }, - "response": [] - }, - { - "name": "Service List with limit and one field", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkServiceList([\"service_id\"]);" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&limit={{my_limit}}&fields=id", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_services" - }, - { - "equals": true, - "key": "limit", - "value": "{{my_limit}}" - }, - { - "equals": true, - "key": "fields", - "value": "id" - } - ] - } - }, - "response": [] - }, - { - "name": "Service List with limit and all fields", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.checkServiceList([", - " \"host_id\",", - " \"host_name\",", - " \"host_alias\",", - " \"host_address\",", - " \"host_state\",", - " \"host_state_type\",", - " \"host_output\",", - " \"host_last_check\",", - " \"host_next_check\",", - " \"host_acknowledged\",", - " \"instance_name\",", - " \"instance_id\",", - " \"host_action_url\",", - " \"host_notes_url\",", - " \"host_icon_image\",", - " \"description\",", - " \"state\",", - " \"state_type\",", - " \"service_id\",", - " \"output\",", - " \"perfdata\",", - " \"current_attempt\",", - " \"last_update\",", - " \"last_state_change\",", - " \"last_hard_state_change\",", - " \"last_check\",", - " \"next_check\",", - " \"max_check_attempts\",", - " \"notes\",", - " \"notes_url\",", - " \"action_url\",", - " \"icon_image\",", - " \"display_name\",", - " \"notify\",", - " \"acknowledged\",", - " \"passive_checks\",", - " \"active_checks\",", - " \"event_handler_enabled\",", - " \"flapping\",", - " \"scheduled_downtime_depth\",", - " \"flap_detection\",", - " \"criticality\"", - " ]);" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&limit={{my_limit}}&fields=host_id,host_name,host_alias,host_address,host_state,host_state_type,host_output,host_last_check,host_next_check,host_acknowledged,instance,instance_id,host_action_url,host_notes_url,host_icon_image,description,state,state_type,id,output,perfdata,current_attempt,last_update,last_state_change,last_hard_state_change,last_check,next_check,max_check_attempts,notes,notes_url,action_url,icon_image,display_name,notify,acknowledged,passive_checks,active_checks,event_handler_enabled,flapping,scheduled_downtime_depth,flap_detection,criticality", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_services" - }, - { - "equals": true, - "key": "limit", - "value": "{{my_limit}}" - }, - { - "equals": true, - "key": "fields", - "value": "host_id,host_name,host_alias,host_address,host_state,host_state_type,host_output,host_last_check,host_next_check,host_acknowledged,instance,instance_id,host_action_url,host_notes_url,host_icon_image,description,state,state_type,id,output,perfdata,current_attempt,last_update,last_state_change,last_hard_state_change,last_check,next_check,max_check_attempts,notes,notes_url,action_url,icon_image,display_name,notify,acknowledged,passive_checks,active_checks,event_handler_enabled,flapping,scheduled_downtime_depth,flap_detection,criticality" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - }, - { - "name": "Service list with viewType parameter", - "item": [ - { - "name": "Service List with viewType problems", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&viewType=problems", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_services" - }, - { - "equals": true, - "key": "viewType", - "value": "problems" - } - ] - } - }, - "response": [] - }, - { - "name": "Service List with viewType unhandled critical", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var helpers = eval(globals.loadHelpers);", - "helpers.test200();", - "helpers.testJson();" - ] - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&viewType=unhandled_critical", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "list" - }, - { - "equals": true, - "key": "object", - "value": "centreon_realtime_services" - }, - { - "equals": true, - "key": "viewType", - "value": "unhandled_critical" - } - ] - } - }, - "response": [] - } - ], - "_postman_isSubFolder": true - } - ] - }, - { - "name": "50-Downtime Realtime", - "item": [ - { - "name": "Addhost Realtime", - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "postman.setGlobalVariable(\"fixed\", \"1\");", - "", - "var date = new Date(new Date().toLocaleString(\"en-US\", {timeZone: \"Europe/Paris\"}));", - "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", - " ('0' + date.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"start_time\", datetime_start);", - "", - "var dateEnd = new Date(date.setHours(date.getHours()+2));", - "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", - "('0' + dateEnd.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"end_time\", datetime_end);", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"HOST;{{host_name}};{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;0\"\n}\n" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Addservice Realtime", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - }, - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "postman.setGlobalVariable(\"fixed\", \"1\");", - "", - "var date = new Date(new Date().toLocaleString(\"en-US\", {timeZone: \"Europe/Paris\"}));", - "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", - " ('0' + date.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"start_time\", datetime_start);", - "", - "var dateEnd = new Date(date.setHours(date.getHours()+2));", - "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", - "('0' + dateEnd.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"end_time\", datetime_end);", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"SVC;{{host_name}},{{service_description}};{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Addhostgroup Realtime", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - }, - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "postman.setGlobalVariable(\"fixed\", \"1\");", - "", - "var date = new Date();", - "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", - " ('0' + date.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"start_time\", datetime_start);", - "", - "var dateEnd = new Date(date.setHours(date.getHours()+2));", - "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", - "('0' + dateEnd.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"end_time\", datetime_end);" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"HG;{{hg_name}};{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;0\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Addservicegroup Realtime", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;" - ] - } - }, - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "postman.setGlobalVariable(\"fixed\", \"1\");", - "", - "var date = new Date();", - "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", - " ('0' + date.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"start_time\", datetime_start);", - "", - "var dateEnd = new Date(date.setHours(date.getHours()+2));", - "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", - "('0' + dateEnd.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"end_time\", datetime_end);" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"SG;{{sg_name}};{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "equals": true, - "key": "action", - "value": "action" - }, - { - "equals": true, - "key": "object", - "value": "centreon_clapi" - } - ] - } - }, - "response": [] - }, - { - "name": "Addinstance Realtime", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;", - "", - "function wait(millis) {", - " var date = new Date();", - " var curDate = null;", - " do { curDate = new Date(); }", - " while(curDate-date < millis);", - "}", - "", - "wait(5000);" - ] - } - }, - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "postman.setGlobalVariable(\"fixed\", \"1\");", - "", - "var date = new Date();", - "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", - " ('0' + date.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"start_time\", datetime_start);", - "", - "var dateEnd = new Date(date.setHours(date.getHours()+2));", - "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", - "('0' + dateEnd.getMinutes()).slice(-2);", - "postman.setEnvironmentVariable(\"end_time\", datetime_end);" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"INSTANCE;Central;{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action", - "equals": true - }, - { - "key": "object", - "value": "centreon_clapi", - "equals": true - } - ] - } - }, - "response": [] - }, - { - "name": "Show Service Realtime", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;", - "var contentType = postman.getResponseHeader(\"Content-Type\");", - "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", - "", - "var jsonData = JSON.parse(responseBody);", - "var result = jsonData.result;", - "", - "var schema = {", - " \"type\": \"array\",", - " \"items\": {", - " \"type\": \"object\",", - " \"properties\": {", - " \"id\": {\"type\": \"string\" },", - " \"host_name\": {\"type\": \"string\" },", - " \"service_name\": {\"type\": \"string\" },", - " \"author\": { \"type\": \"string\" },", - " \"actual_start_time\": { \"type\": \"string\" },", - " \"actual_end_time\": { \"type\": \"string\"},", - " \"start_time\": { \"type\": \"string\"},", - " \"end_time\": {\"type\": \"string\"},", - " \"comment_data\": {\"type\": \"string\" },", - " \"duration\": {\"type\": \"string\" },", - " \"fixed\": { \"type\": \"string\"},", - " \"url\": { \"type\": \"string\" }", - " },", - " \"additionalProperties\": false,", - " \"required\": [\"id\", \"host_name\", \"service_name\", \"author\", \"actual_start_time\", \"actual_end_time\", \"start_time\", \"end_time\", \"comment_data\", \"duration\", \"fixed\", \"url\"]", - " }", - "}", - "", - "tests[\"Validate schema JSON\"] = tv4.validate(result, schema);" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"show\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"SVC;{{host_name}},{{service_description}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action", - "equals": true - }, - { - "key": "object", - "value": "centreon_clapi", - "equals": true - } - ] - } - }, - "response": [] - }, - { - "name": "Show Host Realtime", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;", - "var contentType = postman.getResponseHeader(\"Content-Type\");", - "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", - "", - "var jsonData = JSON.parse(responseBody);", - "var result = jsonData.result;", - "", - "var schema = {", - " \"type\": \"array\",", - " \"items\": {", - " \"type\": \"object\",", - " \"properties\": {", - " \"id\": {\"type\": \"string\" },", - " \"host_name\": {\"type\": \"string\"},", - " \"author\": {\"type\": \"string\" },", - " \"actual_start_time\": {\"type\": \"string\" },", - " \"actual_end_time\": {\"type\": \"string\"},", - " \"start_time\": { \"type\": \"string\"},", - " \"end_time\": { \"type\": \"string\"},", - " \"comment_data\": {\"type\": \"string\" },", - " \"duration\": {\"type\": \"string\" },", - " \"fixed\": {\"type\": \"string\" },", - " \"url\": {\"type\": \"string\"}", - " },", - " \"additionalProperties\": false,", - " \"required\": [\"id\", \"host_name\", \"author\", \"actual_start_time\", \"actual_end_time\", \"start_time\", \"end_time\", \"comment_data\", \"duration\", \"fixed\", \"url\"]", - " }", - "}", - "", - "postman.setEnvironmentVariable(\"rtdowntime_id\",result[0].id);", - "", - "tests[\"Validate schema JSON\"] = tv4.validate(result, schema);", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json" - }, - { - "key": "centreon-auth-token", - "value": "{{token}}" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"show\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"HOST;{{host_name}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action", - "equals": true - }, - { - "key": "object", - "value": "centreon_clapi", - "equals": true - } - ] - } - }, - "response": [] - }, - { - "name": "Cancel downtime", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;", - "var contentType = postman.getResponseHeader(\"Content-Type\");", - "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", - "" - ] - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "centreon-auth-token", - "value": "{{token}}" - }, - { - "key": "Content-Type", - "value": "application/json" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"action\": \"CANCEL\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"{{rtdowntime_id}}\"\n}" - }, - "url": { - "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", - "protocol": "http", - "host": [ - "{{url}}" - ], - "path": [ - "centreon", - "api", - "index.php" - ], - "query": [ - { - "key": "action", - "value": "action", - "equals": true - }, - { - "key": "object", - "value": "centreon_clapi", - "equals": true - } - ] - } - }, - "response": [] - } - ] - } - ] + "info": { + "_postman_id": "567914fc-3440-4bae-a58d-cc047cbd5958", + "name": "Centreon Web Rest API realtime", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "00-Authenticate", + "item": [ + { + "name": "Authenticate", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"token\",jsonData.authToken);", + "", + "postman.setGlobalVariable(\"loadHelpers\", function loadHelpers() {", + " \"use strict\";", + " let helpers = {};", + "", + " /** Test function to show this kludge is working. */", + " helpers.test200 = function test200() {", + " tests[\"Response returned 200\"] = responseCode.code === 200;", + " }", + " ", + " helpers.testJson = function testJson() {", + " tests[\"Content-Type header is application/json\"] = postman.getResponseHeader(\"Content-Type\") === 'application/json;charset=utf-8';", + " ", + " let result;", + " try {", + " JSON.parse(responseBody);", + " } catch (e) {", + " result = false;", + " }", + " result = true;", + " ", + " tests[\"Response body uses json format\"] = result;", + " }", + " ", + " helpers.notEmpty = function notEmpty() {", + " tests[\"Result is not empty\"] = JSON.parse(responseBody).length > 0;", + " }", + " ", + " helpers.checkHostListFormat = function checkHostListFormat(columns) {", + " if (typeof columns === 'undefined') {", + " columns = [\"id\", \"name\", \"alias\", \"address\", \"state\", \"state_type\", \"output\", \"max_check_attempts\", \"check_attempt\", \"last_check\", \"last_state_change\", \"last_hard_state_change\", \"acknowledged\", \"instance_name\", \"criticality\"];", + " }", + " ", + " let hostListSchema = {", + " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", + " \"type\": \"array\",", + " \"items\": {\t\t", + " \"type\": \"object\",", + " \"required\": columns,", + " \"properties\": {", + " \"id\": { \"type\": \"string\" },", + " \"name\": { \"type \": \"string\" },", + " \"alias\": { \"type \": \"string\" },", + " \"address\": { \"type\": \"string\" },", + " \"state\": { \"type\": \"string\" },", + " \"state_type\": { \"type \": \"string\" },", + " \"output\": { \"type \": \"string\" },", + " \"max_check_attempts\": { \"type\": \"string\" },", + " \"check_attempt\": { \"type\": \"string\" },", + " \"last_check\": { \"type\": [\"string\", \"null\"] },", + " \"last_state_change\": { \"type\": [\"string\", \"null\"] },", + " \"last_hard_state_change\": { \"type\": [\"string\", \"null\"] },", + " \"acknowledged\": { \"type \": \"string\" },", + " \"instance_name\": { \"type \": \"string\" },", + " \"criticality\": { \"type\": [\"string\", \"null\"] }", + " },", + " \"additionalProperties\": true", + " }", + " };", + " tests[\"host list is well formated\"] = tv4.validate(JSON.parse(responseBody), hostListSchema);", + " }", + " ", + " helpers.checkServiceListFormat = function checkServiceListFormat(columns) {", + " if (typeof columns === 'undefined') {", + " columns = [\"host_id\", \"name\", \"description\", \"service_id\", \"state\", \"state_type\", \"output\", \"perfdata\", \"max_check_attempts\", \"check_attempt\", \"last_check\", \"last_state_change\", \"last_hard_state_change\", \"acknowledged\", \"criticality\"];", + " }", + " ", + " let serviceListSchema = {", + " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", + " \"type\": \"array\",", + " \"items\": {\t\t", + " \"type\": \"object\",", + " \"required\": columns,", + " \"properties\": {", + " \"host_id\": { \"type\": \"string\" },", + " \"name\": { \"type \": \"string\" },", + " \"description\": { \"type \": \"string\" },", + " \"service_id\": { \"type\": \"string\" },", + " \"state\": { \"type\": \"string\" },", + " \"state_type\": { \"type \": \"string\" },", + " \"output\": { \"type \": \"string\" },", + " \"perfdata\": { \"type \": \"string\" },", + " \"max_check_attempts\": { \"type\": \"string\" },", + " \"check_attempt\": { \"type\": \"string\" },", + " \"last_check\": { \"type\": [\"string\", \"null\"] },", + " \"last_state_change\": { \"type\": [\"string\", \"null\"] },", + " \"last_hard_state_change\": { \"type\": [\"string\", \"null\"] },", + " \"acknowledged\": { \"type \": \"string\" },", + " \"criticality\": { \"type\": [\"string\", \"null\"] }", + " },", + " \"additionalProperties\": true", + " }", + " };", + " tests[\"service list is well formated\"] = tv4.validate(JSON.parse(responseBody), serviceListSchema);", + " }", + " ", + " helpers.checkHostList = function checkHostList(columns) {", + " helpers.test200();", + " helpers.testJson();", + " helpers.notEmpty();", + " helpers.checkHostListFormat(columns);", + " }", + " ", + " helpers.checkServiceList = function checkServiceList(columns) {", + " helpers.test200();", + " helpers.testJson();", + " helpers.notEmpty();", + " helpers.checkServiceListFormat(columns);", + " }", + "", + " return helpers;", + "} + '; loadHelpers();'); // when eval'd out of globals, execute it", + "tests[\"helpers initialized\"] = true;", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/x-www-form-urlencoded" + } + ], + "body": { + "mode": "urlencoded", + "urlencoded": [ + { + "key": "username", + "value": "{{api_user}}", + "type": "text" + }, + { + "key": "password", + "value": "{{api_password}}", + "type": "text" + } + ] + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=authenticate", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "authenticate" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "01-Base configuration", + "item": [ + { + "name": "10-Timeperiods", + "item": [ + { + "name": "Add tp", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"tp\",\n \"values\": \"{{tp_name}};{{tp_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam sunday", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};sunday;{{tp_sunday}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam monday", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};monday;{{tp_monday}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam tuesday", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};tuesday;{{tp_tuesday}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam wednesday", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};wednesday;{{tp_wednesday}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam thursday", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};thursday;{{tp_thursday}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam friday", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};friday;{{tp_friday}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam saturday", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"tp\",\n \"values\": \"{{tp_name}};saturday;{{tp_saturday}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + }, + { + "name": "11-Commands", + "item": [ + { + "name": "Add command", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"cmd\",\n \"values\": \"{{command_name}};{{command_type}};{{command_line}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage commands.", + "_postman_isSubFolder": true + }, + { + "name": "21-Contacts", + "item": [ + { + "name": "Add contact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"contact\",\n \"values\": \"{{contact_name}};{{contact_alias}};test@localhost;{{contact_pwd}};0;0;en_US;Idap\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam hostnotifcmd", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};hostnotifcmd;{{command_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam svcnotifcmd", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};svcnotifcmd;{{command_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam hostnotifperiod", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};hostnotifperiod;{{tp_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam svcnotifperiod", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};svcnotifperiod;{{tp_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam hostnotifopt", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};hostnotifopt;{{contact_hostnotifopt}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam svcnotifopt", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias}};servicenotifopt;{{contact_svcnotifopt}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage contact.", + "_postman_isSubFolder": true + }, + { + "name": "22-Contactgroups", + "item": [ + { + "name": "Add contact group", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"cg\",\n \"values\": \"{{cg_name}};{{cg_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Addcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"addcontact\",\n \"object\": \"cg\",\n \"values\": \"{{cg_name}};{{contact_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage contact groups.", + "_postman_isSubFolder": true + }, + { + "name": "23-Hostgroups", + "item": [ + { + "name": "Add hostgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name}};{{hg_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage host groups.", + "_postman_isSubFolder": true + }, + { + "name": "24-Hosts_Categories", + "item": [ + { + "name": "Add host category", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{hc_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Set hc severity", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{hc_severity_level}};{{hc_severity_icon}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage host categories.", + "_postman_isSubFolder": true + }, + { + "name": "25-Services_Categories", + "item": [ + { + "name": "Add service category", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{sc_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Set sc severity", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{sc_severity_level}};{{sc_severity_image}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage service categories.", + "_postman_isSubFolder": true + }, + { + "name": "26-Servicegroups", + "item": [ + { + "name": "Add service group", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{sg_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage service groups.", + "_postman_isSubFolder": true + }, + { + "name": "30-Hosts_Templates", + "item": [ + { + "name": "Create host template", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{htpl_name}};{{host_address}};;central;\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam check_command", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};check_command;{{command_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam check_period", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};check_period;{{tp_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam max_check_attempts", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};max_check_attempts;{{host_max_check_attempts}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam snmp_community", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};snmp_community;{{host_snmp_community}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam snmp_version", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};snmp_version;{{host_snmp_version}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Addcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"addcontactgroup\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{cg_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setcontact\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{contact_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setseverity", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{hc_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + }, + { + "name": "31-Hosts", + "item": [ + { + "name": "Add host", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{host_alias}};{{host_address}};{{htpl_name}};Central;\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam check_command", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};check_command;{{command_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Addtemplate", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"addtemplate\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};{{htpl_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Applytpl", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"applytpl\",\n \"object\":\"host\",\n \"values\": \"{{host_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setcontactgroup\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{cg_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setcontact\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{contact_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Sethostgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"sethostgroup\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{hg_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setseverity", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{hc_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Add host 2", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"host\",\n \"values\": \"{{host_name2}};{{host_alias}};0.0.0.0;{{htpl_name}};Central;\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "add host ack", + "event": [ + { + "listen": "test", + "script": { + "id": "f3ee00c0-a0b5-4789-abbe-8064884869c1", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"host\",\n \"values\": \"ack_host;ack_host;0.0.0.0;{{htpl_name}};central;\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam passif host", + "event": [ + { + "listen": "test", + "script": { + "id": "6d650ea5-2b6a-41c6-acdc-66dae41befdf", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\":\"setparam\",\n \"object\":\"host\",\n \"values\": \"ack_host;passive_checks_enabled;1\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage hosts", + "_postman_isSubFolder": true + }, + { + "name": "40-Services_Templates", + "item": [ + { + "name": "Add service template", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{stpl_alias}};\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam check_period", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};check_period;{{tp_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam check_command", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};check_command;{{command_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam max_check_attempts", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};max_check_attempts;{{stpl_max_check}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Sethosttemplate", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"sethosttemplate\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{htpl_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setcontact\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{contact_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setcontactgroup\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{cg_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage service templates.", + "_postman_isSubFolder": true + }, + { + "name": "41-Services", + "item": [ + { + "name": "Add service", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{stpl_description}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam template", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};template;{{stpl_description}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setseverity", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setseverity\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{sc_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setcontact\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{contact_alias}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setcontactgroup\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{cg_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Set servicegroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{host_name}},{{service_description}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "add service ack", + "event": [ + { + "listen": "test", + "script": { + "id": "4b48e66d-4ef8-4790-9485-f38834c44b43", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"service\",\n \"values\": \"ack_host;ack_service;{{stpl_description}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam active service", + "event": [ + { + "listen": "test", + "script": { + "id": "e9dd0ce3-1f18-4398-9905-91dbb1e5deb8", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"service\",\n \"values\": \"ack_host;ack_service;active_checks_enabled;0\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam passive service", + "event": [ + { + "listen": "test", + "script": { + "id": "e9dd0ce3-1f18-4398-9905-91dbb1e5deb8", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"service\",\n \"values\": \"ack_host;ack_service;passive_checks_enabled;1\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Setparam check_command", + "event": [ + { + "listen": "test", + "script": { + "id": "305f6bd3-0d62-4973-b79e-09058f034f88", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"setparam\",\n \"object\": \"service\",\n \"values\": \"ack_host;ack_service;check_command;{{command_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage services.", + "_postman_isSubFolder": true + }, + { + "name": "99-Generate", + "item": [ + { + "name": "Generate configuration", + "event": [ + { + "listen": "test", + "script": { + "id": "0c2e928b-1180-42a2-af87-9cd81b858f27", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "function wait(millis) {", + " var date = new Date();", + " var curDate = null;", + " do { curDate = new Date(); }", + " while(curDate-date < millis);", + "}", + "", + "wait(5000);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"APPLYCFG\",\n \"values\": \"Central\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + } + ] + }, + { + "name": "10-Host", + "item": [ + { + "name": "host list without parameters", + "item": [ + { + "name": "host list", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + }, + { + "name": "Host list with limit parameter", + "item": [ + { + "name": "Limit", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "limit", + "value": "{{my_limit}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Limit with field name", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList([\"name\"]);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit=2&fields=name", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "limit", + "value": "2" + }, + { + "key": "fields", + "value": "name" + } + ] + } + }, + "response": [] + }, + { + "name": "Limit with all fields", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList([\"id\", \"name\", \"alias\", \"address\", \"state\", \"state_type\", \"output\", \"max_check_attempts\", \"check_attempt\", \"last_check\", \"next_check\", \"last_state_change\", \"last_hard_state_change\", \"acknowledged\", \"instance_name\", \"instance_id\", \"criticality\", \"passive_checks\", \"active_checks\", \"notify\", \"action_url\", \"notes_url\", \"notes\", \"icon_image\", \"icon_image_alt\", \"scheduled_downtime_depth\", \"flapping\"]);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit=2&fields=id,name,alias,address,state,state_type,output,max_check_attempts,check_attempt,last_check,next_check,last_state_change,last_hard_state_change,acknowledged,instance,instance_id,criticality,passive_checks,active_checks,notify,action_url,notes_url,notes,icon_image,icon_image_alt,scheduled_downtime_depth,flapping", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "limit", + "value": "2" + }, + { + "key": "fields", + "value": "id,name,alias,address,state,state_type,output,max_check_attempts,check_attempt,last_check,next_check,last_state_change,last_hard_state_change,acknowledged,instance,instance_id,criticality,passive_checks,active_checks,notify,action_url,notes_url,notes,icon_image,icon_image_alt,scheduled_downtime_depth,flapping" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + }, + { + "name": "Host list with viewType parameter", + "item": [ + { + "name": "list with viewType", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&viewType=all,unhandled,problems", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "viewType", + "value": "all,unhandled,problems" + } + ] + } + }, + "response": [] + }, + { + "name": "with viewType all", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&viewType=all", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "viewType", + "value": "all" + } + ] + } + }, + "response": [] + }, + { + "name": "with viewType unhandled", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&viewType=unhandled", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "viewType", + "value": "unhandled" + } + ] + } + }, + "response": [] + }, + { + "name": "with viewType problems", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&viewType=problems", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "viewType", + "value": "problems" + } + ] + } + }, + "response": [] + }, + { + "name": "viewType with limit", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&viewType=all,unhandled,problems", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "limit", + "value": "{{my_limit}}" + }, + { + "key": "viewType", + "value": "all,unhandled,problems" + } + ] + } + }, + "response": [] + }, + { + "name": "viewType all with limit", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&viewType=all", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "limit", + "value": "{{my_limit}}" + }, + { + "key": "viewType", + "value": "all" + } + ] + } + }, + "response": [] + }, + { + "name": "viewType unhandled with limit", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&viewType=unhandled", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "limit", + "value": "{{my_limit}}" + }, + { + "key": "viewType", + "value": "unhandled" + } + ] + } + }, + "response": [] + }, + { + "name": "viewType problems with limit", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&viewType=problems", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "limit", + "value": "{{my_limit}}" + }, + { + "key": "viewType", + "value": "problems" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + }, + { + "name": "Host list with status filter", + "item": [ + { + "name": "status up with state and name", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&status=up&fields=name, state", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "status", + "value": "up" + }, + { + "key": "fields", + "value": "name, state" + } + ] + } + }, + "response": [] + }, + { + "name": "status down with state and name", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&status=down&fields=name, state", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "status", + "value": "down" + }, + { + "key": "fields", + "value": "name, state" + } + ] + } + }, + "response": [] + }, + { + "name": "status unreachable with state and name", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&status=unreachable&fields=name, state", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "status", + "value": "unreachable" + }, + { + "key": "fields", + "value": "name, state" + } + ] + } + }, + "response": [] + }, + { + "name": "status pending with state and name", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&status=pending&fields=name, state", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "status", + "value": "pending" + }, + { + "key": "fields", + "value": "name, state" + } + ] + } + }, + "response": [] + }, + { + "name": "status all with limit", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList([\"name\", \"state\"]);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&limit={{my_limit}}&status=all&fields=name, state", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "limit", + "value": "{{my_limit}}" + }, + { + "key": "status", + "value": "all" + }, + { + "key": "fields", + "value": "name, state" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + }, + { + "name": "Host list by Host", + "item": [ + { + "name": "search by host name", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "search", + "value": "{{host_name}}" + } + ] + } + }, + "response": [] + }, + { + "name": "search by host name with status up", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&status=up", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "search", + "value": "{{host_name}}" + }, + { + "key": "status", + "value": "up" + } + ] + } + }, + "response": [] + }, + { + "name": "search by host name with status down", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&status=down", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "search", + "value": "{{host_name}}" + }, + { + "key": "status", + "value": "down" + } + ] + } + }, + "response": [] + }, + { + "name": "search by host name with status pending", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&status=pending", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "search", + "value": "{{host_name}}" + }, + { + "key": "status", + "value": "pending" + } + ] + } + }, + "response": [] + }, + { + "name": "search by host name with status unreachable", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&status=unreachable", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "search", + "value": "{{host_name}}" + }, + { + "key": "status", + "value": "unreachable" + } + ] + } + }, + "response": [] + }, + { + "name": "search by host name with id field", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList([\"id\"]);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&fields=id", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "search", + "value": "{{host_name}}" + }, + { + "key": "fields", + "value": "id" + } + ] + } + }, + "response": [] + }, + { + "name": "search by host name with all fields", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkHostList([\"id\", \"name\", \"alias\", \"address\", \"state\", \"state_type\", \"output\", \"max_check_attempts\", \"check_attempt\", \"last_check\", \"next_check\", \"last_state_change\", \"last_hard_state_change\", \"acknowledged\", \"instance_name\", \"instance_id\", \"criticality\", \"passive_checks\", \"active_checks\", \"notify\", \"action_url\", \"notes_url\", \"notes\", \"icon_image\", \"icon_image_alt\", \"scheduled_downtime_depth\", \"flapping\"]);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_hosts&search={{host_name}}&fields=id,name,alias,address,state,state_type,output,max_check_attempts,check_attempt,last_check,next_check,last_state_change,last_hard_state_change,acknowledged,instance,instance_id,criticality,passive_checks,active_checks,notify,action_url,notes_url,notes,icon_image,icon_image_alt,scheduled_downtime_depth,flapping", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_hosts" + }, + { + "key": "search", + "value": "{{host_name}}" + }, + { + "key": "fields", + "value": "id,name,alias,address,state,state_type,output,max_check_attempts,check_attempt,last_check,next_check,last_state_change,last_hard_state_change,acknowledged,instance,instance_id,criticality,passive_checks,active_checks,notify,action_url,notes_url,notes,icon_image,icon_image_alt,scheduled_downtime_depth,flapping" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + } + ] + }, + { + "name": "20-Service", + "item": [ + { + "name": "Service list without parameters", + "item": [ + { + "name": "Service List", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkServiceList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_services" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + }, + { + "name": "Service list by host and service", + "item": [ + { + "name": "Service List by host name", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkServiceList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&searchHost={{host_name}}", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_services" + }, + { + "key": "searchHost", + "value": "{{host_name}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Service List by service description", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkServiceList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&searchHost={{host_name}}&searchService={{service_description}}", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_services" + }, + { + "key": "searchHost", + "value": "{{host_name}}" + }, + { + "key": "searchService", + "value": "{{service_description}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Service List by host name and service description", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkServiceList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&searchHost={{host_name}}&searchService={{service_description}}", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_services" + }, + { + "key": "searchHost", + "value": "{{host_name}}" + }, + { + "key": "searchService", + "value": "{{service_description}}" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + }, + { + "name": "Service list with limit parameter", + "item": [ + { + "name": "Service List with limit", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkServiceList();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&limit={{my_limit}}", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_services" + }, + { + "key": "limit", + "value": "{{my_limit}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Service List with limit and one field", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkServiceList([\"service_id\"]);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&limit={{my_limit}}&fields=id", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_services" + }, + { + "key": "limit", + "value": "{{my_limit}}" + }, + { + "key": "fields", + "value": "id" + } + ] + } + }, + "response": [] + }, + { + "name": "Service List with limit and all fields", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.checkServiceList([", + " \"host_id\",", + " \"host_name\",", + " \"host_alias\",", + " \"host_address\",", + " \"host_state\",", + " \"host_state_type\",", + " \"host_output\",", + " \"host_last_check\",", + " \"host_next_check\",", + " \"host_acknowledged\",", + " \"instance_name\",", + " \"instance_id\",", + " \"host_action_url\",", + " \"host_notes_url\",", + " \"host_icon_image\",", + " \"description\",", + " \"state\",", + " \"state_type\",", + " \"service_id\",", + " \"output\",", + " \"perfdata\",", + " \"current_attempt\",", + " \"last_update\",", + " \"last_state_change\",", + " \"last_hard_state_change\",", + " \"last_check\",", + " \"next_check\",", + " \"max_check_attempts\",", + " \"notes\",", + " \"notes_url\",", + " \"action_url\",", + " \"icon_image\",", + " \"display_name\",", + " \"notify\",", + " \"acknowledged\",", + " \"passive_checks\",", + " \"active_checks\",", + " \"event_handler_enabled\",", + " \"flapping\",", + " \"scheduled_downtime_depth\",", + " \"flap_detection\",", + " \"criticality\"", + " ]);" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&limit={{my_limit}}&fields=host_id,host_name,host_alias,host_address,host_state,host_state_type,host_output,host_last_check,host_next_check,host_acknowledged,instance,instance_id,host_action_url,host_notes_url,host_icon_image,description,state,state_type,id,output,perfdata,current_attempt,last_update,last_state_change,last_hard_state_change,last_check,next_check,max_check_attempts,notes,notes_url,action_url,icon_image,display_name,notify,acknowledged,passive_checks,active_checks,event_handler_enabled,flapping,scheduled_downtime_depth,flap_detection,criticality", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_services" + }, + { + "key": "limit", + "value": "{{my_limit}}" + }, + { + "key": "fields", + "value": "host_id,host_name,host_alias,host_address,host_state,host_state_type,host_output,host_last_check,host_next_check,host_acknowledged,instance,instance_id,host_action_url,host_notes_url,host_icon_image,description,state,state_type,id,output,perfdata,current_attempt,last_update,last_state_change,last_hard_state_change,last_check,next_check,max_check_attempts,notes,notes_url,action_url,icon_image,display_name,notify,acknowledged,passive_checks,active_checks,event_handler_enabled,flapping,scheduled_downtime_depth,flap_detection,criticality" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + }, + { + "name": "Service list with viewType parameter", + "item": [ + { + "name": "Service List with viewType problems", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&viewType=problems", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_services" + }, + { + "key": "viewType", + "value": "problems" + } + ] + } + }, + "response": [] + }, + { + "name": "Service List with viewType unhandled critical", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var helpers = eval(globals.loadHelpers);", + "helpers.test200();", + "helpers.testJson();" + ] + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=list&object=centreon_realtime_services&viewType=unhandled_critical", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "list" + }, + { + "key": "object", + "value": "centreon_realtime_services" + }, + { + "key": "viewType", + "value": "unhandled_critical" + } + ] + } + }, + "response": [] + } + ], + "_postman_isSubFolder": true + } + ] + }, + { + "name": "40-Acknowledgement", + "item": [ + { + "name": "Submit host down", + "event": [ + { + "listen": "test", + "script": { + "id": "6d650ea5-2b6a-41c6-acdc-66dae41befdf", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "function wait(millis) {", + " var date = new Date();", + " var curDate = null;", + " do { curDate = new Date(); }", + " while(curDate-date < millis);", + "}", + "", + "wait(5000);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"results\" : {\n\t\t\"ack\": {\n\t\t\t\"host\":\"ack_host\",\n\t\t\t\"status\":\"1\",\n\t\t\t\"output\": \"down\",\n\t\t\t\"updatetime\": \"1528884076\"\n\t\t}\n\t}\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=submit&object=centreon_submit_results", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "submit" + }, + { + "key": "object", + "value": "centreon_submit_results" + } + ] + } + }, + "response": [] + }, + { + "name": "Submit service down", + "event": [ + { + "listen": "test", + "script": { + "id": "6d650ea5-2b6a-41c6-acdc-66dae41befdf", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "function wait(millis) {", + " var date = new Date();", + " var curDate = null;", + " do { curDate = new Date(); }", + " while(curDate-date < millis);", + "}", + "", + "wait(5000);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"results\" : {\n\t\t\"ack\": {\n\t\t\t\"host\":\"ack_host\",\n\t\t\t\"service\":\"ack_service\",\n\t\t\t\"status\":\"1\",\n\t\t\t\"output\": \"down\",\n\t\t\t\"updatetime\": \"1528884076\"\n\t\t}\n\t}\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=submit&object=centreon_submit_results", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "submit" + }, + { + "key": "object", + "value": "centreon_submit_results" + } + ] + } + }, + "response": [] + }, + { + "name": "Addhost", + "event": [ + { + "listen": "test", + "script": { + "id": "65b7552d-40e3-4319-b092-05e2570ff1a5", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "function wait(millis) {", + " var date = new Date();", + " var curDate = null;", + " do { curDate = new Date(); }", + " while(curDate-date < millis);", + "}", + "", + "wait(5000);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"rtacknowledgement\",\n \"values\": \"HOST;ack_host;my comments;2;0;1\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Addservice", + "event": [ + { + "listen": "test", + "script": { + "id": "231967f9-39a6-4a89-8a6c-c60745b6507e", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "function wait(millis) {", + " var date = new Date();", + " var curDate = null;", + " do { curDate = new Date(); }", + " while(curDate-date < millis);", + "}", + "", + "wait(5000);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"rtacknowledgement\",\n \"values\": \"SVC;ack_host,ack_service;my comments;2;0;1\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "List acknowledgement", + "event": [ + { + "listen": "test", + "script": { + "id": "b7ca0ef2-cb1b-4ce0-835a-9517ec006d8f", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "var contentType = postman.getResponseHeader(\"Content-Type\");", + "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", + "", + "var jsonData = JSON.parse(responseBody);", + "var result= jsonData.result;", + "", + "var schema = {", + " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", + " \"type\": \"array\",", + " \"items\": {", + " \"type\": \"object\",", + " \"properties\": {", + " \"hosts\": { \"type\": \"string\" },", + " \"services\": { \"type\": \"string\" }", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"hosts \"]", + " }", + "};", + "", + "tests[\"Validate schema\"] = tv4.validate(result, schema);", + "", + "try {", + " tests[\"Body contains list of downtimes\"] = result;", + " var i = 0;", + " while (i < result.length) {", + " if (postman.getEnvironmentVariable(\"downtime_name\") == result[i].name){", + " tests[\"Body contains added downtime_name\"] = postman.getEnvironmentVariable(\"downtime_name\") == result[i].name;", + " tests[\"Body contains added downtime_description\"] = postman.getEnvironmentVariable(\"downtime_description\") == result[i].description;", + " break;", + " }", + " i++;", + " }", + " if (i == engineData.length)", + " tests[\"enine_name was found\"] = false;", + "}", + "catch (e) {}", + " " + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"show\",\n \"object\": \"RTACKNOWLEDGEMENT\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "List host", + "event": [ + { + "listen": "test", + "script": { + "id": "b7ca0ef2-cb1b-4ce0-835a-9517ec006d8f", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "var contentType = postman.getResponseHeader(\"Content-Type\");", + "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", + "", + "var jsonData = JSON.parse(responseBody);", + "var result= jsonData.result;", + "", + "var schema = {", + " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", + " \"type\": \"array\",", + " \"items\": {", + " \"type\": \"object\",", + " \"properties\": {", + " \"id\": { \"type\": \"string\" },", + " \"host_name\": { \"type\": \"string\" },", + " \"entry_time\": { \"type\": \"string\" },", + " \"author\": { \"type\": \"string\" },", + " \"comment_data\": { \"type\": \"string\" },", + " \"sticky\": { \"type\": \"string\" },", + " \"notify_contacts\": { \"type\": \"string\" },", + " \"persistent_comment\": { \"type\": \"string\" }", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"id \", \"host_name \", \"entry_time\", \"author\", \"comment_data\", \"sticky\", \"notify_contacts\", \"persistent_comment\"]", + " }", + "};", + "", + "tests[\"Validate schema\"] = tv4.validate(result, schema);", + "", + "try {", + " tests[\"Body contains list of downtimes\"] = result;", + " var i = 0;", + " while (i < result.length) {", + " if (postman.getEnvironmentVariable(\"downtime_name\") == result[i].name){", + " tests[\"Body contains added downtime_name\"] = postman.getEnvironmentVariable(\"downtime_name\") == result[i].name;", + " tests[\"Body contains added downtime_description\"] = postman.getEnvironmentVariable(\"downtime_description\") == result[i].description;", + " break;", + " }", + " i++;", + " }", + " if (i == engineData.length)", + " tests[\"enine_name was found\"] = false;", + "}", + "catch (e) {}", + "", + " ", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"show\",\n \"object\": \"rtacknowledgement\",\n \"values\": \"HOST\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "List service", + "event": [ + { + "listen": "test", + "script": { + "id": "b7ca0ef2-cb1b-4ce0-835a-9517ec006d8f", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "var contentType = postman.getResponseHeader(\"Content-Type\");", + "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", + "", + "var jsonData = JSON.parse(responseBody);", + "var result= jsonData.result;", + "", + "var schema = {", + " \"$schema\": \"http://json-schema.org/draft-04/schema#\",", + " \"type\": \"array\",", + " \"items\": {", + " \"type\": \"object\",", + " \"properties\": {", + " \"id\": { \"type\": \"string\" },", + " \"host_name\": { \"type\": \"string\" },", + " \"service_name\": { \"type\": \"string\" },", + " \"entry_time\": { \"type\": \"string\" },", + " \"author\": { \"type\": \"string\" },", + " \"comment_data\": { \"type\": \"string\" },", + " \"sticky\": { \"type\": \"string\" },", + " \"notify_contacts\": { \"type\": \"string\" },", + " \"persistent_comment\": { \"type\": \"string\" }", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"id \", \"host_name \", \"service_name\", \"entry_time\", \"author\", \"comment_data\", \"sticky\", \"notify_contacts\", \"persistent_comment\"]", + " }", + "};", + "", + "tests[\"Validate schema\"] = tv4.validate(result, schema);", + "", + "try {", + " tests[\"Body contains list of downtimes\"] = result;", + " var i = 0;", + " while (i < result.length) {", + " if (postman.getEnvironmentVariable(\"downtime_name\") == result[i].name){", + " tests[\"Body contains added downtime_name\"] = postman.getEnvironmentVariable(\"downtime_name\") == result[i].name;", + " tests[\"Body contains added downtime_description\"] = postman.getEnvironmentVariable(\"downtime_description\") == result[i].description;", + " break;", + " }", + " i++;", + " }", + " if (i == engineData.length)", + " tests[\"enine_name was found\"] = false;", + "}", + "catch (e) {}", + "", + " ", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"show\",\n \"object\": \"rtacknowledgement\",\n \"values\": \"SVC\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Cancel", + "event": [ + { + "listen": "test", + "script": { + "id": "fc9cb2ef-eaa0-4eb2-af68-af682c1bc004", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"cancel\",\n \"object\": \"rtacknowledgement\",\n \"values\": \"ack_host,ack_service\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ], + "description": "Tests all commands to manage acknowledgement.", + "event": [ + { + "listen": "prerequest", + "script": { + "id": "5361d46e-6312-4e29-a991-4edc94cd4425", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "ea8d41af-e291-4bc7-97be-742bfab32eaf", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "50-Downtime Realtime", + "item": [ + { + "name": "Addhost Realtime", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "postman.setGlobalVariable(\"fixed\", \"1\");", + "", + "var date = new Date(new Date().toLocaleString(\"en-US\", {timeZone: \"Europe/Paris\"}));", + "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", + " ('0' + date.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"start_time\", datetime_start);", + "", + "var dateEnd = new Date(date.setHours(date.getHours()+2));", + "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", + "('0' + dateEnd.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"end_time\", datetime_end);", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"HOST;{{host_name}};{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;0\"\n}\n" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Addservice Realtime", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + }, + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "postman.setGlobalVariable(\"fixed\", \"1\");", + "", + "var date = new Date(new Date().toLocaleString(\"en-US\", {timeZone: \"Europe/Paris\"}));", + "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", + " ('0' + date.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"start_time\", datetime_start);", + "", + "var dateEnd = new Date(date.setHours(date.getHours()+2));", + "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", + "('0' + dateEnd.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"end_time\", datetime_end);", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"SVC;{{host_name}},{{service_description}};{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Addhostgroup Realtime", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + }, + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "postman.setGlobalVariable(\"fixed\", \"1\");", + "", + "var date = new Date();", + "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", + " ('0' + date.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"start_time\", datetime_start);", + "", + "var dateEnd = new Date(date.setHours(date.getHours()+2));", + "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", + "('0' + dateEnd.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"end_time\", datetime_end);" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"HG;{{hg_name}};{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;0\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Addservicegroup Realtime", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;" + ] + } + }, + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "postman.setGlobalVariable(\"fixed\", \"1\");", + "", + "var date = new Date();", + "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", + " ('0' + date.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"start_time\", datetime_start);", + "", + "var dateEnd = new Date(date.setHours(date.getHours()+2));", + "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", + "('0' + dateEnd.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"end_time\", datetime_end);" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"SG;{{sg_name}};{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Addinstance Realtime", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "function wait(millis) {", + " var date = new Date();", + " var curDate = null;", + " do { curDate = new Date(); }", + " while(curDate-date < millis);", + "}", + "", + "wait(5000);" + ] + } + }, + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "postman.setGlobalVariable(\"fixed\", \"1\");", + "", + "var date = new Date();", + "var datetime_start = date.getFullYear() + \"/\" + ('0' + (date.getMonth()+1)).slice(-2) + \"/\" + ('0' + date.getDate()).slice(-2) + \" \" + ('0' + date.getHours()).slice(-2) + \":\" + ", + " ('0' + date.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"start_time\", datetime_start);", + "", + "var dateEnd = new Date(date.setHours(date.getHours()+2));", + "var datetime_end = dateEnd.getFullYear() + \"/\" + ('0' + (dateEnd.getMonth()+1)).slice(-2) + \"/\" + ('0' + dateEnd.getDate()).slice(-2) + \" \" + ('0' + dateEnd.getHours()).slice(-2) + \":\" + ", + "('0' + dateEnd.getMinutes()).slice(-2);", + "postman.setEnvironmentVariable(\"end_time\", datetime_end);" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"add\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"INSTANCE;Central;{{start_time}};{{end_time}};1;3600;Ceci est un commentaire;\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Show Service Realtime", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "var contentType = postman.getResponseHeader(\"Content-Type\");", + "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", + "", + "var jsonData = JSON.parse(responseBody);", + "var result = jsonData.result;", + "", + "var schema = {", + " \"type\": \"array\",", + " \"items\": {", + " \"type\": \"object\",", + " \"properties\": {", + " \"id\": {\"type\": \"string\" },", + " \"host_name\": {\"type\": \"string\" },", + " \"service_name\": {\"type\": \"string\" },", + " \"author\": { \"type\": \"string\" },", + " \"actual_start_time\": { \"type\": \"string\" },", + " \"actual_end_time\": { \"type\": \"string\"},", + " \"start_time\": { \"type\": \"string\"},", + " \"end_time\": {\"type\": \"string\"},", + " \"comment_data\": {\"type\": \"string\" },", + " \"duration\": {\"type\": \"string\" },", + " \"fixed\": { \"type\": \"string\"},", + " \"url\": { \"type\": \"string\" }", + " },", + " \"additionalProperties\": false,", + " \"required\": [\"id\", \"host_name\", \"service_name\", \"author\", \"actual_start_time\", \"actual_end_time\", \"start_time\", \"end_time\", \"comment_data\", \"duration\", \"fixed\", \"url\"]", + " }", + "}", + "", + "tests[\"Validate schema JSON\"] = tv4.validate(result, schema);" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"show\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"SVC;{{host_name}},{{service_description}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Show Host Realtime", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "var contentType = postman.getResponseHeader(\"Content-Type\");", + "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", + "", + "var jsonData = JSON.parse(responseBody);", + "var result = jsonData.result;", + "", + "var schema = {", + " \"type\": \"array\",", + " \"items\": {", + " \"type\": \"object\",", + " \"properties\": {", + " \"id\": {\"type\": \"string\" },", + " \"host_name\": {\"type\": \"string\"},", + " \"author\": {\"type\": \"string\" },", + " \"actual_start_time\": {\"type\": \"string\" },", + " \"actual_end_time\": {\"type\": \"string\"},", + " \"start_time\": { \"type\": \"string\"},", + " \"end_time\": { \"type\": \"string\"},", + " \"comment_data\": {\"type\": \"string\" },", + " \"duration\": {\"type\": \"string\" },", + " \"fixed\": {\"type\": \"string\" },", + " \"url\": {\"type\": \"string\"}", + " },", + " \"additionalProperties\": false,", + " \"required\": [\"id\", \"host_name\", \"author\", \"actual_start_time\", \"actual_end_time\", \"start_time\", \"end_time\", \"comment_data\", \"duration\", \"fixed\", \"url\"]", + " }", + "}", + "", + "postman.setEnvironmentVariable(\"rtdowntime_id\",result[0].id);", + "", + "tests[\"Validate schema JSON\"] = tv4.validate(result, schema);", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "centreon-auth-token", + "value": "{{token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"show\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"HOST;{{host_name}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + }, + { + "name": "Cancel downtime", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "var contentType = postman.getResponseHeader(\"Content-Type\");", + "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", + "" + ] + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "centreon-auth-token", + "value": "{{token}}" + }, + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"action\": \"CANCEL\",\n \"object\": \"RTDOWNTIME\",\n \"values\": \"{{rtdowntime_id}}\"\n}" + }, + "url": { + "raw": "http://{{url}}/centreon/api/index.php?action=action&object=centreon_clapi", + "protocol": "http", + "host": [ + "{{url}}" + ], + "path": [ + "centreon", + "api", + "index.php" + ], + "query": [ + { + "key": "action", + "value": "action" + }, + { + "key": "object", + "value": "centreon_clapi" + } + ] + } + }, + "response": [] + } + ] + } + ] } \ No newline at end of file diff --git a/www/class/centreon-clapi/centreonAPI.class.php b/www/class/centreon-clapi/centreonAPI.class.php index 9cc6929d2fe..1f9c4c3966d 100644 --- a/www/class/centreon-clapi/centreonAPI.class.php +++ b/www/class/centreon-clapi/centreonAPI.class.php @@ -233,6 +233,13 @@ public function __construct( 'export' => false ); + /* RtAcknowledgement */ + $this->relationObject["RTACKNOWLEDGEMENT"] = array( + 'module' => 'core', + 'class' => 'RtAcknowledgement', + 'export' => false + ); + /* Templates */ $this->relationObject["HTPL"] = array( 'module' => 'core', diff --git a/www/class/centreon-clapi/centreonRtAcknowledgement.class.php b/www/class/centreon-clapi/centreonRtAcknowledgement.class.php new file mode 100644 index 00000000000..66dc02689f6 --- /dev/null +++ b/www/class/centreon-clapi/centreonRtAcknowledgement.class.php @@ -0,0 +1,530 @@ +. + * + * Linking this program statically or dynamically with other modules is making a + * combined work based on this program. Thus, the terms and conditions of the GNU + * General Public License cover the whole combination. + * + * As a special exception, the copyright holders of this program give CENTREON + * permission to link this program with independent modules to produce an executable, + * regardless of the license terms of these independent modules, and to copy and + * distribute the resulting executable under terms of CENTREON choice, provided that + * CENTREON also meet, for each linked independent module, the terms and conditions + * of the license of that module. An independent module is a module which is not + * derived from this program. If you modify this program, you may extend this + * exception to your version of the program, but you are not obliged to do so. If you + * do not wish to do so, delete this exception statement from your version. + * + * For more information : contact@centreon.com + * + */ + +namespace CentreonClapi; + +require_once "centreonObject.class.php"; +require_once "centreonHost.class.php"; +require_once "centreonService.class.php"; +require_once "Centreon/Object/Acknowledgement/RtAcknowledgement.php"; +require_once "Centreon/Object/Host/Host.php"; +require_once "Centreon/Object/Service/Service.php"; +require_once realpath(dirname(__FILE__) . '/../centreonExternalCommand.class.php'); +require_once realpath(dirname(__FILE__) . '/../centreonDB.class.php'); +require_once realpath(dirname(__FILE__) . '/../centreonUser.class.php'); +require_once realpath(dirname(__FILE__) . '/../centreonGMT.class.php'); + +/** + * Manage Acknowledgement with clapi + * + * Class CentreonRtAcknowledgement + * @package CentreonClapi + */ +class CentreonRtAcknowledgement extends CentreonObject +{ + /** + * @var array + */ + protected $acknowledgementType = array( + 'HOST', + 'SVC' + ); + + /** + * @var + */ + protected $aHosts; + + /** + * @var + */ + protected $aServices; + + /** + * @var + */ + protected $hostObject; + + /** + * @var + */ + protected $serviceObject; + + /** + * @var + */ + protected $GMTObject; + + /** + * @var + */ + protected $externalCmdObj; + + /** + * @var + */ + protected $author; + + /** + * CentreonRtAcknowledgement constructor. + * @param \Pimple\Container $dependencyInjector + */ + public function __construct(\Pimple\Container $dependencyInjector) + { + parent::__construct($dependencyInjector); + $this->object = new \Centreon_Object_RtAcknowledgement($dependencyInjector); + $this->hostObject = new \CentreonClapi\CentreonHost($dependencyInjector); + $this->serviceObject = new \CentreonClapi\CentreonService($dependencyInjector); + $this->GMTObject = new \CentreonGMT(); + $this->externalCmdObj = new \CentreonExternalCommand(); + $this->action = "RTACKNOWLEDGEMENT"; + $this->author = CentreonUtils::getUserName(); + + $this->externalCmdObj->setUserAlias($this->author); + $this->externalCmdObj->setUserId(CentreonUtils::getUserId()); + } + + /** + * @param $parameters + * @return array + * @throws CentreonClapiException + */ + private function parseParameters($parameters) + { + // Make safe the inputs + list($type, $resource, $comment, $sticky, $notify, $persistent) = explode(';', $parameters); + + // Check if object type is supported + if (!in_array(strtoupper($type), $this->acknowledgementType)) { + throw new CentreonClapiException(self::MISSINGPARAMETER); + } + + // Check if sticky is 0 or 2 + if (!preg_match('/^(0|1|2)$/', $sticky)) { + throw new CentreonClapiException('Bad sticky parameter (0 or 1/2)'); + } + + // Check if notify is 0 or 1 + if (!preg_match('/^(0|1)$/', $notify)) { + throw new CentreonClapiException('Bad notify parameter (0 or 1)'); + } + + // Check if fixed is 0 or 1 + if (!preg_match('/^(0|1)$/', $persistent)) { + throw new CentreonClapiException('Bad persistent parameter (0 or 1)'); + } + + // Make safe the comment + $comment = escapeshellarg($comment); + + return array( + 'type' => $type, + 'resource' => $resource, + 'comment' => $comment, + 'sticky' => $sticky, + 'notify' => $notify, + 'persistent' => $persistent + ); + } + + /** + * @param $parameters + * @return array + */ + private function parseShowParameters($parameters) + { + list($type, $resource) = explode(';', $parameters); + + return array( + 'type' => $type, + 'resource' => $resource, + ); + } + + /** + * show acknowledgement without option + * + * @param null $parameters + * @param array $filter + * @throws CentreonClapiException + */ + public function show($parameters = null, $filter = array()) + { + if ($parameters !== '') { + $parsedParameters = $this->parseShowparameters($parameters); + if (strtoupper($parsedParameters['type']) !== 'HOST' && strtoupper($parsedParameters['type']) !== 'SVC') { + throw new CentreonClapiException(self::UNKNOWNPARAMETER . ' : ' . $parsedParameters['type']); + } + $method = 'show' . ucfirst($parsedParameters['type']); + $this->$method($parsedParameters['resource']); + } else { + $this->aHosts = $this->object->getHostAcknowledgement(); + $this->aServices = $this->object->getSvcAcknowledgement(); + $list = ''; + //all host + if (count($this->aHosts) !== 0) { + foreach ($this->aHosts as $host) { + $list .= $host['name'] . ";\n"; + } + } + + //all service + if (count($this->aServices) !== 0) { + foreach ($this->aServices as $service) { + $list .= $service['name'] . ';' . $service['description'] . " \n"; + } + } + echo "hosts;services\n"; + echo $list; + } + } + + /** + * @param $hostList + * @throws CentreonClapiException + */ + public function showHost($hostList) + { + $fields = array( + 'id', + 'host_name', + 'entry_time', + 'author', + 'comment_data', + 'sticky', + 'notify_contacts', + 'persistent_comment', + ); + + if (!empty($hostList)) { + $hostList = array_filter(explode('|', $hostList)); + $db = $this->db; + $hostList = array_map( + function ($element) use ($db) { + return $db->escape($element); + }, + $hostList + ); + + // check if host exist + $unknownHost = array(); + $existingHost = array(); + foreach ($hostList as $host) { + if ($this->hostObject->getHostID($host) == 0) { + $unknownHost[] = $host; + } else { + $existingHost[] = $host; + } + } + // Result of the research in the base + $hostAcknowledgementList = $this->object->getHostAcknowledgement($existingHost); + } else { + $hostAcknowledgementList = $this->object->getHostAcknowledgement(); + } + + // Init user timezone + $this->GMTObject->getMyGTMFromUser(CentreonUtils::getuserId()); + + echo implode($this->delim, $fields) . "\n"; + //Separates hosts + if (count($hostAcknowledgementList)) { + foreach ($hostAcknowledgementList as $hostAcknowledgement) { + $hostAcknowledgement['entry_time'] = $this->GMTObject->getDate( + 'Y/m/d H:i', + $hostAcknowledgement['entry_time'], + $this->GMTObject->getMyGMT() + ); + + if ($hostAcknowledgement['sticky'] !== 0) { + $hostAcknowledgement['sticky'] = 2; + } + + echo implode($this->delim, array_values($hostAcknowledgement)) . "\n"; + } + } + + if (count($unknownHost) !== 0) { + echo "\n"; + throw new CentreonClapiException(self::OBJECT_NOT_FOUND . ' : Host : ' . implode('|', $unknownHost) . "\n"); + } + } + + /** + * @param $svcList + * @throws CentreonClapiException + */ + public function showSvc($svcList) + { + $serviceAcknowledgementList = array(); + $unknownService = array(); + $existingService = array(); + + $fields = array( + 'id', + 'host_name', + 'service_name', + 'entry_time', + 'author', + 'comment_data', + 'sticky', + 'notify_contacts', + 'persistent_comment', + ); + + if (!empty($svcList)) { + $svcList = array_filter(explode('|', $svcList)); + $db = $this->db; + $svcList = array_map( + function ($arrayElem) use ($db) { + return $db->escape($arrayElem); + }, + $svcList + ); + + // check if service exist + foreach ($svcList as $service) { + $serviceData = explode(',', $service); + if ($this->serviceObject->serviceExists($serviceData[0], $serviceData[1])) { + $existingService[] = $serviceData; + } else { + $unknownService[] = $service; + } + } + + // Result of the research in the base + if (count($existingService)) { + foreach ($existingService as $svc) { + $tmpAcknowledgement = $this->object->getSvcAcknowledgement($svc); + if (!empty($tmpAcknowledgement)) { + $serviceAcknowledgementList[] = $tmpAcknowledgement[0]; + } + } + } + } else { + $serviceAcknowledgementList = $this->object->getSvcAcknowledgement(); + } + + // Init user timezone + $this->GMTObject->getMyGTMFromUser(CentreonUtils::getuserId()); + + //Separates hosts and services + echo implode($this->delim, $fields) . "\n"; + + if (count($serviceAcknowledgementList)) { + foreach ($serviceAcknowledgementList as $serviceAcknowledgement) { + $serviceAcknowledgement['entry_time'] = $this->GMTObject->getDate( + 'Y/m/d H:i', + $serviceAcknowledgement['entry_time'], + $this->GMTObject->getMyGMT() + ); + + if ($serviceAcknowledgement['sticky'] !== 0) { + $serviceAcknowledgement['sticky'] = 2; + } + + echo implode($this->delim, array_values($serviceAcknowledgement)) . "\n"; + } + } + + if (count($unknownService) !== 0) { + echo "\n"; + throw new CentreonClapiException( + self::OBJECT_NOT_FOUND . ' : Service : ' . implode('|', $unknownService) . "\n" + ); + } + + } + + /** + * redirect on SVC or HOST + * + * @param null $parameters + * @return mixed|void + * @throws CentreonClapiException + */ + public function add($parameters = null) + { + $parsedParameters = $this->parseParameters($parameters); + + // to choose the best add (addHostAcknowledgement, addSvcAcknowledgement.) + $method = 'add' . ucfirst($parsedParameters['type']) . 'Acknowledgement'; + + $this->$method( + $parsedParameters['resource'], + $parsedParameters['comment'], + $parsedParameters['sticky'], + $parsedParameters['notify'], + $parsedParameters['persistent'] + ); + } + + /** + * @param $resource + * @param $comment + * @param $sticky + * @param $notify + * @param $persistent + * @throws CentreonClapiException + */ + private function addHostAcknowledgement( + $resource, + $comment, + $sticky, + $notify, + $persistent + ) { + if ($resource === "") { + throw new CentreonClapiException(self::MISSINGPARAMETER); + } + $unknownHost = array(); + $listHost = explode('|', $resource); + + foreach ($listHost as $host) { + if ($this->hostObject->getHostID($host)) { + $this->externalCmdObj->acknowledgeHost( + $host, + $sticky, + $notify, + $persistent, + $this->author, + $comment + ); + } else { + $unknownHost[] = $host; + } + } + + if (count($unknownHost)) { + throw new CentreonClapiException(self::OBJECT_NOT_FOUND . ' HOST : ' . implode('|', $unknownHost)); + } + } + + /** + * @param $resource + * @param $comment + * @param $sticky + * @param $notify + * @param $persistent + * @throws CentreonClapiException + */ + private function addSvcAcknowledgement( + $resource, + $comment, + $sticky, + $notify, + $persistent + ) { + if ($resource === "") { + throw new CentreonClapiException(self::MISSINGPARAMETER); + } + $unknownService = array(); + $existingService = array(); + $listService = explode('|', $resource); + + // check if service exist + foreach ($listService as $service) { + $serviceData = explode(',', $service); + if ($this->serviceObject->serviceExists($serviceData[0], $serviceData[1])) { + $existingService[] = $serviceData; + } else { + $unknownService[] = $service; + } + } + + // Result of the research in the base + if (count($existingService)) { + foreach ($existingService as $service) { + $this->externalCmdObj->acknowledgeService( + $service[0], + $service[1], + $sticky, + $notify, + $persistent, + $this->author, + $comment + ); + } + } + if (count($unknownService)) { + throw new CentreonClapiException(self::OBJECT_NOT_FOUND . ' SERVICE : ' . implode('|', $unknownService)); + } + } + + + /** + * @param null $parameters + * @throws CentreonClapiException + */ + public function cancel($parameters = null) + { + if (empty($parameters) || is_null($parameters)) { + throw new CentreonClapiException(self::MISSINGPARAMETER); + } + $listAcknowledgement = explode('|', $parameters); + $unknownAcknowledgement = array(); + + foreach ($listAcknowledgement as $acknowledgement) { + list($hostName, $serviceName) = explode(',', $acknowledgement); + + if ($serviceName) { + $serviceId = $this->serviceObject->getObjectId($serviceName); + if ($this->object->svcIsAcknowledged($serviceId)) { + $this->externalCmdObj->deleteAcknowledgement( + 'SVC', + array($hostName . ';' . $serviceName => 'on') + ); + } else { + $unknownAcknowledgement[] = $acknowledgement; + } + } else { + $hostId = $this->hostObject->getHostID($hostName); + if ($this->object->hostIsAcknowledged($hostId)) { + $this->externalCmdObj->deleteAcknowledgement( + 'HOST', + array($hostName => 'on') + ); + } else { + $unknownAcknowledgement[] = $acknowledgement; + } + } + } + + if (count($unknownAcknowledgement)) { + throw new CentreonClapiException( + self::OBJECT_NOT_FOUND . ' OR not acknowledged : ' . implode('|', $unknownAcknowledgement) + ); + } + } +} diff --git a/www/class/centreonExternalCommand.class.php b/www/class/centreonExternalCommand.class.php index 91932c28851..c836a830be0 100644 --- a/www/class/centreonExternalCommand.class.php +++ b/www/class/centreonExternalCommand.class.php @@ -404,13 +404,34 @@ public function acknowledgeService( $this->write(); } + /** + * + * Delete acknowledgement. + * @param string $type (HOST/SVC) + * @param array $hosts + */ + public function deleteAcknowledgement($type, $hosts = array()) + { + foreach (array_keys($hosts) as $name) { + $res = preg_split("/\;/", $name); + $oName = $res[0]; + $pollerId = $this->getPollerID($oName); + if ($type === 'SVC') { + $oName .= ';' . $res[1]; + } + $this->setProcessCommand("REMOVE_" . $type . "_ACKNOWLEDGEMENT;" . $oName, $pollerId); + } + $this->write(); + } + + /************ * Downtime ***********/ private function getDowntimeTimestampFromDate($date = 'now', $timezone = '', $start = true) { - $inputDate = new \DateTime($date.' GMT'); + $inputDate = new \DateTime($date . ' GMT'); $dateTime = new \DateTime($date, new \DateTimeZone($timezone)); // Winter to summer dst @@ -615,4 +636,6 @@ public function addSvcDowntime( ); $this->write(); } + + }