From 985c8ba2ac70133ad55b96c382be11ef95b2b099 Mon Sep 17 00:00:00 2001 From: sc979 <34628915+sc979@users.noreply.github.com> Date: Wed, 18 Mar 2020 20:45:54 +0100 Subject: [PATCH] enh(core): replace centcore with gorgoned (#8414) * enh(core): generate centreon gorgone configuration file (#8160) * enh(core): add gorgone configuration file generation * fix: folder paths * fix(core): naming of file and field type * enh(core): update configuration file to take in account last modif * fix(core): correct path to private key * enh(core): add nodes module * enh(core): store stats in cache dir * enh(core): enable broker stats collection * enh(poller) Update poller form to manage gorgone (#8184) * enh(gorgone) Update config form to manage gorgone options (#8197) * enh(chore) replace centcore by gorgone (#8172) * remove centcore perl script (#8209) * fix(UI): do not display gorgone options on central's form (#8206) * fix(UI): do not display gorgone options on central * remove duplicated code (#8215) * enh(admin): adapt broker stats page to new folder tree (#8216) * enh(core): update script to manage gorgone configuration file (#8229) * enh: exception management * enh(update): generate gorgone conf file on update * fix(translation): avoid empty gettext translation * enh(core): Add a yaml configuration loader (#8270) * MON-4737 enh(core): split gorgone configuration in different files (#8276) * enh(core): adapt upgrade script to latest modifications (#8284) * adapt update script * enh: add more check brefore trying to create the conf files * fix: correct path in the template * enh(core): update gorgone configuration files (#8293) * update configuration location * enh(gorgone): Added API to communicate with the Gorgone server (#8294) * enh(install): fix default keys pathes (#8302) * fix db name configuration template * replace remote data folder * fix rest api test * enh(UI): Add nowrap style to badge class - from aladdinchan (#8314) * fix(ui): Add hash:8 suffix to font files to avoid asset conflicts and optimize Webpack config (#8305) * Mon 4640 remove deprecated engine fields (#8233) * fix(CI): add new tests to clapi diff * fix(core): source install (#8396) * enh(core): add gorgone user and copy ssh keys * fix(api): fix options retrieval issue (#8412) * fix(core): manage the gorgone configuration files (#8400) * fix(core): duplicate SSH key on source upgrade (#8421) Co-authored-by: loiclau Co-authored-by: Colin Gagnaire Co-authored-by: Laurent Calvet Co-authored-by: Bruno d'Auria Co-authored-by: Matthieu Kermagoret Co-authored-by: Laurent Pinsivy Co-authored-by: Kevin Duret Co-authored-by: Laurent Calvet Co-authored-by: Kevin Duret --- LICENSE.md | 45 +- bin/centcore | 68 - composer.json | 3 +- composer.lock | 292 +- config/Modules/Centreon.yaml | 7 +- config/bootstrap.php | 3 +- config/bundles.php | 1 + config/centreon-statistics.config.php | 20 + doc/API/centreon-api-v2.yaml | 12 +- doc/en/administration_guide/parameters.rst | 6 +- .../poller/add_manually_a_poller.rst | 2 +- doc/en/api/clapi/objects/instances.rst | 50 +- doc/en/faq/remote_server.rst | 8 +- doc/en/installation/from_sources.rst | 42 +- doc/en/upgrade/from_sources.rst | 8 +- .../poller/add_manually_a_poller.rst | 2 +- doc/fr/api/clapi/objects/instances.rst | 45 +- doc/fr/faq/remote_server.rst | 8 +- doc/fr/installation/from_sources.rst | 42 +- doc/fr/upgrade/from_sources.rst | 8 +- install.sh | 97 +- lang/es_ES.UTF-8/LC_MESSAGES/messages.po | 30 +- lang/fr_FR.UTF-8/LC_MESSAGES/help.po | 16 +- lang/fr_FR.UTF-8/LC_MESSAGES/messages.po | 42 +- lang/pt_BR.UTF-8/LC_MESSAGES/messages.po | 30 +- lang/pt_PT.UTF-8/LC_MESSAGES/messages.po | 30 +- lib/perl/centreon/script/centcore.pm | 1815 - libinstall/CentCore.sh | 218 - libinstall/CentWeb.sh | 77 +- libinstall/functions | 2474 +- logrotate/centcore | 10 - .../Controller/GorgoneController.php | 122 + .../YamlConfigurationLoader.php | 142 + src/Centreon/Domain/Entity/NagiosServer.php | 46 +- src/Centreon/Domain/Gorgone/ActionLog.php | 201 + .../Domain/Gorgone/Command/BasicCommand.php | 82 + .../Domain/Gorgone/Command/CommandFactory.php | 54 + .../Domain/Gorgone/Command/EmptyCommand.php | 61 + .../Command/Internal/ThumbprintCommand.php | 68 + .../Domain/Gorgone/ConfigurationLoader.php | 172 + .../Domain/Gorgone/GorgoneException.php | 27 + .../Domain/Gorgone/GorgoneService.php | 80 + .../Gorgone/Interfaces/CommandInterface.php | 79 + .../Interfaces/CommandRepositoryInterface.php | 41 + .../Interfaces/GorgoneServiceInterface.php | 51 + .../Gorgone/Interfaces/ResponseInterface.php | 88 + .../ResponseRepositoryInterface.php | 42 + src/Centreon/Domain/Gorgone/Response.php | 170 + .../Interfaces/OptionRepositoryInterface.php | 41 + .../Interfaces/OptionServiceInterface.php | 55 + src/Centreon/Domain/Option/Option.php | 81 + .../Domain/Option/OptionException.php | 27 + src/Centreon/Domain/Option/OptionService.php | 70 + .../Gorgone/CommandRepositoryAPI.php | 105 + .../ConfigurationLoaderApiInterface.php | 82 + .../Gorgone/ResponseRepositoryAPI.php | 101 + .../Option/OptionRepositoryRDB.php | 70 + .../Service/CentcoreConfigService.php | 18 +- .../Resources/DefaultConfig/NagiosServer.php | 4 +- .../Resources/RemoteConfig/NagiosServer.php | 7 +- src/Kernel.php | 80 +- symfony.lock | 600 - tests/clapi_export/clapi-configuration.txt | 110 +- .../YamlConfigurationLoaderTest.php | 88 + .../Domain/ConfigurationLoader/child1.yaml | 2 + .../Domain/ConfigurationLoader/child3.yaml | 2 + .../ConfigurationLoader/conf.d/child2.yaml | 2 + .../ConfigurationLoader/conf.d/child3.yaml | 4 + .../ConfigurationLoader/conf.d/child5.yaml | 1 + .../Domain/ConfigurationLoader/root_file.yaml | 6 + .../root_file_with_loop.yaml | 6 + .../Domain/Gorgone/CommandServiceTest.php | 82 + .../Gorgone/first_gorgone_response.json | 6 + .../Gorgone/second_gorgone_response.json | 15 + .../rest_api/rest_api.postman_collection.json | 142279 +++++++-------- .../rest_api.postman_environment.json | 2 +- tmpl/install/debian/centcore.default | 9 - tmpl/install/debian/centcore.init.d | 105 - tmpl/install/redhat/centcore.init.d | 141 - tmpl/install/redhat/centcore.sysconfig | 2 - tmpl/install/redhat/centcore.systemd | 33 - tmpl/install/suse/centcore.init.d | 158 - tmpl/install/suse/centcore.sysconfig | 2 - varinstall/vars | 10 +- .../centreon-clapi/centreonInstance.class.php | 34 +- .../centreon-clapi/centreonSettings.class.php | 2 - www/class/config-generate-remote/Generate.php | 4 +- .../Relations/NagiosServer.php | 6 +- .../config-generate/abstract/object.class.php | 2 +- .../brokerPerformance/brokerPerformance.php | 4 +- .../Administration/parameters/DB-Func.php | 47 +- .../Administration/parameters/api/api.php | 2 +- .../Administration/parameters/api/help.php | 15 +- .../parameters/centcore/centcore.ihtml | 33 - .../parameters/centcore/help.php | 29 - .../parameters/debug/form.ihtml | 2 +- .../Administration/parameters/debug/form.php | 2 +- .../parameters/gorgone/gorgone.ihtml | 75 + .../centcore.php => gorgone/gorgone.php} | 55 +- .../parameters/gorgone/help.php | 70 + .../{centcore => gorgone}/index.html | 0 .../Administration/parameters/parameters.php | 4 +- .../configuration/configServers/DB-Func.php | 646 +- .../configServers/formServers.ihtml | 240 +- .../configServers/formServers.php | 105 +- .../configuration/configServers/help.php | 15 +- .../configServers/listServers.ihtml | 39 +- .../configServers/listServers.php | 44 +- .../configServers/popup/poller.yaml | 19 + .../configServers/popup/popup.ihtml | 32 + .../configServers/popup/popup.php | 179 + .../configServers/popup/remote.yaml | 35 + .../configuration/configServers/servers.php | 30 +- www/install/createTables.sql | 6 +- www/install/insertBaseConf.sql | 8 +- www/install/insertTopology.sql | 3 +- www/install/php/Update-20.04.0-beta.1.php | 149 +- .../sql/centreon/Update-DB-20.04.0-beta.1.sql | 19 + www/install/steps/process/configFileSetup.php | 65 +- www/install/var/baseconf/centreon-broker.sql | 3 - www/install/var/baseconf/centreon-engine.sql | 4 +- www/install/var/config.yaml | 3 + www/install/var/databaseTemplate.yaml | 9 + .../var/gorgone/gorgoneCoreTemplate.yaml | 59 + 124 files changed, 76868 insertions(+), 76673 deletions(-) delete mode 100644 bin/centcore delete mode 100644 lib/perl/centreon/script/centcore.pm delete mode 100755 libinstall/CentCore.sh delete mode 100644 logrotate/centcore create mode 100644 src/Centreon/Application/Controller/GorgoneController.php create mode 100644 src/Centreon/Domain/ConfigurationLoader/YamlConfigurationLoader.php create mode 100644 src/Centreon/Domain/Gorgone/ActionLog.php create mode 100644 src/Centreon/Domain/Gorgone/Command/BasicCommand.php create mode 100644 src/Centreon/Domain/Gorgone/Command/CommandFactory.php create mode 100644 src/Centreon/Domain/Gorgone/Command/EmptyCommand.php create mode 100644 src/Centreon/Domain/Gorgone/Command/Internal/ThumbprintCommand.php create mode 100644 src/Centreon/Domain/Gorgone/ConfigurationLoader.php create mode 100644 src/Centreon/Domain/Gorgone/GorgoneException.php create mode 100644 src/Centreon/Domain/Gorgone/GorgoneService.php create mode 100644 src/Centreon/Domain/Gorgone/Interfaces/CommandInterface.php create mode 100644 src/Centreon/Domain/Gorgone/Interfaces/CommandRepositoryInterface.php create mode 100644 src/Centreon/Domain/Gorgone/Interfaces/GorgoneServiceInterface.php create mode 100644 src/Centreon/Domain/Gorgone/Interfaces/ResponseInterface.php create mode 100644 src/Centreon/Domain/Gorgone/Interfaces/ResponseRepositoryInterface.php create mode 100644 src/Centreon/Domain/Gorgone/Response.php create mode 100644 src/Centreon/Domain/Option/Interfaces/OptionRepositoryInterface.php create mode 100644 src/Centreon/Domain/Option/Interfaces/OptionServiceInterface.php create mode 100644 src/Centreon/Domain/Option/Option.php create mode 100644 src/Centreon/Domain/Option/OptionException.php create mode 100644 src/Centreon/Domain/Option/OptionService.php create mode 100644 src/Centreon/Infrastructure/Gorgone/CommandRepositoryAPI.php create mode 100644 src/Centreon/Infrastructure/Gorgone/Interfaces/ConfigurationLoaderApiInterface.php create mode 100644 src/Centreon/Infrastructure/Gorgone/ResponseRepositoryAPI.php create mode 100644 src/Centreon/Infrastructure/Option/OptionRepositoryRDB.php create mode 100644 tests/php/Centreon/Domain/ConfigurationLoader/YamlConfigurationLoaderTest.php create mode 100644 tests/php/Centreon/Domain/ConfigurationLoader/child1.yaml create mode 100644 tests/php/Centreon/Domain/ConfigurationLoader/child3.yaml create mode 100644 tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child2.yaml create mode 100644 tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child3.yaml create mode 100644 tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child5.yaml create mode 100644 tests/php/Centreon/Domain/ConfigurationLoader/root_file.yaml create mode 100644 tests/php/Centreon/Domain/ConfigurationLoader/root_file_with_loop.yaml create mode 100644 tests/php/Centreon/Domain/Gorgone/CommandServiceTest.php create mode 100644 tests/php/Centreon/Domain/Gorgone/first_gorgone_response.json create mode 100644 tests/php/Centreon/Domain/Gorgone/second_gorgone_response.json delete mode 100644 tmpl/install/debian/centcore.default delete mode 100644 tmpl/install/debian/centcore.init.d delete mode 100644 tmpl/install/redhat/centcore.init.d delete mode 100644 tmpl/install/redhat/centcore.sysconfig delete mode 100644 tmpl/install/redhat/centcore.systemd delete mode 100644 tmpl/install/suse/centcore.init.d delete mode 100644 tmpl/install/suse/centcore.sysconfig delete mode 100644 www/include/Administration/parameters/centcore/centcore.ihtml delete mode 100644 www/include/Administration/parameters/centcore/help.php create mode 100644 www/include/Administration/parameters/gorgone/gorgone.ihtml rename www/include/Administration/parameters/{centcore/centcore.php => gorgone/gorgone.php} (73%) create mode 100644 www/include/Administration/parameters/gorgone/help.php rename www/include/Administration/parameters/{centcore => gorgone}/index.html (100%) create mode 100644 www/include/configuration/configServers/popup/poller.yaml create mode 100644 www/include/configuration/configServers/popup/popup.ihtml create mode 100644 www/include/configuration/configServers/popup/popup.php create mode 100644 www/include/configuration/configServers/popup/remote.yaml create mode 100644 www/install/var/config.yaml create mode 100644 www/install/var/databaseTemplate.yaml create mode 100644 www/install/var/gorgone/gorgoneCoreTemplate.yaml diff --git a/LICENSE.md b/LICENSE.md index 3912109b5cd..f0043de55f3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -279,19 +279,7 @@ POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) + Copyright (C) 2008-2020 CENTREON - contact@centreon.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -307,34 +295,3 @@ the "copyright" line and a pointer to where the full notice is found. along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/bin/centcore b/bin/centcore deleted file mode 100644 index 57b211c9480..00000000000 --- a/bin/centcore +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/perl -################################################################################ -# Copyright 2005-2015 Centreon -# Centreon is developped by : Julien Mathis and Romain Le Merlus under -# GPL Licence 2.0. -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation ; either version 2 of the License. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, see . -# -# 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. -# -#################################################################################### - -use warnings; -use centreon::script::centcore; - -centreon::script::centcore->new()->run(); - -__END__ - -=head1 NAME - -centcore - a daemon to manage pollers. - -=head1 SYNOPSIS - -centcore [options] - -=head1 OPTIONS - -=over 8 - -=item B<--config> - -Specify the path to the main configuration file (default: /etc/centreon/conf.pm). - -=item B<--help> - -Print a brief help message and exits. - -=back - -=head1 DESCRIPTION - -B manage pollers: push configurations, send commands, get perfdata/logs (if ndoutils). - -=cut - diff --git a/composer.json b/composer.json index 3446cd61046..07d29005f74 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,8 @@ "symfony/expression-language": "4.4.*", "ext-json": "*", "justinrainbow/json-schema": "^5.2", - "ext-openssl": "*" + "ext-openssl": "*", + "symfony/http-client": "4.4.*" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 22aaa590eed..74708b42817 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "974738fcc53912bf96c3cdb71a260284", + "content-hash": "894e514772bfd5100e007255225c60dd", "packages": [ { "name": "curl/curl", @@ -2584,6 +2584,131 @@ "homepage": "https://symfony.com", "time": "2020-02-28T13:15:16+00:00" }, + { + "name": "symfony/http-client", + "version": "v4.4.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2", + "reference": "65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/log": "^1.0", + "symfony/http-client-contracts": "^1.1.8|^2", + "symfony/polyfill-php73": "^1.11", + "symfony/service-contracts": "^1.0|^2" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "1.1" + }, + "require-dev": { + "guzzlehttp/promises": "^1.3.1", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^4.3|^5.0", + "symfony/http-kernel": "^4.4", + "symfony/process": "^4.2|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.4-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpClient component", + "homepage": "https://symfony.com", + "time": "2020-02-25T13:55:11+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v1.1.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "088bae75cfa2ec5eb6d33dce17dbd8613150ce6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/088bae75cfa2ec5eb6d33dce17dbd8613150ce6e", + "reference": "088bae75cfa2ec5eb6d33dce17dbd8613150ce6e", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "suggest": { + "symfony/http-client-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-11-07T12:44:51+00:00" + }, { "name": "symfony/http-foundation", "version": "v4.4.5", @@ -4693,17 +4818,17 @@ "source": { "type": "git", "url": "https://github.com/minkphp/Mink.git", - "reference": "ccef1987654e9c2fd0600ce68711ac668ad330eb" + "reference": "07c6a9fe3fa98c2de074b25d9ed26c22904e3887" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/Mink/zipball/ccef1987654e9c2fd0600ce68711ac668ad330eb", - "reference": "ccef1987654e9c2fd0600ce68711ac668ad330eb", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/07c6a9fe3fa98c2de074b25d9ed26c22904e3887", + "reference": "07c6a9fe3fa98c2de074b25d9ed26c22904e3887", "shasum": "" }, "require": { "php": ">=5.3.1", - "symfony/css-selector": "^2.7|^3.0|^4.0" + "symfony/css-selector": "^2.7|^3.0|^4.0|^5.0" }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20", @@ -4720,7 +4845,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -4746,7 +4871,7 @@ "testing", "web" ], - "time": "2020-03-10T12:33:27+00:00" + "time": "2020-03-11T15:45:53+00:00" }, { "name": "behat/mink-extension", @@ -4809,30 +4934,30 @@ }, { "name": "behat/mink-selenium2-driver", - "version": "v1.3.1", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/minkphp/MinkSelenium2Driver.git", - "reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288" + "reference": "312a967dd527f28980cce40850339cd5316da092" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/473a9f3ebe0c134ee1e623ce8a9c852832020288", - "reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288", + "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/312a967dd527f28980cce40850339cd5316da092", + "reference": "312a967dd527f28980cce40850339cd5316da092", "shasum": "" }, "require": { "behat/mink": "~1.7@dev", "instaclick/php-webdriver": "~1.1", - "php": ">=5.3.1" + "php": ">=5.4" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "mink/driver-testsuite": "dev-master" }, "type": "mink-driver", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -4845,15 +4970,15 @@ "MIT" ], "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, { "name": "Pete Otaqui", "email": "pete@otaqui.com", "homepage": "https://github.com/pete-otaqui" + }, + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" } ], "description": "Selenium2 (WebDriver) driver for Mink framework", @@ -4866,7 +4991,7 @@ "testing", "webdriver" ], - "time": "2016-03-05T09:10:18+00:00" + "time": "2020-03-11T14:43:21+00:00" }, { "name": "behat/transliterator", @@ -6784,131 +6909,6 @@ "homepage": "https://symfony.com", "time": "2020-02-04T09:01:01+00:00" }, - { - "name": "symfony/http-client", - "version": "v4.4.5", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-client.git", - "reference": "65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2", - "reference": "65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "psr/log": "^1.0", - "symfony/http-client-contracts": "^1.1.8|^2", - "symfony/polyfill-php73": "^1.11", - "symfony/service-contracts": "^1.0|^2" - }, - "provide": { - "php-http/async-client-implementation": "*", - "php-http/client-implementation": "*", - "psr/http-client-implementation": "1.0", - "symfony/http-client-implementation": "1.1" - }, - "require-dev": { - "guzzlehttp/promises": "^1.3.1", - "nyholm/psr7": "^1.0", - "php-http/httplug": "^1.0|^2.0", - "psr/http-client": "^1.0", - "symfony/dependency-injection": "^4.3|^5.0", - "symfony/http-kernel": "^4.4", - "symfony/process": "^4.2|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpClient\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpClient component", - "homepage": "https://symfony.com", - "time": "2020-02-25T13:55:11+00:00" - }, - { - "name": "symfony/http-client-contracts", - "version": "v1.1.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "088bae75cfa2ec5eb6d33dce17dbd8613150ce6e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/088bae75cfa2ec5eb6d33dce17dbd8613150ce6e", - "reference": "088bae75cfa2ec5eb6d33dce17dbd8613150ce6e", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "suggest": { - "symfony/http-client-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\HttpClient\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to HTTP clients", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-11-07T12:44:51+00:00" - }, { "name": "symfony/phpunit-bridge", "version": "v4.4.5", diff --git a/config/Modules/Centreon.yaml b/config/Modules/Centreon.yaml index 54c0e3356cf..92c36ca8fbd 100644 --- a/config/Modules/Centreon.yaml +++ b/config/Modules/Centreon.yaml @@ -124,6 +124,11 @@ services: Centreon\Domain\Proxy\Interfaces\ProxyRepositoryInterface: class: Centreon\Infrastructure\Proxy\ProxyRepositoryRDB + Centreon\Domain\Gorgone\Interfaces\GorgoneServiceInterface: + class: Centreon\Domain\Gorgone\GorgoneService + public: true + + # Monitoring resources Centreon\Domain\Monitoring\Interfaces\ResourceServiceInterface: class: Centreon\Domain\Monitoring\ResourceService @@ -139,4 +144,4 @@ services: class: Centreon\Infrastructure\Monitoring\TimelineRepositoryRDB calls: - method: setSqlRequestTranslator - arguments: ['@sqlRequestTranslator'] \ No newline at end of file + arguments: ['@sqlRequestTranslator'] diff --git a/config/bootstrap.php b/config/bootstrap.php index 19042df4019..d4931e0e294 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -1,4 +1,5 @@ Pollers > Engine configuration** menu. diff --git a/doc/en/api/clapi/objects/instances.rst b/doc/en/api/clapi/objects/instances.rst index 7f10c81bffd..125e2f4a4ab 100644 --- a/doc/en/api/clapi/objects/instances.rst +++ b/doc/en/api/clapi/objects/instances.rst @@ -13,8 +13,8 @@ Show In order to list available instances, use the **SHOW** action:: [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a show - id;name;localhost;ip address;activate;status;init script;monitoring engine;bin;stats bin;perfdata;ssh port - 1;Central;1;127.0.0.1;1;0;/etc/init.d/nagios;NAGIOS;/usr/local/nagios/bin/nagios;/usr/local/nagios/bin/nagiostats;/usr/local/nagios/var/service-perfdata;22 + id;name;localhost;ip address;activate;status;init script;monitoring engine;bin;stats bin;perfdata;gorgone protocol;gorgone port + 1;Central;1;127.0.0.1;1;0;/etc/init.d/nagios;NAGIOS;/usr/local/nagios/bin/nagios;/usr/local/nagios/bin/nagiostats;/usr/local/nagios/var/service-perfdata;ZMQ;5556 [...] @@ -23,25 +23,31 @@ Columns are the following: ================= ================================================================ Column Description ================= ================================================================ -ID ID +ID ID -Name Name +Name Name -Localhost *1* if it is the main poller, *0* otherwise +Localhost *1* if it is the main poller, *0* otherwise -IP Address IP address of the poller +IP Address IP address of the poller -Activate *1* if poller is enabled, *0* otherwise +Activate *1* if poller is enabled, *0* otherwise -Status *1* if poller is running, *0* otherwise +Status *1* if poller is running, *0* otherwise -Init script Init script path +Init script Init script path -Bin Path of the Scheduler binary +Monitoring Engine Engine used on poller: *CENTREON-ENGINE* -Stats Bin Path of the Nagios Stats binary +Bin Path of the Scheduler binary -SSH Port SSH Port +Stats Bin Path of the Nagios Stats binary + +Perfdata Path of perfdata file + +Gorgone protocol Gorgone communication type (ZMQ, SSH) + +Gorgone Port Gorgone Port ================= ================================================================ @@ -50,18 +56,22 @@ Add In order to add an instance you use the **ADD** action:: - [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a add -v "Poller test;10.30.2.55;22;NAGIOS" + [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a add -v "Poller test;10.30.2.55;ZMQ;5556;NAGIOS" Required fields are: =================== ===================================================== Column Description =================== ===================================================== -Name -Address IP address of the poller +Name Name of the poller -SSH Port SSH port +Address IP address of the poller +Gorgone protocol Gorgone communication type (ZMQ, SSH) + +Gorgone Port Gorgone port + +Monitoring Engine Engine used on poller: *NAGIOS*, *ICINGA*, *SHINKEN* =================== ===================================================== @@ -70,7 +80,7 @@ Del If you want to remove an instance, use the **DEL** action. The Name is used for identifying the instance to delete:: - [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a del -v "Poller test" + [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a del -v "Poller test" Setparam @@ -78,7 +88,7 @@ Setparam If you want to change a specific parameter of an instance, use the **SETPARAM** command. The Name is used for identifying the instance to update:: - [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a setparam -v "Poller test;ns_ip_address;10.30.2.99" + [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a setparam -v "Poller test;ns_ip_address;10.30.2.99" Arguments are composed of the following columns: @@ -119,7 +129,9 @@ nagios_bin Path of the Scheduler binary nagiostats_bin Path of the Nagios Stats binary -ssh_port SSH Port +gorgone_communication_type Gorgone communication type (ZMQ, SSH) + +gorgone_port Gorgone Port broker_reload_command Command to reload Centreon Broker process diff --git a/doc/en/faq/remote_server.rst b/doc/en/faq/remote_server.rst index aca17e23277..05a3ff721c4 100644 --- a/doc/en/faq/remote_server.rst +++ b/doc/en/faq/remote_server.rst @@ -323,13 +323,7 @@ Then generate the Remote Server configuration from the central Centreon server. 3. Missing files in /etc/centreon -Check that **/etc/centreon** includes the following files and that they are not empty: - -* instCentCore.conf -* instCentPlugins.conf -* instCentWeb.conf - -If missing or empty, copy them from the Central Server. +Check that **/etc/centreon/instCentWeb.conf** file is not empty. If missing or empty, copy it from the Central Server. Purge the import tasks table: :: diff --git a/doc/en/installation/from_sources.rst b/doc/en/installation/from_sources.rst index 131aba19bde..8dd0eda0703 100644 --- a/doc/en/installation/from_sources.rst +++ b/doc/en/installation/from_sources.rst @@ -271,7 +271,6 @@ License agreement ----------------- :: - This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the @@ -310,8 +309,7 @@ Answer [y] to all the questions: :: Definition of installation paths -------------------------------- - :: - +:: ------------------------------------------------------------------------ Start CentWeb Installation ------------------------------------------------------------------------ @@ -330,7 +328,7 @@ Definition of installation paths > y Path /var/log/centreon OK - :: +:: Where is your Centreon etc directory ? default to [/etc/centreon] @@ -407,8 +405,7 @@ the user will likely be *centreon-broker*. :: Monitoring logs directory ------------------------- - :: - +:: What is the Monitoring engine log directory ?[/var/log/centreon-engine] default to [/var/log/centreon-engine] > @@ -423,8 +420,7 @@ Monitoring logs directory Sudo configuration ------------------ - :: - +:: ------------------------------------------------------------------------ Configure Sudo ------------------------------------------------------------------------ @@ -463,8 +459,7 @@ Sudo configuration Apache configuration -------------------- - :: - +:: ------------------------------------------------------------------------ Configure Apache server ------------------------------------------------------------------------ @@ -484,8 +479,7 @@ Apache configuration PHP FPM configuration --------------------- - :: - +:: ------------------------------------------------------------------------ Configure PHP FPM service ------------------------------------------------------------------------ @@ -553,8 +547,7 @@ PHP FPM configuration Pear module installation ------------------------ - :: - +:: ------------------------------------------------------------------------ Pear Modules ------------------------------------------------------------------------ @@ -569,8 +562,7 @@ Pear module installation Configuration file installation ------------------------------- - :: - +:: ------------------------------------------------------------------------ Centreon Post Install ------------------------------------------------------------------------ @@ -580,8 +572,7 @@ Configuration file installation Performance data component (CentStorage) installation ----------------------------------------------------- - :: - +:: ------------------------------------------------------------------------ Starting CentStorage Installation ------------------------------------------------------------------------ @@ -619,8 +610,7 @@ Performance data component (CentStorage) installation Poller communication subsystem (CentCore) installation ------------------------------------------------------ - :: - +:: ------------------------------------------------------------------------ Starting CentCore Installation ------------------------------------------------------------------------ @@ -644,17 +634,10 @@ Poller communication subsystem (CentCore) installation CentCore init script installed OK CentCore default script installed OK - Do you want me to install CentCore run level ? - [y/n], default to [n]: - > y - CentCore Perl lib installed OK - Create /etc/centreon/instCentCore.conf OK - Plugin installation ------------------- - :: - +:: ------------------------------------------------------------------------ Starting Centreon Plugins Installation ------------------------------------------------------------------------ @@ -674,8 +657,7 @@ Plugin installation Centreon SNMP trap management installation ------------------------------------------ - :: - +:: ------------------------------------------------------------------------ Starting CentreonTrapD Installation ------------------------------------------------------------------------ diff --git a/doc/en/upgrade/from_sources.rst b/doc/en/upgrade/from_sources.rst index 88139c86d91..24483a0dc74 100644 --- a/doc/en/upgrade/from_sources.rst +++ b/doc/en/upgrade/from_sources.rst @@ -72,8 +72,7 @@ Load the previous installation parameters:: [y/n], default to [y]: > y - Using: /etc/centreon/instCentCore.conf - /etc/centreon/instCentPlugins.conf + Using: /etc/centreon/instCentPlugins.conf /etc/centreon/instCentStorage.conf /etc/centreon/instCentWeb.conf @@ -316,11 +315,6 @@ Fill in the required information. :: CentCore init script installed OK CentCore default script installed OK - Do you want me to install CentCore run level ? - [y/n], default to [n]: - > y - Create /etc/centreon/instCentCore.conf OK - Upgrading Centreon Plugins -------------------------- diff --git a/doc/fr/administration_guide/poller/add_manually_a_poller.rst b/doc/fr/administration_guide/poller/add_manually_a_poller.rst index f6900d20e52..5a58abb1f2d 100644 --- a/doc/fr/administration_guide/poller/add_manually_a_poller.rst +++ b/doc/fr/administration_guide/poller/add_manually_a_poller.rst @@ -27,7 +27,7 @@ Une fois l'installation réalisée, il faut intégrer ce collecteur distant dans .. note:: Si votre collecteur est rattaché à un Remote Server, mais que vous souhaitez envoyer directement la configuration ainsi que les fichiers de configuration directement depuis le serveur Centreon central vers ce collecteur, - désactivez l'option **Use the Remote Server as a proxy for SSH**. + désactivez l'option **Use the Remote Server as a proxy**. #. Rendez-vous dans le menu **Configuration > Collecteur > Configuration du moteur de collecte** #. Sélectionnez la configuration qui correspond au dernier poller ajouté diff --git a/doc/fr/api/clapi/objects/instances.rst b/doc/fr/api/clapi/objects/instances.rst index ce362c2d176..0664693fbfb 100644 --- a/doc/fr/api/clapi/objects/instances.rst +++ b/doc/fr/api/clapi/objects/instances.rst @@ -13,8 +13,8 @@ Show In order to list available instances, use the **SHOW** action:: [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a show - id;name;localhost;ip address;activate;status;init script;monitoring engine;bin;stats bin;perfdata;ssh port - 1;Central;1;127.0.0.1;1;0;/etc/init.d/nagios;NAGIOS;/usr/local/nagios/bin/nagios;/usr/local/nagios/bin/nagiostats;/usr/local/nagios/var/service-perfdata;22 + id;name;localhost;ip address;activate;status;init script;monitoring engine;bin;stats bin;perfdata;gorgone protocol;gorgone port + 1;Central;1;127.0.0.1;1;0;/etc/init.d/nagios;NAGIOS;/usr/local/nagios/bin/nagios;/usr/local/nagios/bin/nagiostats;/usr/local/nagios/var/service-perfdata;ZMQ;5556 [...] @@ -23,29 +23,31 @@ Columns are the following: ================= ================================================================ Column Description ================= ================================================================ -ID ID +ID ID -Name Name +Name Name -Localhost *1* if it is the main poller, *0* otherwise +Localhost *1* if it is the main poller, *0* otherwise -IP Address IP address of the poller +IP Address IP address of the poller -Activate *1* if poller is enabled, *0* otherwise +Activate *1* if poller is enabled, *0* otherwise -Status *1* if poller is running, *0* otherwise +Status *1* if poller is running, *0* otherwise -Init script Init script path +Init script Init script path -Monitoring Engine Engine used on poller: *NAGIOS*, *ICINGA*, *SHINKEN*... +Monitoring Engine Engine used on poller: *CENTREON-ENGINE* -Bin Path of the Scheduler binary +Bin Path of the Scheduler binary -Stats Bin Path of the Nagios Stats binary +Stats Bin Path of the Nagios Stats binary -Perfdata Path of perfdata file +Perfdata Path of perfdata file -SSH Port SSH Port +Gorgone protocol Gorgone communication type (ZMQ, SSH) + +Gorgone Port Gorgone Port ================= ================================================================ @@ -54,17 +56,20 @@ Add In order to add an instance you use the **ADD** action:: - [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a add -v "Poller test;10.30.2.55;22;NAGIOS" + [root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a add -v "Poller test;10.30.2.55;ZMQ;5556;NAGIOS" Required fields are: =================== ===================================================== Column Description =================== ===================================================== -Name -Address IP address of the poller +Name Name of the poller + +Address IP address of the poller -SSH Port SSH port +Gorgone protocol Gorgone communication type (ZMQ, SSH) + +Gorgone Port Gorgone port Monitoring Engine Engine used on poller: *NAGIOS*, *ICINGA*, *SHINKEN* =================== ===================================================== @@ -124,7 +129,9 @@ nagios_bin Path of the Scheduler binary nagiostats_bin Path of the Nagios Stats binary -ssh_port SSH Port +gorgone_communication_type Gorgone communication type (ZMQ, SSH) + +gorgone_port Gorgone Port broker_reload_command Command to reload Centreon Broker process diff --git a/doc/fr/faq/remote_server.rst b/doc/fr/faq/remote_server.rst index 87bd13077ab..bee540ae971 100644 --- a/doc/fr/faq/remote_server.rst +++ b/doc/fr/faq/remote_server.rst @@ -334,13 +334,7 @@ central. 3. Fichiers manquants dans le répertoire /etc/centreon -Vérifiez que le répertoire **/etc/centreon** contient les fichiers suivants : - -* instCentCore.conf -* instCentPlugins.conf -* instCentWeb.conf - -et que ces fichiers ne sont pas vides, sinon copiez les depuis le serveur Centreon +Vérifiez que le fichier **/etc/centreon/instCentWeb.conf** n'est pas vide, sinon copiez le depuis le serveur Centreon Central. Purgez la table des tâches d'import : :: diff --git a/doc/fr/installation/from_sources.rst b/doc/fr/installation/from_sources.rst index b7dc8e4adb8..f2db8145543 100644 --- a/doc/fr/installation/from_sources.rst +++ b/doc/fr/installation/from_sources.rst @@ -274,7 +274,6 @@ Approbation de la licence ------------------------- :: - This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the @@ -315,8 +314,7 @@ Répondez [y] à toutes les questions :: Définition des chemins d'installation ------------------------------------- - :: - +:: ------------------------------------------------------------------------ Start CentWeb Installation ------------------------------------------------------------------------ @@ -335,7 +333,7 @@ Définition des chemins d'installation > y Path /var/log/centreon OK - :: +:: Where is your Centreon etc directory ? default to [/etc/centreon] @@ -412,8 +410,7 @@ l'utilisateur sera vraisemblablement *centreon-broker*. :: Répertoire des journaux d'évènements ------------------------------------ - :: - +:: What is the Monitoring engine log directory ?[/var/log/centreon-engine] default to [/var/log/centreon-engine] > @@ -428,8 +425,7 @@ Répertoire des journaux d'évènements Configuration des droits sudo ----------------------------- - :: - +:: ------------------------------------------------------------------------ Configure Sudo ------------------------------------------------------------------------ @@ -470,8 +466,7 @@ Configuration des droits sudo Configuration du serveur Apache ------------------------------- - :: - +:: ------------------------------------------------------------------------ Configure Apache server ------------------------------------------------------------------------ @@ -490,8 +485,7 @@ Configuration du serveur Apache Configuration de PHP FPM ------------------------ - :: - +:: ------------------------------------------------------------------------ Configure PHP FPM service ------------------------------------------------------------------------ @@ -561,8 +555,7 @@ Configuration de PHP FPM Installation des modules pear ----------------------------- - :: - +:: ------------------------------------------------------------------------ Pear Modules ------------------------------------------------------------------------ @@ -577,8 +570,7 @@ Installation des modules pear Installation du fichier de configuration ---------------------------------------- - :: - +:: ------------------------------------------------------------------------ Centreon Post Install ------------------------------------------------------------------------ @@ -588,8 +580,7 @@ Installation du fichier de configuration Installation du composant CentStorage ------------------------------------- - :: - +:: ------------------------------------------------------------------------ Starting CentStorage Installation ------------------------------------------------------------------------ @@ -627,8 +618,7 @@ Installation du composant CentStorage Installation du composant CentCore ---------------------------------- - :: - +:: ------------------------------------------------------------------------ Starting CentCore Installation ------------------------------------------------------------------------ @@ -652,17 +642,10 @@ Installation du composant CentCore CentCore init script installed OK CentCore default script installed OK - Do you want me to install CentCore run level ? - [y/n], default to [n]: - > y - CentCore Perl lib installed OK - Create /etc/centreon/instCentCore.conf OK - Installation des plugins ------------------------ - :: - +:: ------------------------------------------------------------------------ Starting Centreon Plugins Installation ------------------------------------------------------------------------ @@ -682,8 +665,7 @@ Installation des plugins Installation du système de gestion des traps SNMP (CentreonTrapD) ----------------------------------------------------------------- - :: - +:: ------------------------------------------------------------------------ Starting CentreonTrapD Installation ------------------------------------------------------------------------ diff --git a/doc/fr/upgrade/from_sources.rst b/doc/fr/upgrade/from_sources.rst index f5b448963f2..de70b4ce0dc 100644 --- a/doc/fr/upgrade/from_sources.rst +++ b/doc/fr/upgrade/from_sources.rst @@ -72,8 +72,7 @@ Chargement des paramètres d'installation précédents : :: [y/n], default to [y]: > y - Using: /etc/centreon/instCentCore.conf - /etc/centreon/instCentPlugins.conf + Using: /etc/centreon/instCentPlugins.conf /etc/centreon/instCentStorage.conf /etc/centreon/instCentWeb.conf @@ -339,11 +338,6 @@ De nouvelle informations sont nécessaires : :: CentCore init script installed OK CentCore default script installed OK - Do you want me to install CentCore run level ? - [y/n], default to [n]: - > y - Create /etc/centreon/instCentCore.conf OK - Mise à jour des sondes Centreon ------------------------------- diff --git a/install.sh b/install.sh index 9047fc057b6..320f82bcd2f 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #---- ## @Synopsis Install Script for Centreon project ## @Copyright Copyright 2008, Guillaume Watteeux @@ -34,14 +34,6 @@ ## ## For information : infos@centreon.com # -# Todo list -# - upgrade process -# -- 1.x --> 2.x -# -- 2.x --> 2.x+1 -# -- on upgrade, overwrite existing ? backup ? - -# Debug -#set -x #---- ## Usage information for install.sh @@ -63,7 +55,7 @@ BASE_DIR=$(dirname $0) BASE_DIR=$( cd $BASE_DIR; pwd ) export BASE_DIR if [ -z "${BASE_DIR#/}" ] ; then - echo -e "I think it is not right to have Centreon source on slash" + echo -e "You cannot select the filesystem root folder" exit 1 fi INSTALL_DIR="$BASE_DIR/libinstall" @@ -118,7 +110,7 @@ LOG_FILE=${LOG_FILE:=log\/install_centreon.log} if [ "${FORCE_NO_ROOT:-0}" -ne 0 ]; then USERID=$(id -u) if [ "$USERID" != "0" ]; then - echo -e "$(gettext "You must exec with root user")" + echo -e "$(gettext "You must launch this script using a root user")" exit 1 fi fi @@ -165,7 +157,7 @@ if [ "$_tmp_install_opts" -eq 0 ] ; then fi #Export variable for all programs -export silent_install user_install_vars CENTREON_CONF cinstall_opts inst_upgrade_dir +export silent_install user_install_vars CENTREON_CONF cinstall_opts inst_upgrade_dir upgrade ## init LOG_FILE # backup old log file... @@ -183,13 +175,12 @@ define_specific_binary_vars ${CAT} << __EOT__ ############################################################################### # # -# Centreon (www.centreon.com) # -# Thanks for using Centreon # +# Centreon (www.centreon.com) # # # # infos@centreon.com # # # # Make sure you have installed and configured # -# sudo - sed - php - apache - rrdtool - mysql # +# centreon-gorgone - sudo - sed - php - apache - rrdtool - mysql # # # ############################################################################### __EOT__ @@ -219,6 +210,21 @@ for binary in $BINARIES; do fi done +###### Mandatory step +# ask if gorgone is already installed +echo -e "\n$line" +echo -e "\t$(gettext "Check mandatory gorgone service status")" +echo -e "$line" + +yes_no_default "$(gettext "Is the Gorgone module already installed?")" +if [ "$?" -ne 0 ] ; then + echo_failure "\n$(gettext "Gorgone is required.\nPlease install it before launching this script")" "$fail" + echo -e "\n\t$(gettext "Please read the documentation to manage the Gorgone daemon installation")" + echo -e "\t$(gettext "Available on github") : https://github.com/centreon/centreon-gorgone" + echo -e "\t$(gettext "or on the centreon documentation") : https://documentation.centreon.com/\n" + exit 1 +fi + # Script stop if one binary wasn't found if [ "$binary_fail" -eq 1 ] ; then echo_info "$(gettext "Please check fail binary and retry")" @@ -234,10 +240,11 @@ if [ "$silent_install" -ne 1 ] ; then yes_no_default "$(gettext "Do you accept GPL license ?")" if [ "$?" -ne 0 ] ; then - echo_info "$(gettext "You do not agree to GPL license ? Okay... have a nice day.")" + echo_info "$(gettext "As you did not accept the license, we cannot continue.")" + log "INFO" "Installation aborted - License not accepted" exit 1 else - log "INFO" "$(gettext "You accepted GPL license")" + log "INFO" "Accepted the license" fi else if [ "$upgrade" -eq 0 ] ; then @@ -257,13 +264,13 @@ if [ "$upgrade" -eq 1 ] ; then echo_info "$(gettext "You seem to have an existing Centreon.")\n" yes_no_default "$(gettext "Do you want to use the last Centreon install parameters ?")" "$yes" if [ "$?" -eq 0 ] ; then - echo_passed "\n$(gettext "Using: ") $(ls $inst_upgrade_dir/instCent*)" + echo_passed "\n$(gettext "Using: ") $(ls $inst_upgrade_dir/instCent*)" "$ok" use_upgrade_files="1" fi fi fi -if [ "$silent_install" -ne 1 ] ; then +if [ "$silent_install" -ne 1 ] ; then echo "$line" echo -e "\t$(gettext "Please choose what you want to install")" echo "$line" @@ -278,7 +285,6 @@ fi ## For a moment, isn't possible to install standalone CentStorage daemon ## without CentWeb [ -z $PROCESS_CENTSTORAGE ] && PROCESS_CENTSTORAGE="0" -[ -z $PROCESS_CENTCORE ] && PROCESS_CENTCORE="2" [ -z $PROCESS_CENTREON_PLUGINS ] && PROCESS_CENTREON_PLUGINS="2" [ -z $PROCESS_CENTREON_SNMP_TRAPS ] && PROCESS_CENTREON_SNMP_TRAPS="2" @@ -288,7 +294,7 @@ if [ ! -d "$PERL_LIB_DIR/centreon/" ] ; then log "INFO" "$(gettext "Created perl library directory")" fi -## resquest centreon_www +## request centreon_www if [ "$PROCESS_CENTREON_WWW" -eq 2 ] ; then yes_no_default "$(gettext "Do you want to install") : Centreon Web Front" if [ "$?" -eq 0 ] ; then @@ -299,16 +305,7 @@ if [ "$PROCESS_CENTREON_WWW" -eq 2 ] ; then fi fi -## resquest centreon_centcore -if [ "$PROCESS_CENTCORE" -eq 2 ] ; then - yes_no_default "$(gettext "Do you want to install") : Centreon CentCore" - if [ "$?" -eq 0 ] ; then - PROCESS_CENTCORE="1" - log "INFO" "$(gettext "You chose to install") : Centreon CentCore" - fi -fi - -## resquest centreon_plugins +## request centreon_plugins if [ "$PROCESS_CENTREON_PLUGINS" -eq 2 ] ; then yes_no_default "$(gettext "Do you want to install") : Centreon Nagios Plugins" if [ "$?" -eq 0 ] ; then @@ -317,7 +314,7 @@ if [ "$PROCESS_CENTREON_PLUGINS" -eq 2 ] ; then fi fi -## resquest centreon_snmp_traps +## request centreon_snmp_traps if [ "$PROCESS_CENTREON_SNMP_TRAPS" -eq 2 ] ; then yes_no_default "$(gettext "Do you want to install") : CentreonTrapd process" if [ "$?" -eq 0 ] ; then @@ -358,22 +355,6 @@ if [ "$PROCESS_CENTSTORAGE" -eq 1 ] ; then . $INSTALL_DIR/CentStorage.sh fi -## Start CentCore install -if [ "$PROCESS_CENTCORE" -eq 1 ] ; then - if [ "$use_upgrade_files" -eq 1 -a -e "$inst_upgrade_dir/instCentCore.conf" ] ; then - log "INFO" "$(gettext "Load variables:") $inst_upgrade_dir/instCentCore.conf" - - . $inst_upgrade_dir/instCentCore.conf - if [ -n "$NAGIOS_USER" ]; then - echo_info "$(gettext "Convert variables for upgrade:")" - MONITORINGENGINE_USER=$NAGIOS_USER - [ -n "$NAGIOS_GROUP" ] && MONITORINGENGINE_GROUP=$NAGIOS_GROUP - [ -n "$NAGIOS_ETC" ] && MONITORINGENGINE_ETC=$NAGIOS_ETC - fi - fi - . $INSTALL_DIR/CentCore.sh -fi - ## Start CentPlugins install if [ "$PROCESS_CENTREON_PLUGINS" -eq 1 ] ; then if [ "$use_upgrade_files" -eq 1 -a -e "$inst_upgrade_dir/instCentPlugins.conf" ] ; then @@ -415,19 +396,31 @@ server=$(hostname -f) # Replace global variables ${CAT} << __EOT__ + ############################################################################### # # +# Thanks for using Centreon. # +# ----------------------- # +# # # Go to the URL : http://$server/centreon/ # # to finish the setup # # # -# Report bugs at https://github.com/centreon/centreon/issues # +# Please read the documentation available here : # +# documentation.centreon.com # # # -# Thanks for using Centreon. # -# ----------------------- # -# Contact : infos@centreon.com # +# ------------------------------------------------------------------ # +# # +# Report bugs at https://github.com/centreon/centreon/issues # +# # +# Contact : contact@centreon.com # # http://www.centreon.com # # # +# ----------------------- # +# For security issues, please read our security policy # +# https://github.com/centreon/centreon/security/policy # +# # ############################################################################### + __EOT__ diff --git a/lang/es_ES.UTF-8/LC_MESSAGES/messages.po b/lang/es_ES.UTF-8/LC_MESSAGES/messages.po index 22fd9b6ff29..5123ade7ac8 100644 --- a/lang/es_ES.UTF-8/LC_MESSAGES/messages.po +++ b/lang/es_ES.UTF-8/LC_MESSAGES/messages.po @@ -2581,6 +2581,9 @@ msgstr "Iniciar sesión" msgid "Password" msgstr "Contraseña" +msgid "Username" +msgstr "Nombre de usuario" + #: centreon-web/www/install/steps/step5.php:80 msgid "Confirm password" msgstr "confirmar la contraseña" @@ -3241,8 +3244,8 @@ msgstr "Los archivos SQL se encuentran en %s" #: centreon-web/www/install/step_upgrade/step4.php:87 #, php-format -msgid "Please check the \"upgrade.log\" and the \"sql-error.log\" located in \"%s\" for more details" -msgstr "" +#~ msgid "Please check the \"upgrade.log\" and the \"sql-error.log\" located in \"%s\" for more details" +#~ msgstr "" #: centreon-web/www/install/step_upgrade/step4.php:72 msgid "But do not edit the SQL files unless you know what you are doing.Refresh this page when the problem is fixed." @@ -4029,13 +4032,13 @@ msgstr "Cambiar las opciones de Centcore" #: centreon-web/www/include/Administration/parameters/api/api.php:61 #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:59 -msgid "Enable Broker Statistics Collection" +msgid "Enable Broker statistics collection" msgstr "Habilitar la recuperación de archivos de estadísticas de componentes de Centreon Broker" #: centreon-web/www/include/Administration/parameters/api/api.php:62 #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:60 -msgid "Timeout value for Centcore commands" -msgstr "Tiempo máximo para ejecutar comandos centcore." +msgid "Timeout value for Gorgone commands" +msgstr "Tiempo máximo para ejecutar comandos Gorgone." #: centreon-web/www/include/Administration/parameters/api/api.php:77 #: centreon-web/www/include/options/accessLists/groupsACL/formGroupConfig.php:175 @@ -4595,8 +4598,8 @@ msgid "LDAP User Import debug" msgstr "Depuración de las importaciones de usuarios LDAP" #: centreon-web/www/include/Administration/parameters/debug/form.php:62 -msgid "Centcore Engine debug" -msgstr "Depurando el motor de Centcore" +msgid "Centreon Gorgone debug" +msgstr "Depurando de Centreon Gorgone " #: centreon-web/www/include/Administration/parameters/debug/form.php:63 msgid "Centreontrapd debug" @@ -11237,8 +11240,8 @@ msgid "Server Information" msgstr "Información del servidor" #: centreon-web/www/include/configuration/configServers/formServers.php:102 -msgid "SSH Information" -msgstr "Información SSH" +msgid "Gorgone Information" +msgstr "Información Gorgone" #: centreon-web/www/include/configuration/configServers/formServers.php:103 msgid "Monitoring Engine Information" @@ -14283,3 +14286,12 @@ msgstr "Adjunte Remote Servers adicionales" #~ msgid "This value needs to be an integer lesser than" #~ msgstr "" + +msgid "IP address or hostname" +msgstr "Dirección IP o nombre de host" + +msgid "Use SSL/TLS" +msgstr "Use SSL/TLS" + +msgid "Allow self signed certificate" +msgstr "Permitir certificado autofirmado" diff --git a/lang/fr_FR.UTF-8/LC_MESSAGES/help.po b/lang/fr_FR.UTF-8/LC_MESSAGES/help.po index fc358eae88d..1ed451506d0 100644 --- a/lang/fr_FR.UTF-8/LC_MESSAGES/help.po +++ b/lang/fr_FR.UTF-8/LC_MESSAGES/help.po @@ -6267,8 +6267,12 @@ msgid "Main poller" msgstr "Collecteur principal" #: centreon-web/www/include/configuration/configServers/help.php:7 -msgid "SSH port of the remote poller" -msgstr "Port SSH du collecteur distant" +msgid "Gorgone communication protocol (ZMQ or SSH)" +msgstr "Protocole de communication Gorgone (ZMQ ou SSH)" + +#: centreon-web/www/include/configuration/configServers/help.php:8 +msgid "Gorgone port of the remote poller (5556 or 22)" +msgstr "Port de communication Gorgone (5556 ou 22)" #: centreon-web/www/include/configuration/configServers/help.php:8 msgid "Monitoring engine" @@ -6341,6 +6345,14 @@ msgstr "" "de macros ans cette commande car elles ne seraient pas remplacées. Vérifier " "que les droits d'exécution sont suffisant pour l'utilisateur \"apache\"." +#: centreon-web/www/include/configuration/configServers/help.php:55 +msgid "" +"If checked, it won't use the proxy configured in 'Administration > Parameters > Centreon UI' " +"to connect to the Remote Server." +msgstr "" +"Si coché, il n'utilisera pas le proxy configuré dans 'Administration > Paramètres > Centreon UI' " +"pour se connecter au serveur distant." + #: centreon-web/www/include/configuration/configServers/help.php:22 msgid "Short description of the poller" msgstr "Brève description du collecteur" diff --git a/lang/fr_FR.UTF-8/LC_MESSAGES/messages.po b/lang/fr_FR.UTF-8/LC_MESSAGES/messages.po index f0eca047461..9d140a1aab7 100644 --- a/lang/fr_FR.UTF-8/LC_MESSAGES/messages.po +++ b/lang/fr_FR.UTF-8/LC_MESSAGES/messages.po @@ -2448,6 +2448,14 @@ msgstr "Graphiques" msgid "Poller Name" msgstr "Nom du collecteur" +#: centreon-web/www/include/configuration/configServers/formServers.php:233 +msgid "Gorgone connection protocol" +msgstr "Protocole de connexion utilisé par Gorgone" + +#: centreon-web/www/include/configuration/configServers/formServers.php:224 +msgid "Use the Remote Server as a proxy" +msgstr "Utiliser le serveur distant comme proxy" + #: centreon-web/www/install/smarty_translate.php:849 #: centreon-web/www/include/Administration/parameters/general/form.php:95 #: centreon-web/www/include/monitoring/status/Services/xml/makeXMLForOneHost.php:191 @@ -2812,6 +2820,9 @@ msgstr "Login" msgid "Password" msgstr "Mot de passe" +msgid "Username" +msgstr "Utilisateur" + #: centreon-web/www/install/steps/step5.php:80 msgid "Confirm password" msgstr "Confirmer le mot de passe" @@ -4295,19 +4306,26 @@ msgstr "Modifier les options de Centcore" #: centreon-web/www/include/Administration/parameters/api/api.php:61 #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:59 -msgid "Enable Broker Statistics Collection" -msgstr "" -"Activer la récupération des fichiers de statistiques des composants Centreon " -"Broker" +msgid "Enable Broker statistics collection" +msgstr "Activer la récupération des fichiers de statistiques Broker" #: centreon-web/www/include/Administration/parameters/api/api.php:62 #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:60 -msgid "Timeout value for Centcore commands" -msgstr "Temps maximum d'exécution des commandes centcore" +msgid "Timeout value for Gorgone commands" +msgstr "Temps maximum d'exécution des commandes Gorgone" #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:62 -msgid "Illegal characters for Centcore commands" -msgstr "Caractères illégaux pour les commandes Centcore" +msgid "Illegal characters for Gorgone commands" +msgstr "Caractères illégaux pour les commandes Gorgone" + +msgid "IP address or hostname" +msgstr "Adresse IP ou nom d'hôte" + +msgid "Use SSL/TLS" +msgstr "Utiliser SSL/TLS" + +msgid "Allow self signed certificate" +msgstr "Autoriser les certificats auto-signés" #: centreon-web/www/include/Administration/parameters/api/api.php:77 #: centreon-web/www/include/options/accessLists/groupsACL/formGroupConfig.php:175 @@ -4871,8 +4889,8 @@ msgid "LDAP User Import debug" msgstr "Débogage de l'import d'utilisateurs LDAP" #: centreon-web/www/include/Administration/parameters/debug/form.php:62 -msgid "Centcore Engine debug" -msgstr "Débogage Centcore Engine" +msgid "Centreon Gorgone debug" +msgstr "Débogage de Centreon Gorgone " #: centreon-web/www/include/Administration/parameters/debug/form.php:63 msgid "Centreontrapd debug" @@ -11687,8 +11705,8 @@ msgid "Server Information" msgstr "Informations sur le serveur" #: centreon-web/www/include/configuration/configServers/formServers.php:102 -msgid "SSH Information" -msgstr "Informations SSH" +msgid "Gorgone Information" +msgstr "Informations Gorgone" #: centreon-web/www/include/configuration/configServers/formServers.php:103 msgid "Monitoring Engine Information" diff --git a/lang/pt_BR.UTF-8/LC_MESSAGES/messages.po b/lang/pt_BR.UTF-8/LC_MESSAGES/messages.po index 8af55de7c99..d542de8af7e 100644 --- a/lang/pt_BR.UTF-8/LC_MESSAGES/messages.po +++ b/lang/pt_BR.UTF-8/LC_MESSAGES/messages.po @@ -5815,6 +5815,9 @@ msgstr "Login:" msgid "Password" msgstr "Senha" +msgid "Username" +msgstr "Nome do usuário" + #: centreon-web/www/include/core/login/login.php:55 msgid "Connect" msgstr "Conectar" @@ -6206,8 +6209,8 @@ msgid "LDAP User Import debug" msgstr "Depuração de importação de usuários LDAP" #: centreon-web/www/include/Administration/parameters/debug/form.php:62 -msgid "Centcore Engine debug" -msgstr "Depuração do motor do Centcore" +msgid "Centreon Gorgone debug" +msgstr "Depuração do Centreon Gorgone" #: centreon-web/www/include/Administration/parameters/debug/form.php:63 msgid "Centreontrapd debug" @@ -6229,13 +6232,13 @@ msgstr "Modificar opções do Centcore" #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:59 #: centreon-web/www/include/Administration/parameters/api/api.php:59 -msgid "Enable Broker Statistics Collection" +msgid "Enable Broker statistics collection" msgstr "Ativa coleção de statisticas do Broker" #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:60 #: centreon-web/www/include/Administration/parameters/api/api.php:60 -msgid "Timeout value for Centcore commands" -msgstr "Tempo máximo para comandos do Centcore" +msgid "Timeout value for Gorgone commands" +msgstr "Tempo máximo para comandos do Gorgone" #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:61 #: centreon-web/www/include/Administration/parameters/backup/formBackup.php:107 @@ -7824,8 +7827,8 @@ msgid "Server Information" msgstr "Informações do servidor" #: centreon-web/www/include/configuration/configServers/formServers.php:135 -msgid "SSH Information" -msgstr "Informações SSH" +msgid "Gorgone Information" +msgstr "Informações Gorgone" #: centreon-web/www/include/configuration/configServers/formServers.php:136 msgid "Monitoring Engine Information" @@ -11994,8 +11997,8 @@ msgstr "Os arquivos SQL estão localizados em %s" #: centreon-web/www/install/step_upgrade/step4.php:87 #, php-format -msgid "Please check the \"upgrade.log\" and the \"sql-error.log\" located in \"%s\" for more details" -msgstr "" +#~ msgid "Please check the \"upgrade.log\" and the \"sql-error.log\" located in \"%s\" for more details" +#~ msgstr "" #: centreon-web/www/install/step_upgrade/step4.php:72 msgid "But do not edit the SQL files unless you know what you are doing.Refresh this page when the problem is fixed." @@ -14436,3 +14439,12 @@ msgstr "Anexar Remote Server adicionais" #~ msgid "This value needs to be an integer lesser than" #~ msgstr "" + +msgid "IP address or hostname" +msgstr "Endereço IP ou nome do host" + +msgid "Use SSL/TLS" +msgstr "Use SSL/TLS" + +msgid "Allow self signed certificate" +msgstr "Permitir certificado autoassinado" diff --git a/lang/pt_PT.UTF-8/LC_MESSAGES/messages.po b/lang/pt_PT.UTF-8/LC_MESSAGES/messages.po index 62c5aa5df2c..5cb98cde834 100644 --- a/lang/pt_PT.UTF-8/LC_MESSAGES/messages.po +++ b/lang/pt_PT.UTF-8/LC_MESSAGES/messages.po @@ -5816,6 +5816,9 @@ msgstr "Login:" msgid "Password" msgstr "Senha" +msgid "Username" +msgstr "Nome do usuário" + #: centreon-web/www/include/core/login/login.php:55 msgid "Connect" msgstr "Conectar" @@ -6207,8 +6210,8 @@ msgid "LDAP User Import debug" msgstr "Depuração de importação de utilizadores LDAP" #: centreon-web/www/include/Administration/parameters/debug/form.php:62 -msgid "Centcore Engine debug" -msgstr "Depuração do motor do Centcore" +msgid "Centreon Gorgone debug" +msgstr "Depuração do Centreon Gorgone" #: centreon-web/www/include/Administration/parameters/debug/form.php:63 msgid "Centreontrapd debug" @@ -6230,13 +6233,13 @@ msgstr "Modificar opções do Centcore" #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:59 #: centreon-web/www/include/Administration/parameters/api/api.php:59 -msgid "Enable Broker Statistics Collection" +msgid "Enable Broker statistics collection" msgstr "Ativa coleção de statisticas do Broker" #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:60 #: centreon-web/www/include/Administration/parameters/api/api.php:60 -msgid "Timeout value for Centcore commands" -msgstr "Tempo máximo para comandos do Centcore" +msgid "Timeout value for Gorgone commands" +msgstr "Tempo máximo para comandos do Gorgone" #: centreon-web/www/include/Administration/parameters/centcore/centcore.php:61 #: centreon-web/www/include/Administration/parameters/backup/formBackup.php:107 @@ -7825,8 +7828,8 @@ msgid "Server Information" msgstr "Informações do servidor" #: centreon-web/www/include/configuration/configServers/formServers.php:135 -msgid "SSH Information" -msgstr "Informações SSH" +msgid "Gorgone Information" +msgstr "Informações Gorgone" #: centreon-web/www/include/configuration/configServers/formServers.php:136 msgid "Monitoring Engine Information" @@ -11995,8 +11998,8 @@ msgstr "Os ficheiros SQL estão localizados em %s" #: centreon-web/www/install/step_upgrade/step4.php:87 #, php-format -msgid "Please check the \"upgrade.log\" and the \"sql-error.log\" located in \"%s\" for more details" -msgstr "" +#~ msgid "Please check the \"upgrade.log\" and the \"sql-error.log\" located in \"%s\" for more details" +#~ msgstr "" #: centreon-web/www/install/step_upgrade/step4.php:72 msgid "But do not edit the SQL files unless you know what you are doing.Refresh this page when the problem is fixed." @@ -14437,3 +14440,12 @@ msgstr "Anexar Remote Server adicionais" #~ msgid "This value needs to be an integer lesser than" #~ msgstr "" + +msgid "IP address or hostname" +msgstr "Endereço IP ou nome do host" + +msgid "Use SSL/TLS" +msgstr "Use SSL/TLS" + +msgid "Allow self signed certificate" +msgstr "Permitir certificado autoassinado" diff --git a/lib/perl/centreon/script/centcore.pm b/lib/perl/centreon/script/centcore.pm deleted file mode 100644 index e64ca3ea686..00000000000 --- a/lib/perl/centreon/script/centcore.pm +++ /dev/null @@ -1,1815 +0,0 @@ -################################################################################ -# Copyright 2005-2019 Centreon -# Centreon is developed by : Julien Mathis and Romain Le Merlus under -# GPL Licence 2.0. -# -# This program is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free Software -# Foundation ; either version 2 of the License. -# -# This program is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, see . -# -# 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. -# -#################################################################################### - -package centreon::script::centcore; - -use strict; -use File::Copy; -use File::Path qw(mkpath); -use centreon::script; -use centreon::common::db; -use centreon::common::misc; - -use base qw(centreon::script); - -my %handlers = ('TERM' => {}, 'HUP' => {}, 'DIE' => {}); -use vars qw($centreon_config); - -sub new { - my $class = shift; - my $self = $class->SUPER::new("centcore", - centreon_db_conn => 0, - centstorage_db_conn => 0, - noroot => 1 - ); - - bless $self, $class; - - $self->{echo} = "echo"; - $self->{ssh} = "ssh"; - $self->{scp} = "scp"; - $self->{rsync} = "rsync"; - $self->{rsyncWT} = $self->{rsync}; - $self->{sudo} = "sudo"; - $self->{service} = "service"; - $self->{engineInitScript} = 'centengine'; - $self->{timeout} = 5; - $self->{cmd_timeout} = 5; - $self->{illegal_characters} = ""; - - $self->{ssh} .= " -o ConnectTimeout=$self->{timeout} -o StrictHostKeyChecking=yes -o PreferredAuthentications=publickey -o ServerAliveInterval=10 -o ServerAliveCountMax=3 -o Compression=yes "; - $self->{rsync} .= " --timeout=$self->{timeout} "; - $self->{scp} .= " -o ConnectTimeout=$self->{timeout} -o StrictHostKeyChecking=yes -o PreferredAuthentications=publickey -o ServerAliveInterval=10 -o ServerAliveCountMax=3 -o Compression=yes "; - - $self->{timeBetween2SyncPerf} = 60; - $self->{perfdataSync} = 0; - $self->{logSync} = 0; - $self->{enable_broker_stats} = 0; - $self->{stop} = 1; - $self->{reload} = 1; - - $self->{timeSyncPerf} = 0; - $self->{difTime} = 10; - - %{$self->{commandBuffer}} = (); - - $self->set_signal_handlers; - - return $self; -} - -sub init { - my $self = shift; - $self->SUPER::init(); - - if (!defined $self->{centreon_config}->{VarLib} || $self->{centreon_config}->{VarLib} eq '') { - $self->{centreon_config}->{VarLib} = '/var/lib/centreon'; - } - if (!defined $self->{centreon_config}->{CentreonDir} || $self->{centreon_config}->{CentreonDir} eq '') { - $self->{centreon_config}->{CentreonDir} = '/usr/share/centreon'; - } - if (!defined $self->{centreon_config}->{CacheDir} || $self->{centreon_config}->{CacheDir} eq '') { - $self->{centreon_config}->{CacheDir} = '/var/cache/centreon'; - } - $self->{cmdFile} = $self->{centreon_config}->{VarLib} . "/centcore.cmd"; - $self->{cmdDir} = $self->{centreon_config}->{VarLib} . "/centcore/"; - $self->{centreonDir} = $self->{centreon_config}->{CentreonDir}; - $self->{cacheDir} = $self->{centreon_config}->{CacheDir}; -} - -sub set_signal_handlers { - my $self = shift; - - $SIG{TERM} = \&class_handle_TERM; - $handlers{TERM}->{$self} = sub { $self->handle_TERM() }; - $SIG{__DIE__} = \&class_handle_DIE; - $handlers{DIE}->{$self} = sub { $self->handle_DIE($_[0]) }; - $SIG{HUP} = \&class_handle_HUP; - $handlers{HUP}->{$self} = sub { $self->handle_HUP() }; -} - -sub class_handle_TERM { - foreach (keys %{$handlers{TERM}}) { - &{$handlers{TERM}->{$_}}(); - } -} - -sub class_handle_DIE { - my ($msg) = @_; - - foreach (keys %{$handlers{DIE}}) { - &{$handlers{DIE}->{$_}}($msg); - } -} - -sub class_handle_HUP { - foreach (keys %{$handlers{HUP}}) { - &{$handlers{HUP}->{$_}}(); - } -} - -sub handle_HUP { - my $self = shift; - - $self->{logger}->writeLogInfo("Receiving order to reload..."); - $self->{reload} = 0; -} - -sub handle_TERM { - my $self = shift; - $self->{logger}->writeLogInfo("$$ Receiving order to stop..."); - $self->{stop} = 0; -} - -sub handle_DIE { - my $self = shift; - my $msg = shift; - - $self->{logger}->writeLogInfo("Receiving die: $msg"); - $self->{logger}->writeLogInfo("Dont die..."); -} - -sub reload { - my $self = shift; - - if (defined($self->{log_file})) { - $self->{logger}->file_mode($self->{log_file}); - } - $self->{logger}->redirect_output(); - - # Get Config - unless (my $return = do $self->{config_file}) { - $self->{logger}->writeLogError("couldn't parse $self->{config_file}: $@") if $@; - $self->{logger}->writeLogError("couldn't do $self->{config_file}: $!") unless defined $return; - $self->{logger}->writeLogError("couldn't run $self->{config_file}") unless $return; - } else { - $self->{centreon_config} = $centreon_config; - } - - if ($self->{centreon_config}->{centreon_db} ne $self->{centreon_dbc}->db() || - $self->{centreon_config}->{db_host} ne $self->{centreon_dbc}->host() || - $self->{centreon_config}->{db_user} ne $self->{centreon_dbc}->user() || - $self->{centreon_config}->{db_passwd} ne $self->{centreon_dbc}->password() || - $self->{centreon_config}->{db_port} ne $self->{centreon_dbc}->port()) { - $self->{logger}->writeLogInfo("Database config had been modified"); - $self->{centreon_dbc}->disconnect(); - $self->{centreon_dbc}->db($self->{centreon_config}->{centreon_db}); - $self->{centreon_dbc}->host($self->{centreon_config}->{db_host}); - $self->{centreon_dbc}->user($self->{centreon_config}->{db_user}); - $self->{centreon_dbc}->password($self->{centreon_config}->{db_passwd}); - $self->{centreon_dbc}->port($self->{centreon_config}->{db_port}); - } -} - -########################################################### -# Function to move command file on temporary file -# -sub moveCmdFile($){ - my $self = shift; - my $cmdfile = $_[0]; - - if (move($cmdfile, $cmdfile."_read")) { - return(1); - } else { - $self->{logger}->writeLogError("Cannot move $cmdfile to ".$cmdfile."_read"); - return(0); - } -} - -############################################ -## Get all broker statistics -# -sub getAllBrokerStats { - my $self = shift; - - my ($status, $sth) = $self->{centreon_dbc}->query( - "SELECT `id` FROM `nagios_server` WHERE `localhost` = '0' AND `ns_activate` = '1'" - ); - if ($status == -1) { - $self->{logger}->writeLogError("Error when getting server properties"); - return -1; - } - while (my $data = $sth->fetchrow_hashref()) { - if (!$self->{stop}) { - return ; - } - if ($self->{enable_broker_stats} == 1) { - $self->getBrokerStats($data->{id}); - } - } - return 0; -} - -########################################### -## Get a instant copy of the broker stat -## fifo -# -sub getBrokerStats($) { - my $self = shift; - my ($poller_id) = @_; - my $port = ""; - my $statPipe = "/tmp/.centreon-broker-stats.dat"; - my $destFile = $self->{centreon_config}->{VarLib} . "/broker-stats"; - my $server_info; - my ($lerror, $stdout, $cmd); - - # Check Cache directory - if (!-d $destFile) { - $self->{logger}->writeLogInfo("Create data directory for broker-stats: $destFile"); - mkpath($destFile); - } - - my ($status, $sth) = $self->{centreon_dbc}->query("SELECT config_name, cache_directory " - . "FROM cfg_centreonbroker " - . "WHERE stats_activate='1' " - . "AND ns_nagios_server = '" . $poller_id . "'"); - if ($status == -1) { - $self->{logger}->writeLogError("Error poller broker pipe"); - return -1; - } - while (my $data = $sth->fetchrow_hashref()) { - - # Get poller Configuration - $server_info = $self->getServerConfig($poller_id); - $port = checkSSHPort($server_info->{ssh_port}); - - # Copy the stat file into a buffer - my $statistics_file = $data->{cache_directory} . "/" . $data->{config_name} . "-stats.json"; - $cmd = "$self->{ssh} -q $server_info->{ns_ip_address} -p $port 'cat \"" . $statistics_file . "\" > $statPipe'"; - ($lerror, $stdout) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => $self->{cmd_timeout} - ); - if ($lerror == -1) { - $self->{logger}->writeLogError( - "Could not read pipe " . $statistics_file . " on poller ".$server_info->{ns_ip_address} - ); - } - if (defined($stdout) && $stdout) { - $self->{logger}->writeLogInfo("Result : $stdout"); - } - - $cmd = "$self->{scp} -P $port $server_info->{ns_ip_address}:$statPipe " - . "$destFile/broker-stats-$poller_id.dat >> /dev/null"; - # Get the stats file - ($lerror, $stdout) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => $self->{cmd_timeout} - ); - if ($lerror == -1 && defined($stdout) && $stdout) { - $self->{logger}->writeLogError("Result : $stdout"); - } - } - return 0; -} - -# ------------------- -# Functions -# ------------------- - -sub getEngineConfigurationField($$) { - my $self = shift; - - my ($status, $sth) = $self->{centreon_dbc}->query( - "SELECT " . $_[1] . " FROM `cfg_nagios` WHERE `nagios_server_id` = '" . $_[0] . "' AND nagios_activate = '1'" - ); - if ($status == -1) { - $self->{logger}->writeLogError("Error when getting server properties"); - return undef; - } - my $data = $sth->fetchrow_hashref(); - return $data->{$_[1]}; -} - -sub getLocalServerID(){ - my $self = shift; - - my ($status, $sth) = $self->{centreon_dbc}->query( - "SELECT `id` FROM `nagios_server` WHERE `localhost` = '1' ORDER BY ns_activate DESC LIMIT 1" - ); - if ($status == -1) { - $self->{logger}->writeLogError("Error when getting server properties"); - return undef; - } - my $id = $sth->fetchrow_hashref(); - return $id->{'id'}; -} - -sub getServerConfig($){ - my $self = shift; - - my ($status, $sth) = $self->{centreon_dbc}->query( - "SELECT * FROM `nagios_server` WHERE `id` = '" . $_[0] . "' AND `ns_activate` = '1' LIMIT 1" - ); - if ($status == -1) { - $self->{logger}->writeLogError("Error when getting server properties"); - return undef; - } - my $data = $sth->fetchrow_hashref(); - - # Get Engine User - $data->{'nagios_user'} = $self->getEngineConfigurationField($_[0], 'nagios_user'); - - my ($status, $sth) = $self->{centreon_dbc}->query( - "SELECT remote_server_id FROM `rs_poller_relation` WHERE `poller_server_id` = '" . $_[0] . "'" - ); - if ($status != -1) { - $data->{'additonal_remotes'} = $sth->fetchrow_hashref(); - } - return $data; -} - -################################## -## Run Import / Export Worker -# -sub startWorker($) { - - my $self = shift; - my ($lerror, $stdout, $cmd_line); - my ($status, $sth) = $self->{centreon_dbc}->query( - "SELECT * FROM `contact` WHERE `contact_admin` = '1' AND `contact_activate` = '1' LIMIT 1" - ); - if ($status == -1) { - $self->{logger}->writeLogError("Error selecting admin from db for starting worker"); - return undef; - } - - my $data = $sth->fetchrow_hashref(); - my $username = $data->{'contact_alias'}; - my $passwordEnc = $data->{'contact_passwd'}; - # parse md5 password - if ($passwordEnc =~ m/^md5__(.*)/) { - $passwordEnc = $1; - } - - my $cmdexec = "$self->{centreonDir}/bin/centreon -u %s -p %s -w -o CentreonWorker -a processQueue"; - $self->{logger}->writeLogDebug("cmd: " . sprintf($cmdexec, '', '')); - ($lerror, $stdout) = centreon::common::misc::backtick( - command => sprintf($cmdexec, $username, $passwordEnc), - logger => $self->{logger}, - timeout => $self->{cmd_timeout} - ); - if (defined($stdout) && $stdout) { - if ($lerror == -1) { - $self->{logger}->writeLogError("Result : $stdout"); - } else { - $self->{logger}->writeLogDebug("Result : $stdout"); - } - } - return undef; -} - -################################## -## Run Remote Create Task -# -sub createRemote($) { - - my $self = shift; - my $taskId = $_[0]; - if (!$taskId){ - return undef; - } - my ($lerror, $stdout, $cmd_line); - my ($status, $sth) = $self->{centreon_dbc}->query( - "SELECT * FROM `contact` WHERE `contact_admin` = '1' AND `contact_activate` = '1' LIMIT 1" - ); - if ($status == -1) { - $self->{logger}->writeLogError("Error selecting admin from db for starting worker"); - return undef; - } - - my $data = $sth->fetchrow_hashref(); - my $username = $data->{'contact_alias'}; - my $passwordEnc = $data->{'contact_passwd'}; - # parse md5 password - if ($passwordEnc =~ m/^md5__(.*)/) { - $passwordEnc = $1; - } - - my $cmdexec = "$self->{centreonDir}/bin/centreon -u %s -p %s " - . "-w -o CentreonWorker -a createRemoteTask -v '" . $taskId . "'"; - $self->{logger}->writeLogDebug("cmd: " . sprintf($cmdexec, '', '')); - ($lerror, $stdout) = centreon::common::misc::backtick( - command => sprintf($cmdexec, $username, $passwordEnc), - logger => $self->{logger}, - timeout => $self->{cmd_timeout} - ); - if (defined($stdout) && $stdout) { - if ($lerror == -1) { - $self->{logger}->writeLogError("Result : $stdout"); - } else { - $self->{logger}->writeLogDebug("Result : $stdout"); - } - } - return undef; -} - -################################## -## Check SSH Port Value -# -sub checkSSHPort($) { - my ($value) = @_; - my $port; - - if (defined($value) && $value) { - $port = $value; - } else { - $port = 22; - } - return $port; -} - -###################################################### -## Remove illegal characters from an external command. -## Param : command line -# -sub removeIllegalCharacters($) { - my $self = shift; - my ($cmdLine) = @_; - - return $cmdLine if (!defined($self->{illegal_characters}) || $self->{illegal_characters} eq ''); - - $cmdLine =~ s/[\Q$self->{illegal_characters}\E]//g; - - return $cmdLine; -} - -################################################ -## Send an external command on a remote server. -## Param : id_remote_server, external command -# -sub sendExternalCommand($$) { - my $self = shift; - # Init Parameters - my ($id, $cmd) = @_; - my ($lerror, $return_code, $stdout, $cmd2, $cmd_line); - - # Get server informations - my $server_info = $self->getServerConfig($id); - my $port = checkSSHPort($server_info->{ssh_port}); - - # Get command file - my $command_file = $self->getEngineConfigurationField($id, "command_file"); - - # check if ip address is defined - if (defined($server_info->{ns_ip_address})) { - $cmd =~ s/\\/\\\\/g; - if ($server_info->{localhost} == 1) { - my $result = waitPipe($command_file); - - if ($result == 0) { - # split $cmd in order to send it in multiple line - my $count = 0; - foreach my $cmd1 (split(/\n/, $cmd)) { - if ($count >= 200) { - $cmd2 = "$self->{echo} \"".$cmd_line."\" >> ".$command_file; - $self->{logger}->writeLogInfo("External command on Central Server: ($id) : \"".$cmd_line."\""); - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd2, - logger => $self->{logger}, - timeout => $self->{cmd_timeout} - ); - $cmd_line = ""; - $count = 0; - } else { - $cmd_line .= $self->removeIllegalCharacters($cmd1) . "\n"; - } - $count++; - } - if ($count gt 0) { - $cmd2 = "$self->{echo} \"".$cmd_line."\" >> ".$command_file; - $self->{logger}->writeLogInfo("External command on Central Server: ($id) : \"".$cmd_line."\""); - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd2, - logger => $self->{logger}, - timeout => $self->{cmd_timeout} - ); - $cmd_line = ""; - $count = 0; - } - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError( - "Could not write into pipe file " . $command_file . " on poller " . $id - ); - } - } else { - $self->{logger}->writeLogError( - 'Cannot write external command on central server : "' . $cmd_line . '"' - ); - } - } else { - $cmd =~ s/\'/\'\\\'\'/g; - - # split $cmd in order to send it in multiple line - my $count = 0; - my $totalCount = 0; - my @splittedCommands = split(/\n/, $cmd); - my $countCommands = @splittedCommands; - foreach my $cmd1 (@splittedCommands) { - if (defined($server_info->{remote_id}) - && $server_info->{remote_id} != 0 - && $self->{instance_mode} ne "remote" - && $server_info->{remote_server_centcore_ssh_proxy} == 1 - ) { - $cmd_line .= 'EXTERNALCMD:' . $id . ':' . $self->removeIllegalCharacters($cmd1) . "\n"; - } else { - $cmd_line .= $self->removeIllegalCharacters($cmd1) . "\n"; - } - $count++; - $totalCount++; - - if ($count >= 200 || $totalCount == $countCommands) { - if (defined($server_info->{remote_id}) - && $server_info->{remote_id} != 0 - && $self->{instance_mode} ne "remote" - && $server_info->{remote_server_centcore_ssh_proxy} == 1 - ) { - # Forward commands to Remote Server Master - my $remote_server = $self->getServerConfig($server_info->{remote_id}); - $port = checkSSHPort($remote_server->{ssh_port}); - $cmd_line =~ s/^\s+|\s+$//g; - $cmd2 = "$self->{ssh} -q " . $remote_server->{ns_ip_address} . " -p $port " - . "\"$self->{echo} '" . $cmd_line . "' >> " . $self->{cmdDir} . time() . "-sendcmd\""; - $self->{logger}->writeLogInfo( - "Sending external command using Remote Server: " . $remote_server->{name} - ); - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd2, - logger => $self->{logger}, - timeout => $self->{cmd_timeout}, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send external command %s on Remote Server: %s (%d)", - $cmd_line, - $remote_server->{name}, - $remote_server->{id} - ) - ); - - # Try with additionnals Remote Server - if ($server_info->{additonal_remotes}) { - foreach my $additional_remote_id ($server_info->{additonal_remotes}) { - my $additional_remote_config = $self->getServerConfig($additional_remote_id->{remote_server_id}); - $port = checkSSHPort($additional_remote_config->{ssh_port}); - $self->{logger}->writeLogInfo( - "Try to use additional Remote Server: " . $additional_remote_config->{name} - ); - $cmd2 = "$self->{ssh} -q " . $additional_remote_config->{ns_ip_address} . " -p $port " - . "\"$self->{echo} '" . $cmd_line . "' >> " . $self->{cmdDir} . time() . "-sendcmd\""; - $self->{logger}->writeLogInfo( - "Sending external command using Remote Server: " - . $additional_remote_config->{name} - ); - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd2, - logger => $self->{logger}, - timeout => $self->{cmd_timeout}, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send external command %s on Remote Server: %s (%d)", - $cmd_line, - $additional_remote_config->{name}, - $additional_remote_config->{id} - ) - ); - } else { - # Commands sent, stop loop - $self->{logger}->writeLogInfo( - "External command using Remote Server: " . $additional_remote_config->{name} . " sent" - ); - last; - } - } - } - } else { - $self->{logger}->writeLogInfo( - "External command using Remote Server: " . $remote_server->{name} . " sent" - ); - } - } else { - # Send commands directly to poller - $cmd2 = "$self->{ssh} -q " . $server_info->{ns_ip_address} . " -p $port " - . "\"$self->{echo} '" . $cmd_line."' >> " . $command_file . "\""; - $self->{logger}->writeLogInfo( - "External command : " . $server_info->{ns_ip_address} . " ($id) : \"" . $cmd_line . "\"" - ); - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd2, - logger => $self->{logger}, - timeout => $self->{cmd_timeout} - ); - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Could not write into pipe file " . $command_file . " on poller: " . $id - )); - } - } - - $cmd_line = ""; - $count = 0; - } - } - } - - if (defined($stdout) && $stdout){ - $self->{logger}->writeLogInfo("Result : $stdout"); - } - } else { - $self->{logger}->writeLogError("Ip address not defined for poller $id"); - } -} - -####################################### -## Wait Centreon Engine Pipe availability -# -sub waitPipe($) { - my ($pipe) = @_; - my $i = 0; - while (! -p $pipe) { - sleep(1); - $i++; - if ($i >= 30) { - return 1; - } - } - return 0; -} - -## -# Checks if rotation occurred, -# -sub checkRotation($$$$$) { - my $self = shift; - my $instanceId = $_[0]; - my $lastUpdate = $_[1]; - my $remoteConnection = $_[2]; - my $localLogFile = $_[3]; - my $port = $_[4]; - my ($lerror, $stdout, $cmd); - - my $archivePath = $self->getEngineConfigurationField($instanceId, 'log_archive_path'); - my $getLastCmd = 'echo "$(find '.$archivePath.' -type f -exec stat -c "%Z:%n" {} \; | sort | tail -1)"'; - $cmd = "$self->{ssh} -p $port -q $remoteConnection '$getLastCmd'"; - - ($lerror, $stdout) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 120 - ); - my $updateTime = $1; - my $fileName = $2; - if (defined($updateTime) && defined($lastUpdate) && $updateTime > $lastUpdate) { - $cmd = "$self->{scp} -P $port $remoteConnection:$fileName $localLogFile.rotate > /dev/null"; - - ($lerror, $stdout) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 120 - ); - $self->{logger}->writeLogInfo("Info: copied rotated file for instance $instanceId"); - } -} - -################################################## -# Send config files to a poller -# -sub sendConfigFile($) { - my $self = shift; - # Init Values - my $id = $_[0]; - my ($lerror, $return_code, $stdout, $cmd); - - my $cfg_dir = $self->getEngineConfigurationField($id, "cfg_dir"); - my $server_info = $self->getServerConfig($id); - my ($origin, $dest, $remote_server); - my $port = checkSSHPort($server_info->{ssh_port}); - - if (!defined($cfg_dir) || $cfg_dir =~ //) { - $self->{logger}->writeLogError( - "Engine configuration file is empty for poller $id. Please check centengine.cfg file." - ); - return; - } - - # Send configuration for Centreon Engine - if (defined($server_info->{remote_id}) - && $server_info->{remote_id} != 0 - && $self->{instance_mode} ne "remote" - && $server_info->{remote_server_centcore_ssh_proxy} == 1 - ) { - $remote_server = $self->getServerConfig($server_info->{remote_id}); - $self->{logger}->writeLogInfo( - 'Send Centreon Engine config files ' . - 'on poller "' . $server_info->{name} . '" (' . $server_info->{id} . ') ' . - 'using Remote Server: ' . $remote_server->{name} . ' (' . $remote_server->{id} . ')' - ); - - $origin = $self->{cacheDir} . "/config/engine/" . $id; - $dest = $remote_server->{'ns_ip_address'} . ":" . $self->{cacheDir} . "/config/engine"; - $port = checkSSHPort($remote_server->{ssh_port}); - $cmd = "$self->{scp} -r -P $port $origin $dest 2>&1"; - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send Centreon Engine config files on Remote Server: %s (%d)", - $remote_server->{'name'}, - $remote_server->{'id'} - ) - ); - - # Try with additionnals Remote Server - if ($server_info->{'additonal_remotes'}) { - foreach my $additional_remote_id ($server_info->{additonal_remotes}) { - my $additional_remote_config = $self->getServerConfig($additional_remote_id->{remote_server_id}); - $self->{logger}->writeLogInfo( - "Try to use additional Remote Server: " . $additional_remote_config->{name} - ); - $dest = $additional_remote_config->{'ns_ip_address'} . ":" . $self->{cacheDir} . "/config/engine"; - $port = checkSSHPort($additional_remote_config->{ssh_port}); - $cmd = "$self->{scp} -r -P $port $origin $dest 2>&1"; - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send Centreon Engine config files on Remote Server: %s (%d)", - $additional_remote_config->{name}, - $additional_remote_config->{id} - ) - ); - } else { - # Commands sent, stop loop - $self->{logger}->writeLogInfo(sprintf( - "Centreon Engine configuration using Remote Server: %s sent", - $additional_remote_config->{name} - )); - last; - } - } - } - } - } else { - $cfg_dir = $self->getEngineConfigurationField($id, "cfg_dir"); - $origin = $self->{cacheDir} . "/config/engine/" . $id . "/*"; - $dest = $server_info->{'ns_ip_address'} . ":$cfg_dir"; - $cmd = "$self->{scp} -P $port $origin $dest 2>&1"; - - # Send data with SCP - $self->{logger}->writeLogInfo( - 'Send Centreon Engine config files ' . - 'on poller "' . $server_info->{name} . '" (' . $server_info->{id} . ')' - ); - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError('Send Centreon Engine config files problems'); - } - } - - if (defined($stdout) && $stdout) { - $self->{logger}->writeLogInfo("Result : $stdout"); - } - - # Send configuration for Centreon Broker - if (-e $self->{cacheDir} . "/config/broker/" . $id) { - # Check availability of broker files. - my $count = 0; - opendir(my $dh, $self->{cacheDir} . "/config/broker/" . $id); - while(readdir $dh) { - $count++; - } - closedir $dh; - - if ($count > 2) { - if ($server_info->{localhost} == 0) { - if (defined($server_info->{remote_id}) - && $server_info->{remote_id} != 0 - && $self->{instance_mode} ne "remote" - && $server_info->{remote_server_centcore_ssh_proxy} == 1 - ) { - $remote_server = $self->getServerConfig($server_info->{remote_id}); - $self->{logger}->writeLogInfo( - 'Send Centreon Broker config files ' . - 'on poller "' . $server_info->{name} . '" (' . $server_info->{id} . ') ' . - 'using remote server "' . $remote_server->{name} . '" (' . $remote_server->{id} . ')' - ); - $origin = $self->{cacheDir} . "/config/broker/" . $id; - $dest = $remote_server->{'ns_ip_address'} . ":" . $self->{cacheDir} . "/config/broker"; - $cmd = "$self->{scp} -r -P $port $origin $dest 2>&1"; - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send Centreon Broker config files on Remote Server: %s (%d)", - $remote_server->{'name'}, - $remote_server->{'id'} - ) - ); - - # Try with additionnals Remote Server - if ($server_info->{'additonal_remotes'}) { - foreach my $additional_remote_id ($server_info->{additonal_remotes}) { - my $additional_remote_config = $self->getServerConfig($additional_remote_id->{remote_server_id}); - $self->{logger}->writeLogInfo( - "Try to use additional Remote Server: " . $additional_remote_config->{name} - ); - $dest = $additional_remote_config->{'ns_ip_address'} . ":" . $self->{centreonDir} . "/filesGeneration/broker"; - $cmd = "$self->{scp} -r -P $port $origin $dest 2>&1"; - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send Centreon Broker config files on Remote Server: %s (%d)", - $additional_remote_config->{name}, - $additional_remote_config->{id} - ) - ); - } else { - # Commands sent, stop loop - $self->{logger}->writeLogInfo( - "Centreon Broker config using Remote Server: " . $additional_remote_config->{name} . " sent" - ); - last; - } - } - } - } - } else { - $self->{logger}->writeLogInfo( - 'Send Centreon Broker config files ' . - 'on poller "' . $server_info->{name} . '" (' . $server_info->{id} . ')' - ); - $cfg_dir = $server_info->{'centreonbroker_cfg_path'}; - $origin = $self->{cacheDir} . "/config/broker/" . $id . "/*.*"; - $dest = $server_info->{ns_ip_address}.":$cfg_dir"; - $cmd = "$self->{scp} -P $port $origin $dest 2>&1"; - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300 - ); - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError('Send Centreon Broker config files problems'); - } - } - } else { - $self->{logger}->writeLogInfo( - 'Send Centreon Broker config files ' . - 'on poller "' . $server_info->{name} . '" (' . $server_info->{id} . ')' - ); - $cmd = "cp $origin $cfg_dir 2>&1"; - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 60 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError('Send Centreon Broker config files problems'); - } - } - - if (defined($stdout) && $stdout) { - $self->{logger}->writeLogInfo("Result : $stdout"); - } - } - } - - # send command on Remote Server to export configuration - if (defined($server_info->{remote_id}) - && $server_info->{remote_id} != 0 - && $self->{instance_mode} ne "remote" - && $server_info->{remote_server_centcore_ssh_proxy} == 1 - ) { - $remote_server = $self->getServerConfig($server_info->{remote_id}); - $self->{logger}->writeLogDebug( - 'Send command on Remote Server "' . $remote_server->{name} . '" to export configuration' - ); - $port = checkSSHPort($remote_server->{ssh_port}); - $cmd = "$self->{ssh} -p $port " . $remote_server->{'ns_ip_address'} . " " - . "'echo \"SENDCFGFILE:" . $id . "\" >> $self->{cmdDir}/" . time() . "-sendcmd'"; - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't forward SENDCFGFILE order on Remote Server: %s (%d)", - $remote_server->{name}, - $remote_server->{id} - )); - - # Try with additionnals Remote Server - if ($server_info->{additonal_remotes}) { - foreach my $additional_remote_id ($server_info->{additonal_remotes}) { - my $additional_remote_config = $self->getServerConfig($additional_remote_id->{remote_server_id}); - $self->{logger}->writeLogInfo( - "Try to use additional Remote Server: " . $additional_remote_config->{name} - ); - - $port = checkSSHPort($additional_remote_config->{ssh_port}); - $cmd = "$self->{ssh} -p $port " . $additional_remote_config->{'ns_ip_address'} - . " 'echo \"SENDCFGFILE:" . $id . "\" >> $self->{cmdDir}/" . time() . "-sendcmd'"; - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't forward SENDCFGFILE order on Remote Server: %s (%d)", - $remote_server->{name}, - $remote_server->{id} - )); - } else { - # Commands sent, stop loop - $self->{logger}->writeLogInfo( - "SENDCFGFILE order sent to Remote Server: " . $additional_remote_config->{name} - ); - last; - } - } - } - } - } -} - -################################################## -# Send export files to a Remote Server -# -sub sendExportFile($) { - my $self = shift; - # Init Values - my $id = $_[0]; - my $taskId = $_[1]; - if (!$id || !$taskId){ - return undef; - } - my ($lerror, $return_code, $stdout, $cmd); - - my $server_info = $self->getServerConfig($id); - my $port = checkSSHPort($server_info->{ssh_port}); - my $cfg_dir = $server_info->{'centreonbroker_cfg_path'}; - - if (!defined($cfg_dir) || $cfg_dir =~ //) { - $self->{logger}->writeLogError( - "Engine configuration file is empty for poller $id. Please check nagios.cfg file." - ); - return; - } - - unless (-e $self->{cacheDir} . "/config/export/" . $id) { - $self->{logger}->writeLogInfo( - "Export directory is empty for Remote Server " . $server_info->{name} . " " . - $self->{cacheDir} . "/config/export/$id." - ); - return; - } - - my $origin = $self->{cacheDir} . "/config/export/" . $id . "/*"; - my $dest = $server_info->{'ns_ip_address'} . ":" . $self->{cacheDir} . "/config/remote-data/"; - - # Send data with rSync - $self->{logger}->writeLogInfo('Export files on Remote Server "' . $server_info->{name} . '" (' . $id . ')'); - - $cmd = "$self->{rsync} -ra -e '$self->{ssh} -o port=$port' $origin $dest 2>&1"; - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't export files on Remote Server: %s (%d)", - $server_info->{name}, - $id - )); - } - if (defined($stdout) && $stdout){ - $self->{logger}->writeLogInfo("Result : $stdout"); - } - - $self->createRemote($taskId); -} - -################################################## -# Function for initialize Centreon Engine -# Parameters : -# - start -# - restart -# - stop -# -sub initEngine($$$) { - my $self = shift; - my $id = $_[0]; # poller id - my $options = $_[1]; # restart, reload, stop... - my $action = $_[2]; # full command - my ($lerror, $cmd, $return_code, $stdout); - - # Get configuration - my $conf = $self->getServerConfig($id); - my $port = checkSSHPort($conf->{ssh_port}); - - if (!defined($conf)) { - $self->{logger}->writeLogError("Poller $id doesn't exist..."); - $self->{logger}->writeLogError("Cannot manage undefined poller..."); - return; - } - - if (defined($conf->{ns_ip_address}) && $conf->{ns_ip_address}) { - # Launch command - if (defined($conf->{remote_id}) - && $conf->{remote_id} != 0 - && $self->{instance_mode} ne "remote" - && $conf->{remote_server_centcore_ssh_proxy} == 1 - ) { - my $remote_server = $self->getServerConfig($conf->{remote_id}); - $action =~ s/^\s+|\s+$//g; - $port = checkSSHPort($remote_server->{ssh_port}); - $cmd = "$self->{ssh} -p $port " . $remote_server->{ns_ip_address} . " 'echo \"$action\" >> $self->{cmdDir}" . time() . "-sendcmd'"; - - $self->{logger}->writeLogInfo(sprintf( - 'Send command %s to Centreon Engine on poller %s (%d) using remote server %s (%d)', - $action, - $conf->{name}, - $conf->{id}, - $remote_server->{name}, - $remote_server->{id} - )); - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 120, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't sent command %s to Centreon Engine on poller %s (%d) using remote server %s (%d)", - $action, - $conf->{name}, - $conf->{id}, - $remote_server->{name}, - $remote_server->{id} - )); - - # Try with additionnals Remote Server - if ($conf->{additonal_remotes}) { - foreach my $additional_remote_id ($conf->{additonal_remotes}) { - my $additional_remote_config = $self->getServerConfig($additional_remote_id->{remote_server_id}); - $self->{logger}->writeLogInfo( - "Try to use additional Remote Server: " . $additional_remote_config->{name} - ); - - $port = checkSSHPort($additional_remote_config->{ssh_port}); - $cmd = "$self->{ssh} -p $port " . $additional_remote_config->{ns_ip_address} - . " 'echo \"$action\" >> $self->{cmdDir}" . time() . "-sendcmd'"; - - $self->{logger}->writeLogInfo( - "Sending external command using Remote Server: " - . $additional_remote_config->{name} - ); - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => $self->{cmd_timeout}, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't sent command %s to Centreon Engine on poller %s (%d) using remote server %s (%d)", - $action, - $conf->{name}, - $conf->{id}, - $additional_remote_config->{name}, - $additional_remote_config->{id} - )); - } else { - # Commands sent, stop loop - $self->{logger}->writeLogInfo(sprintf( - "%s command to Centreon Engine on poller %s (%d) using Remote Server %s (%d) sent", - $action, - $conf->{name}, - $conf->{id}, - $additional_remote_config->{name}, - $additional_remote_config->{id} - )); - last; - } - } - } - } - } else { - $cmd = ''; - if ($conf->{localhost} == 0) { - $cmd = "$self->{ssh} -p $port $conf->{ns_ip_address} "; - } - $cmd .= $self->getEngineCommand($conf, $options); - $self->{logger}->writeLogInfo( - 'Init Script : "' . $cmd . '" ' . - 'on poller "' . $conf->{name} . '" (' . $id . ')' - ); - ($lerror, $stdout) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 120 - ); - if (defined($stdout)) { - foreach my $line (split(/\n/, $stdout)) { - $self->{logger}->writeLogDebug("Engine : " . $line); - } - } - } - } else { - $self->{logger}->writeLogError("Cannot $options Engine for poller $id"); - } -} - -################################################## -# Function to reload Centreon Broker -# Arguments: -# $id: int Poller id to reload -# -sub reloadBroker($) { - my $self = shift; - my $id = $_[0]; - my ($lerror, $stdout, $conf, $command); - - # Get configuration - $conf = $self->getServerConfig($id); - - if ($conf->{localhost} == 1) { - $command = "$self->{sudo} $conf->{broker_reload_command}"; - $self->{logger}->writeLogInfo( - 'Init Script : "' . $command . '" ' . - 'on poller "' . $conf->{name} . '" (' . $id . ')' - ); - - ($lerror, $stdout) = centreon::common::misc::backtick( - command => $command, - logger => $self->{logger}, - timeout => 10 - ); - - if (defined($stdout)) { - foreach my $line (split(/\n/, $stdout)) { - $self->{logger}->writeLogDebug("Broker : " . $line); - } - } - } -} - -################################################## -# Function to generate Centreon Engine command : -# Arguments: -# $pollerConf: array Poller configuration get in database (nagios_server table) -# $action: string Name of the action (restart, reload, stop...) -# -sub getEngineCommand($$) { - my $self = shift; - my $pollerConf = $_[0]; - my $action = $_[1]; - my $command; - - if ($action eq 'start') { - $command = "$self->{sudo} $pollerConf->{engine_start_command}"; - } elsif ($action eq 'stop') { - $command = "$self->{sudo} $pollerConf->{engine_stop_command}"; - } elsif ($action eq 'restart') { - $command = "$self->{sudo} $pollerConf->{engine_restart_command}"; - } elsif ($action eq 'reload') { - $command = "$self->{sudo} $pollerConf->{engine_reload_command}"; - } else { - $command = "$self->{sudo} $self->{service} $self->{engineInitScript} $action"; - } - - return $command; -} - -################################################## -# Function for synchronize SNMP trap configuration -# -sub syncTraps($) { - my $self = shift; - my $id = $_[0]; - my ($lerror, $stdout, $return_code, $cmd); - - my $query = "SELECT `id` FROM `nagios_server` WHERE `ns_activate` = '1' " ; - if ($id != 0) { - $query .= "AND id = '" . $id . "'"; - } else { - $query .= "AND `localhost` = '0'"; - } - $self->{logger}->writeLogDebug($query); - my ($status, $sth) = $self->{centreon_dbc}->query($query); - - return if ($status == -1); - while (my $server = $sth->fetchrow_hashref()) { - # Get configuration - my $ns_server = $self->getServerConfig($server->{id}); - my $port = checkSSHPort($ns_server->{ssh_port}); - my $remote_server; - - if (defined($ns_server->{remote_id}) - && $ns_server->{remote_id} != 0 - && $self->{instance_mode} ne "remote" - && $ns_server->{remote_server_centcore_ssh_proxy} == 1 - ) { - # - # Send SNMP trap configuration database - # - $remote_server = $self->getServerConfig($ns_server->{remote_id}); - $port = checkSSHPort($remote_server->{ssh_port}); - $cmd = "$self->{scp} -r -P $port /etc/snmp/centreon_traps/$id " - . "$remote_server->{'ns_ip_address'}:/etc/snmp/centreon_traps/"; - - $self->{logger}->writeLogDebug($cmd); - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send SNMP trap configuration for poller %d on Remote Server: %s (%d)", - $id, - $remote_server->{name}, - $remote_server->{id} - )); - } - - # Try with additionnals Remote Server - if ($ns_server->{additonal_remotes}) { - foreach my $additional_remote_id ($ns_server->{additonal_remotes}) { - my $additional_remote_config = $self->getServerConfig($additional_remote_id->{remote_server_id}); - $self->{logger}->writeLogInfo( - "Try to use additional Remote Server: " . $additional_remote_config->{name} - ); - - $port = checkSSHPort($additional_remote_config->{ssh_port}); - $cmd = "$self->{scp} -r -P $port /etc/snmp/centreon_traps/$id " - . "$additional_remote_config->{'ns_ip_address'}:/etc/snmp/centreon_traps/"; - - $self->{logger}->writeLogDebug($cmd); - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send SNMP trap configuration for poller %d on Remote Server: %s (%d)", - $id, - $additional_remote_config->{name}, - $additional_remote_config->{id} - )); - } else { - # Commands sent, stop loop - $self->{logger}->writeLogInfo(sprintf( - "SNMP trap configuration for poller %d using Remote Server: %s sent", - $id, - $additional_remote_config->{name} - )); - last; - } - } - } - - # - # Send synchronization order to Remote Server - # - $port = checkSSHPort($remote_server->{ssh_port}); - $cmd = "$self->{ssh} -p $port " . $remote_server->{'ns_ip_address'} - . " 'echo \"SYNCTRAP:" . $id . "\" >> $self->{cmdDir}/" . time() . "-sendcmd'"; - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send SNMP trap synchronization order to Remote Server: %s (%d)", - $remote_server->{name}, - $remote_server->{id} - )); - } - - # Try with additionnals Remote Server - if ($ns_server->{additonal_remotes}) { - foreach my $additional_remote_id ($ns_server->{additonal_remotes}) { - my $additional_remote_config = $self->getServerConfig($additional_remote_id->{remote_server_id}); - $self->{logger}->writeLogInfo( - "Try to use additional Remote Server: " . $additional_remote_config->{name} - ); - - $port = checkSSHPort($additional_remote_config->{ssh_port}); - $cmd = "$self->{ssh} -p $port " . $additional_remote_config->{'ns_ip_address'} - . " 'echo \"SYNCTRAP:" . $id . "\" >> $self->{cmdDir}/" . time() . "-sendcmd'"; - - $self->{logger}->writeLogDebug($cmd); - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't send SNMP trap synchronization order to Remote Server: %s (%d)", - $id, - $additional_remote_config->{name}, - $additional_remote_config->{id} - )); - } else { - # Commands sent, stop loop - $self->{logger}->writeLogInfo(sprintf( - "SNMP trap synchronization order for Remote Server: %s sent", - $additional_remote_config->{name} - )); - last; - } - } - } - } else { - $cmd = "$self->{scp} -P $port /etc/snmp/centreon_traps/$id/centreontrapd.sdb " - . "$ns_server->{ns_ip_address}:$ns_server->{snmp_trapd_path_conf} 2>&1"; - - $self->{logger}->writeLogDebug($cmd); - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 300 - ); - if (defined($stdout) && $stdout){ - $self->{logger}->writeLogInfo("Result : $stdout"); - } - } - } -} - -################################## -## Get Monitoring Engine. -# -sub getInfos($) { - my $self = shift; - my $id = $_[0]; - my ($lerror, $stdout, $cmd); - - # Get configuration - my $ns_server = $self->getServerConfig($id); - my $port = checkSSHPort($ns_server->{ssh_port}); - - if (defined($ns_server->{ns_ip_address}) && $ns_server->{ns_ip_address}) { - # Launch command - if (defined($ns_server->{localhost}) && $ns_server->{localhost}) { - $cmd = $ns_server->{nagios_bin} . ' -V'; - $self->{logger}->writeLogDebug($cmd); - ($lerror, $stdout) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 60 - ); - } else { - $cmd = "$self->{ssh} -p $port " . $ns_server->{ns_ip_address} . " '$ns_server->{nagios_bin} -V"; - $self->{logger}->writeLogDebug($cmd); - ($lerror, $stdout) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 60 - ); - } - - if ($stdout =~ /Centreon Engine ([\.0-9]*[a-zA-Z0-9\-\.]+)/ms) { - $self->{logger}->writeLogInfo("Engine: Centreon Engine"); - $self->{logger}->writeLogInfo("Version: $1"); - $self->updateEngineInformation($id, "Centreon Engine", $1); - } - } else { - $self->{logger}->writeLogError("Cannot get informations for poller $id"); - } -} - -############################### -## Update Engine informations -# -sub updateEngineInformation($$$) { - my $self = shift; - my $id = $_[0]; - my $engine_name = $_[1]; - my $engine_version = $_[2]; - - $self->{centreon_dbc}->query( - "UPDATE `nagios_server` " . - "SET `engine_name` = '$engine_name', `engine_version` = '$engine_version' " . - "WHERE `id` = '$id'" - ); -} - -################################ -## Reload CentreonTrapd Daemon -# -sub initCentreonTrapd { - my ($self, $id, $start_type, $action) = @_; - my ($lerror, $stdout, $return_code, $cmd); - - # Get configuration - my $ns_server = $self->getServerConfig($id); - my $port = checkSSHPort($ns_server->{ssh_port}); - - if (defined($ns_server->{ns_ip_address}) - && defined($ns_server->{init_script_centreontrapd}) - && $ns_server->{init_script_centreontrapd} ne "" - ) { - if (defined($ns_server->{localhost}) && $ns_server->{localhost}) { - # Reload/Restart Centreontrapd locally - $cmd = "$self->{sudo} $self->{service} " . $ns_server->{init_script_centreontrapd} . " " . $start_type; - $self->{logger}->writeLogDebug($cmd); - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 120 - ); - } else { - if (defined($ns_server->{remote_id}) - && $ns_server->{remote_id} != 0 - && $self->{instance_mode} ne "remote" - && $ns_server->{remote_server_centcore_ssh_proxy} == 1 - ) { - # Reload/Restart Centreontrapd on poller using Remote Server as proxy - my $remote_server = $self->getServerConfig($ns_server->{remote_id}); - $action =~ s/^\s+|\s+$//g; - $port = checkSSHPort($remote_server->{ssh_port}); - $cmd = "$self->{ssh} -p $port " . $remote_server->{ns_ip_address} . " 'echo \"$action\" >> $self->{cmdDir}" . time() . "-sendcmd'"; - $self->{logger}->writeLogDebug(sprintf( - "Try to %s Centreontrapd on poller %s (%d) using Remote Server: %s", - $start_type, - $ns_server->{name}, - $ns_server->{id}, - $remote_server->{name} - )); - $self->{logger}->writeLogDebug($cmd); - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 60, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't %s Centreontrapd on Remote Server: %s (%d)", - $start_type, - $remote_server->{name}, - $remote_server->{id} - )); - - # Try with additionnals Remote Server - if ($ns_server->{additonal_remotes}) { - foreach my $additional_remote_id ($ns_server->{additonal_remotes}) { - my $additional_remote_config = $self->getServerConfig($additional_remote_id->{remote_server_id}); - $self->{logger}->writeLogDebug(sprintf( - "Try to %s Centreontrapd on poller %s (%d) using Remote Server: %s", - $start_type, - $ns_server->{name}, - $ns_server->{id}, - $additional_remote_config->{name} - )); - $port = checkSSHPort($additional_remote_config->{ssh_port}); - $cmd = "$self->{ssh} -p $port " . $additional_remote_config->{ns_ip_address} . " 'echo \"$action\" >> $self->{cmdDir}" . time() . "-sendcmd'"; - $self->{logger}->writeLogInfo(sprintf( - "Try to %s Centreontrapd on poller %s (%d) using Remote Server: %s", - $start_type, - $ns_server->{name}, - $ns_server->{id}, - $additional_remote_config->{name} - )); - - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => $self->{cmd_timeout}, - wait_exit => 1 - ); - - if ($lerror != 0 || (defined($return_code) && $return_code != 0)) { - $self->{logger}->writeLogError(sprintf( - "Couldn't %s Centreontrapd on Remote Server: %s (%d)", - $start_type, - $additional_remote_config->{name}, - $additional_remote_config->{id} - )); - } else { - # Commands sent, stop loop - $self->{logger}->writeLogInfo( - "External command using Remote Server: " . $additional_remote_config->{name} . " sent" - ); - last; - } - } - } - } - } else { - # Reload/Restart Centreontrapd on Poller/Remote Server using ssh - $cmd = "$self->{ssh} -p $port " . $ns_server->{ns_ip_address} . " $self->{sudo} $self->{service} " - . $ns_server->{init_script_centreontrapd} . " " . $start_type; - $self->{logger}->writeLogDebug($cmd); - ($lerror, $stdout, $return_code) = centreon::common::misc::backtick( - command => $cmd, - logger => $self->{logger}, - timeout => 60 - ); - } - } - $self->{logger}->writeLogInfo($start_type . " CentreonTrapd on poller $id ($ns_server->{ns_ip_address})"); - } else { - $self->{logger}->writeLogError("Cannot " . $start_type . " CentreonTrapd for poller $id"); - } -} - -#################################### -## Parse request -# -sub parseRequest($) { - my $self = shift; - my ($action) = @_; - - if (!$action) { - return ; - } - - # Checks keys for launching commands - if ($action =~ /^RESTART\:([0-9]*)/){ - $self->initEngine($1, "restart", $action); - } elsif ($action =~ /^RELOAD\:([0-9]*)/){ - $self->initEngine($1, "reload", $action); - } elsif ($action =~ /^START\:([0-9]*)/){ - $self->initEngine($1, "start", $action); - } elsif ($action =~ /^STOP\:([0-9]*)/){ - $self->initEngine($1, "stop", $action); - } elsif ($action =~ /^RELOADBROKER\:([0-9]*)/){ - $self->reloadBroker($1); - } elsif ($action =~ /^SENDCFGFILE\:([0-9]*)/){ - $self->sendConfigFile($1); - } elsif ($action =~ /^SENDEXPORTFILE\:([0-9]*)\:(.*)/){ - $self->sendExportFile($1, $2); - } elsif ($action =~ /^SYNCTRAP\:([0-9]*)/){ - $self->syncTraps($1); - } elsif ($action =~ /^RESTARTCENTREONTRAPD\:([0-9]*)/){ - $self->initCentreonTrapd($1, 'restart', $action); - } elsif ($action =~ /^RELOADCENTREONTRAPD\:([0-9]*)/){ - $self->initCentreonTrapd($1, 'reload', $action); - } elsif ($action =~ /^EXTERNALCMD\:([0-9]*)\:(.*)/){ - $self->storeCommands($1, $2); - } elsif ($action =~ /^GETINFOS\:([0-9]*)/){ - $self->getInfos($1); - } elsif ($action =~ /^STARTWORKER\:([0-9]*)/){ - $self->startWorker($1); - } elsif ($action =~ /^CREATEREMOTETASK\:([0-9]*)/){ - $self->createRemote($1); - } -} - -############################################ -## Check Centcore Configuration Profile -# -sub checkProfile() { - my $self = shift; - - my $request = "SELECT * FROM options " - . "WHERE `key` IN ('enable_perfdata_sync', 'enable_logs_sync', " - . "'centcore_cmd_timeout', 'enable_broker_stats', 'centcore_illegal_characters')"; - my ($status, $sth) = $self->{centreon_dbc}->query($request); - return -1 if ($status == -1); - while ((my $data = $sth->fetchrow_hashref())) { - if (defined($data->{key}) && $data->{key} ne "" && defined($data->{value}) && $data->{value} ne "") { - if ($data->{key} eq "enable_perfdata_sync") { - $self->{perfdataSync} = $data->{value}; - } - if ($data->{key} eq "enable_logs_sync") { - $self->{logSync} = $data->{value}; - } - if ($data->{key} eq "centcore_cmd_timeout") { - $self->{cmd_timeout} = $data->{value}; - } - if ($data->{key} eq "enable_broker_stats") { - $self->{enable_broker_stats} = $data->{value}; - } - if ($data->{key} eq "centcore_illegal_characters") { - $self->{illegal_characters} = $data->{value}; - } - } - } - return 0; -} - -# Check if debug has been enable into GUI -sub checkDebugFlag { - my $self = shift; - - my $request = "SELECT value FROM options WHERE `key` IN ('debug_centcore')"; - my ($status, $sth) = $self->{centreon_dbc}->query($request); - return -1 if ($status == -1); - my $data = $sth->fetchrow_hashref(); - if (defined($data->{value}) && $data->{value} == 1) { - if (!$self->{logger}->is_debug()) { - $self->{logger}->severity("debug"); - $self->{logger}->writeLogInfo("Enable Debug in Centcore"); - } - } else { - if ($self->{logger}->is_debug()) { - $self->{logger}->set_default_severity(); - $self->{logger}->writeLogInfo("Disable Debug in Centcore. Set default severity"); - } - } - return 0; -} - -# Store commands in order to group commands to send. -sub storeCommands($$) { - my $self = shift; - my ($poller_id, $command) = @_; - - if (!defined($self->{commandBuffer}{$poller_id})) { - $self->{commandBuffer}{$poller_id} = ""; - } - $self->{commandBuffer}{$poller_id} .= $command . "\n"; -} - -sub run { - my $self = shift; - - $self->SUPER::run(); - $self->{logger}->redirect_output(); - $self->{logger}->writeLogInfo("Starting centcore engine..."); - - $self->{centreon_dbc} = centreon::common::db->new( - db => $self->{centreon_config}->{centreon_db}, - host => $self->{centreon_config}->{db_host}, - port => $self->{centreon_config}->{db_port}, - user => $self->{centreon_config}->{db_user}, - password => $self->{centreon_config}->{db_passwd}, - force => 0, - logger => $self->{logger} - ); - $self->checkDebugFlag(); - $self->{logger}->writeLogInfo("Instance type: " . $self->{instance_mode}); - while ($self->{stop}) { - if ($self->{reload} == 0) { - $self->{logger}->writeLogInfo("Reload in progress..."); - $self->reload(); - $self->{reload} = 1; - } - # Read Centcore.cmd - if (-e $self->{cmdFile}) { - if ($self->moveCmdFile($self->{cmdFile}) && open(FILE, "< $self->{cmdFile}"."_read")) { - while (){ - $self->parseRequest($_); - } - foreach my $poller (keys(%{$self->{commandBuffer}})) { - if (length($self->{commandBuffer}{$poller}) != 0) { - $self->sendExternalCommand($poller, $self->{commandBuffer}{$poller}); - $self->{commandBuffer}{$poller} = ""; - } - } - close(FILE); - $self->{logger}->writeLogError("Error When removing ".$self->{cmdFile}."_read file : $!") if (!unlink($self->{cmdFile}."_read")); - } - } - - # Read Centcore Directory - if (-d $self->{cmdDir}) { - opendir(my $dh, $self->{cmdDir}); - while (my $file = readdir($dh)) { - if ($file ne "." && $file ne ".." && $file ne "" && $file !~ /.*_read$/ && $file !~ /^\..*/) { - if ($self->moveCmdFile($self->{cmdDir} . $file) && open(FILE, "< ". $self->{cmdDir} . $file . "_read")) { - while (){ - $self->parseRequest($_); - } - foreach my $poller (keys(%{$self->{commandBuffer}})) { - if (length($self->{commandBuffer}{$poller}) != 0) { - $self->sendExternalCommand($poller, $self->{commandBuffer}{$poller}); - $self->{commandBuffer}{$poller} = ""; - } - } - close(FILE); - $self->{logger}->writeLogError("Error When removing ".$self->{cmdDir}.$file."_read file : $!") if (!unlink($self->{cmdDir}.$file."_read")); - } - } - } - closedir $dh; - } - - if (defined($self->{timeSyncPerf}) && $self->{timeSyncPerf}) { - $self->{difTime} = time() - $self->{timeSyncPerf}; - } - - # Get PerfData on Engine Poller - if ((defined($self->{difTime}) && $self->{timeBetween2SyncPerf} <= $self->{difTime}) || $self->{timeSyncPerf} == 0){ - # Check Activity profile Status - $self->checkProfile(); - - # Check debug Flag - $self->checkDebugFlag(); - - $self->getAllBrokerStats(); - - $self->{timeSyncPerf} = time(); - } - - sleep(1); - } - - $self->{logger}->writeLogInfo("Centcore stop..."); -} - -1; - -__END__ diff --git a/libinstall/CentCore.sh b/libinstall/CentCore.sh deleted file mode 100755 index b7f006d5afd..00000000000 --- a/libinstall/CentCore.sh +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/env bash -#---- -## @Synopsis Install script for CentCore -## @Copyright Copyright 2008, Guillaume Watteeux -## @Copyright Copyright 2008-2020, Centreon -## @license GPL : http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt -## Install script for CentCore -#---- -## Centreon is developed with GPL Licence 2.0 -## -## GPL License: http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt -## -## Developed by : Julien Mathis - Romain Le Merlus -## Contributors : Guillaume Watteeux - Maximilien Bersoult -## -## This program is free software; you can redistribute it and/or -## modify it under the terms of the GNU General Public License -## as published by the Free Software Foundation; either version 2 -## of the License, or (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## For information : infos@centreon.com - -echo -e "\n$line" -echo -e "\t$(gettext "Starting CentCore Installation")" -echo -e "$line" - -###### Check disk space -check_tmp_disk_space -if [ "$?" -eq 1 ] ; then - if [ "$silent_install" -eq 1 ] ; then - purge_centreon_tmp_dir "silent" - else - purge_centreon_tmp_dir - fi -fi - -###### Require -################################# -## Where is install_dir_centreon ? -locate_centreon_installdir -locate_centreon_etcdir -locate_centreon_rundir -locate_centreon_logdir -locate_centreon_varlib -locate_centreon_generationdir -locate_centcore_bindir -locate_init_d - -## Config Nagios -check_centreon_group -check_centreon_user - -## Populate temporaty source directory -copyInTempFile 2>>$LOG_FILE - -## Create temporary folder -log "INFO" "$(gettext "Create working directory")" -mkdir -p $TMP_DIR/{work,final}/bin -[ ! -d $INSTALL_DIR_CENTREON/examples ] && mkdir -p $INSTALL_DIR_CENTREON/examples -# Copy init.d template in src -DISTRIB="" -find_OS "DISTRIB" -if [ "$DISTRIB" = "DEBIAN" ]; then - cp -f $BASE_DIR/tmpl/install/debian/centcore.init.d $TMP_DIR/src - cp -f $BASE_DIR/tmpl/install/debian/centcore.default $TMP_DIR/src -elif [ "$DISTRIB" = "SUSE" ]; then - cp -f $BASE_DIR/tmpl/install/suse/centcore.init.d $TMP_DIR/src - cp -f $BASE_DIR/tmpl/install/suse/centcore.sysconfig $TMP_DIR/src -else - cp -f $BASE_DIR/tmpl/install/redhat/centcore.init.d $TMP_DIR/src - cp -f $BASE_DIR/tmpl/install/redhat/centcore.sysconfig $TMP_DIR/src -fi - -###### CentCore binary -################################# -## Change macros for CentCore binary - -log "INFO" "$(gettext "Copying CentCore in binary directory")" -$INSTALL_DIR/cinstall $cinstall_opts \ - -u "$CENTREON_USER" -g "$CENTREON_GROUP" -m 755 \ - $TMP_DIR/src/bin/centcore $CENTCORE_BINDIR/centcore >> $LOG_FILE 2>&1 -check_result $? "$(gettext "Copy CentCore in binary directory")" - -## Change right on CENTREON_RUNDIR -log "INFO" "$(gettext "Change right") : $CENTREON_RUNDIR" -$INSTALL_DIR/cinstall $cinstall_opts -u "$CENTREON_USER" -d 750 \ - $CENTREON_RUNDIR >> $LOG_FILE 2>&1 -check_result $? "$(gettext "Change right") : $CENTREON_RUNDIR" - -## Change tight on CENTREON_VARLIB -log "INFO" "$(gettext "Change right") : $CENTREON_VARLIB" -$INSTALL_DIR/cinstall $cinstall_opts -g "$CENTREON_USER" -d 775 \ - $CENTREON_VARLIB >> $LOG_FILE 2>&1 -check_result $? "$(gettext "Change right") : $CENTREON_VARLIB" - -## Add logrotate -log "INFO" "$(gettext "Change macros for centcore.logrotate")" -${SED} -e 's|@CENTREON_LOG@|'"$CENTREON_LOG"'|g' \ - $TMP_DIR/src/logrotate/centcore > $TMP_DIR/work/centcore.logrotate -check_result $? "$(gettext "Change macros for centcore.logrotate")" -cp $TMP_DIR/work/centcore.logrotate $TMP_DIR/final/centcore.logrotate >> "$LOG_FILE" 2>&1 - -log "INFO" "$(gettext "Install centcore.logrotate")" -$INSTALL_DIR/cinstall $cinstall_opts \ - -m 644 \ - $TMP_DIR/final/centcore.logrotate $LOGROTATE_D/centcore >> "$LOG_FILE" 2>&1 -check_result $? "$(gettext "Install Centreon Core logrotate.d file")" - -###### CentCore init -################################# -## Change macros in CentCore init script -${SED} -e 's|@CENTREON_DIR@|'"$INSTALL_DIR_CENTREON"'|g' \ - -e 's|@CENTREON_LOG@|'"$CENTREON_LOG"'|g' \ - -e 's|@CENTREON_ETC@|'"$CENTREON_ETC"'|g' \ - -e 's|@CENTREON_RUNDIR@|'"$CENTREON_RUNDIR"'|g' \ - -e 's|@CENTCORE_BINDIR@|'"$CENTCORE_BINDIR"'|g' \ - -e 's|@CENTREON_USER@|'"$CENTREON_USER"'|g' \ - $TMP_DIR/src/centcore.init.d > $TMP_DIR/work/centcore.init.d -check_result $? "$(gettext "Replace CentCore init script Macro")" - -if [ "$DISTRIB" = "DEBIAN" ]; then - ${SED} -e 's|"NO"|"YES"|g' -e "s|@CENTREON_LOG@|$CENTREON_LOG|g" -e "s|@CENTREON_ETC@|$CENTREON_ETC|g" -e "s|@CENTREON_USER@|$CENTREON_USER|g" $TMP_DIR/src/centcore.default > $TMP_DIR/work/centcore.default - check_result $? "$(gettext "Replace CentCore default script Macro")" - cp $TMP_DIR/work/centcore.default $TMP_DIR/final/centcore.default - cp $TMP_DIR/final/centcore.default $INSTALL_DIR_CENTREON/examples/centcore.default -elif [ "$DISTRIB" = "REDHAT" -o "$DISTRIB" = "SUSE" ]; then - ${SED} -e "s|@CENTREON_USER@|$CENTREON_USER|g" \ - -e 's|@CENTREON_ETC@|'"$CENTREON_ETC"'|g' \ - -e 's|@CENTREON_LOG@|'"$CENTREON_LOG"'|g' \ - $TMP_DIR/src/centcore.sysconfig > $TMP_DIR/work/centcore.sysconfig - check_result $? "$(gettext "Replace CentCore sysconfig script Macro")" - cp $TMP_DIR/work/centcore.sysconfig $TMP_DIR/final/centcore.sysconfig - cp $TMP_DIR/final/centcore.sysconfig $INSTALL_DIR_CENTREON/examples/centcore.sysconfig -fi - -cp $TMP_DIR/work/centcore.init.d $TMP_DIR/final/centcore.init.d -cp $TMP_DIR/final/centcore.init.d $INSTALL_DIR_CENTREON/examples/centcore.init.d - -RC="1" -if [ ! "${CENTCORE_INSTALL_INIT}" ] ; then - yes_no_default "$(gettext "Do you want me to install CentCore init script ?")" - RC="$?" -elif [ "${CENTCORE_INSTALL_INIT}" -eq 1 ] ; then - RC="0" -fi -if [ "$RC" -eq "0" ] ; then - log "INFO" "$(gettext "CentCore init script installed")" - $INSTALL_DIR/cinstall $cinstall_opts -m 755 \ - $TMP_DIR/final/centcore.init.d \ - $INIT_D/centcore >> $LOG_FILE 2>&1 - check_result $? "$(gettext "CentCore init script installed")" - log "INFO" "$(gettext "CentCore init script installed")" - RC="1" - if [ "$DISTRIB" = "DEBIAN" ]; then - log "INFO" "$(gettext "CentCore default script installed")" - $INSTALL_DIR/cinstall $cinstall_opts -m 644 \ - $TMP_DIR/final/centcore.default \ - /etc/default/centcore >> $LOG_FILE 2>&1 - check_result $? "$(gettext "CentCore default script installed")" - log "INFO" "$(gettext "CentCore default script installed")" - elif [ "$DISTRIB" = "REDHAT" -o "$DISTRIB" = "SUSE" ]; then - log "INFO" "$(gettext "CentCore sysconfig script installed")" - $INSTALL_DIR/cinstall $cinstall_opts -m 644 \ - $TMP_DIR/final/centcore.sysconfig \ - /etc/sysconfig/centcore >> $LOG_FILE 2>&1 - check_result $? "$(gettext "CentCore sysconfig script installed")" - log "INFO" "$(gettext "CentCore sysconfig script installed")" - fi - if [ ! "${CENTCORE_INSTALL_RUNLVL}" ] ; then - yes_no_default "$(gettext "Do you want me to install CentCore run level ?")" - RC="$?" - elif [ "${CENTCORE_INSTALL_RUNLVL}" -eq 1 ] ; then - RC="0" - fi - if [ "$RC" -eq "0" ] ; then - install_init_service "centcore" | tee -a $LOG_FILE - #check_result $? "$(gettext "CentCore run level installed")" - log "INFO" "$(gettext "CentCore run level installed")" - else - echo_passed "$(gettext "CentCore run level not installed")" "$passed" - log "INFO" "$(gettext "CentCore run level not installed")" - fi - - # Install centcore perl lib - $INSTALL_DIR/cinstall $cinstall_opts -m 755 \ - $TMP_DIR/src/lib/perl/centreon/common/ \ - $PERL_LIB_DIR/centreon/common/ >> $LOG_FILE 2>&1 - $INSTALL_DIR/cinstall $cinstall_opts -m 755 \ - $TMP_DIR/src/lib/perl/centreon/script.pm \ - $PERL_LIB_DIR/centreon/script.pm >> $LOG_FILE 2>&1 - $INSTALL_DIR/cinstall $cinstall_opts -m 755 \ - $TMP_DIR/src/lib/perl/centreon/script/centcore.pm \ - $PERL_LIB_DIR/centreon/script/centcore.pm >> $LOG_FILE 2>&1 - $INSTALL_DIR/cinstall $cinstall_opts -m 755 \ - $TMP_DIR/src/lib/perl/centreon/script/centreonSyncArchives.pm \ - $PERL_LIB_DIR/centreon/script/centreonSyncArchives.pm >> $LOG_FILE 2>&1 - $INSTALL_DIR/cinstall $cinstall_opts -m 755 \ - $TMP_DIR/src/lib/perl/centreon/script/centreonSyncPlugins.pm \ - $PERL_LIB_DIR/centreon/script/centreonSyncPlugins.pm >> $LOG_FILE 2>&1 - echo_success "$(gettext "CentCore Perl lib installed")" "$ok" - log "INFO" "$(gettext "CentCore Perl lib installed")" -else - echo_passed "$(gettext "CentCore init script not installed, please use "):\n $INSTALL_DIR_CENTREON/examples/centcore.init.d" "$passed" - log "INFO" "$(gettext "CentCore init script not installed, please use "): $INSTALL_DIR_CENTREON/examples/centcore.init.d" -fi - -###### Post Install -################################# -createCentCoreInstallConf - -## wait and see... -## sql console inject ? - diff --git a/libinstall/CentWeb.sh b/libinstall/CentWeb.sh index 2fbb9837a2d..c48d4b74000 100755 --- a/libinstall/CentWeb.sh +++ b/libinstall/CentWeb.sh @@ -29,6 +29,16 @@ # debug ? #set -x +echo -e "\n$line" +echo -e "\t$(gettext "Gorgone module Installation")" +echo -e "$line" + +# locate gorgone +locate_gorgone_varlib +locate_gorgone_config +check_gorgone_user +check_gorgone_group + echo -e "\n$line" echo -e "\t$(gettext "Start CentWeb Installation")" echo -e "$line" @@ -43,8 +53,7 @@ if [ "$?" -eq 1 ] ; then fi fi -###### Require -################################# +###### Mandatory step ## Create install_dir_centreon locate_centreon_installdir # Create an examples directory to save all important templates and config @@ -70,15 +79,41 @@ locate_perl ## Check PHP version check_php_version -[ "$?" -eq 1 ] && purge_centreon_tmp_dir && exit 1 +if [ "$?" -eq 1 ] ; then + echo_info "\n\t$(gettext "Your php version does not meet the requirements")" + + echo -e "\t$(gettext "Please read the documentation available here") : documentation.centreon.com" + echo -e "\n\t$(gettext "Installation aborted")" + + purge_centreon_tmp_dir + exit 1 +fi ## Check composer dependencies (if vendor directory exists) check_composer_dependencies -[ "$?" -eq 1 ] && purge_centreon_tmp_dir && exit 1 +if [ "$?" -eq 1 ] ; then + echo_info "\n\t$(gettext "You must first install the composer's dependencies")" + + echo -e "\n\t$(gettext "composer install --no-dev --optimize-autoloader")" + echo -e "\t$(gettext "Please read the documentation available here") : documentation.centreon.com" + + echo -e "\n\t$(gettext "Installation aborted")" + purge_centreon_tmp_dir + exit 1 +fi ## Check frontend application (if www/static directory exists) check_frontend_application -[ "$?" -eq 1 ] && purge_centreon_tmp_dir && exit 1 +if [ "$?" -eq 1 ] ; then + echo_info "\n\t$(gettext "You must first build the frontend application")" + + echo -e "\n\t$(gettext "Using npm install and then npm build")" + echo -e "\t$(gettext "Please read the documentation available here") : documentation.centreon.com" + + echo -e "\n\t$(gettext "Installation aborted")" + purge_centreon_tmp_dir + exit 1 +fi ## Config apache check_httpd_directory @@ -208,8 +243,6 @@ cp -Rf $TMP_DIR/src/libinstall/{functions,cinstall,gettext} \ $TMP_DIR/final/libinstall/ >> "$LOG_FILE" 2>&1 ## Prepare insertBaseConf.sql -#echo -e "$(gettext "In process")" -### Step 1: ## Change Macro on sql file log "INFO" "$(gettext "Change macros for insertBaseConf.sql")" ${SED} -e 's|@INSTALL_DIR_CENTREON@|'"$INSTALL_DIR_CENTREON"'|g' \ @@ -360,6 +393,15 @@ else add_group "$MONITORINGENGINE_USER" "$BROKER_GROUP" add_group "$BROKER_USER" "$CENTREON_GROUP" fi + +## Configure Gorgone user and group +add_group "$CENTREON_USER" "$GORGONE_GROUP" +add_group "$WEB_USER" "$GORGONE_GROUP" +add_group "$GORGONE_USER" "$CENTREON_GROUP" +add_group "$GORGONE_USER" "$BROKER_GROUP" +add_group "$GORGONE_USER" "$MONITORINGENGINE_GROUP" +add_group "$GORGONE_USER" "$WEB_GROUP" + if [ "$MONITORINGENGINE_ETC" != "$BROKER_ETC" ]; then $INSTALL_DIR/cinstall $cinstall_opts \ -g "$BROKER_GROUP" -d 775 \ @@ -699,7 +741,7 @@ $INSTALL_DIR/cinstall $cinstall_opts -m 755 \ ## Prepare to install all pear modules needed. # use check_pear.php script echo -e "\n$line" -echo -e "$(gettext "Pear Modules")" +echo -e "\t$(gettext "Pear Modules")" echo -e "$line" pear_module="0" first=1 @@ -710,7 +752,7 @@ while [ "$pear_module" -eq 0 ] ; do if [ "$first" -eq 0 ] ; then echo_info "$(gettext "Unable to upgrade PEAR modules. You seem to have a connection problem.")" fi - yes_no_default "$(gettext "Do you want me to install/upgrade your PEAR modules")" "$yes" + yes_no_default "$(gettext "Do you want to install/upgrade your PEAR modules")" "$yes" [ "$?" -eq 0 ] && PEAR_AUTOINST=1 fi if [ "${PEAR_AUTOINST:-0}" -eq 1 ] ; then @@ -727,6 +769,23 @@ while [ "$pear_module" -eq 0 ] ; do fi done +#---- +## Gorgone specific tasks +#---- +echo "$line" +echo -e "\t$(gettext "Achieve gorgone's module integration")" +echo "$line" +## Copy pollers SSH keys (in case of upgrade) to the new "user" gorgone +if [ "$upgrade" = "1" ]; then + + copy_ssh_keys_to_gorgone +fi +## Create gorgone's configuration structure +create_gorgone_configuration_structure + +echo "$line" +echo -e "\t$(gettext "Create configuration and installation files")" +echo "$line" ## Create configfile for web install createConfFile diff --git a/libinstall/functions b/libinstall/functions index d7e65fab8ae..60fa8de2361 100755 --- a/libinstall/functions +++ b/libinstall/functions @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #---- ## @Synopsis This file contains functions to be used by Centreon install scripts ## @Copyright Copyright 2008, Guillaume Watteeux @@ -134,11 +134,11 @@ echo_warning() { ## @Globals LOG_FILE #---- log() { - local program="$0" - local type="$1" - shift - local message="$@" - echo -e "[$program]:$type: $message" >> $LOG_FILE + local program="$0" + local type="$1" + shift + local message="$@" + echo -e "[$program]:$type: $message" >> $LOG_FILE } @@ -151,16 +151,16 @@ log() { ## @Globals PATH #---- pathfind() { - OLDIFS="$IFS" - IFS=: - for p in $PATH; do - if [ -x "$p/$*" ]; then - IFS="$OLDIFS" - return 0 - fi - done - IFS="$OLDIFS" - return 1 + OLDIFS="$IFS" + IFS=: + for p in $PATH; do + if [ -x "$p/$*" ]; then + IFS="$OLDIFS" + return 0 + fi + done + IFS="$OLDIFS" + return 1 } #---- @@ -172,19 +172,19 @@ pathfind() { ## @Globals PATH #---- pathfind_ret() { - local bin=$1 - local var_ref=$2 - local OLDIFS="$IFS" - IFS=: - for p in $PATH; do - if [ -x "$p/$bin" ]; then - IFS="$OLDIFS" - eval $var_ref=$p - return 0 - fi - done - IFS="$OLDIFS" - return 1 + local bin=$1 + local var_ref=$2 + local OLDIFS="$IFS" + IFS=: + for p in $PATH; do + if [ -x "$p/$bin" ]; then + IFS="$OLDIFS" + eval $var_ref=$p + return 0 + fi + done + IFS="$OLDIFS" + return 1 } #---- @@ -195,22 +195,22 @@ pathfind_ret() { ## @Globals GREP, CAT, SED, CHMOD, CHOWN #---- define_specific_binary_vars() { - local vars_bin="GREP CAT SED CHMOD CHOWN" - local var_bin_tolower="" - for var_bin in $vars_bin ; do - if [ -z $(eval echo \$$var_bin) ] ; then - var_bin_tolower="$(echo $var_bin | tr [:upper:] [:lower:])" - pathfind_ret "$var_bin_tolower" "$(echo -n $var_bin)" - if [ "$?" -eq 0 ] ; then - eval "$var_bin='$(eval echo \$$var_bin)/$var_bin_tolower'" - export $(echo $var_bin) - log "INFO" "$var_bin=$(eval echo \$$var_bin)" - else - return 1 - fi - fi - done - return 0 + local vars_bin="GREP CAT SED CHMOD CHOWN" + local var_bin_tolower="" + for var_bin in $vars_bin ; do + if [ -z $(eval echo \$$var_bin) ] ; then + var_bin_tolower="$(echo $var_bin | tr [:upper:] [:lower:])" + pathfind_ret "$var_bin_tolower" "$(echo -n $var_bin)" + if [ "$?" -eq 0 ] ; then + eval "$var_bin='$(eval echo \$$var_bin)/$var_bin_tolower'" + export $(echo $var_bin) + log "INFO" "$var_bin=$(eval echo \$$var_bin)" + else + return 1 + fi + fi + done + return 0 } #---- @@ -222,42 +222,42 @@ define_specific_binary_vars() { ## @return 1 no #---- yes_no_default() { - local message=$1 - local default=${2:-$no} - local res="not_define" - while [ "$res" != "$yes" ] && [ "$res" != "$no" ] && [ ! -z "$res" ] ; do - echo -e "\n$message\n$(gettext "[y/n], default to [$default]:")" - echo -en "> " - read res - [ -z "$res" ] && res="$default" - done - if [ "$res" = "$yes" ] ; then - return 0 - else - return 1 - fi + local message=$1 + local default=${2:-$no} + local res="not_define" + while [ "$res" != "$yes" ] && [ "$res" != "$no" ] && [ ! -z "$res" ] ; do + echo -e "\n$message\n$(gettext "[y/n], default to") [$default]:" + echo -en "> " + read res + [ -z "$res" ] && res="$default" + done + if [ "$res" = "$yes" ] ; then + return 0 + else + return 1 + fi } #---- ## print a message, simple answer to the question #---- answer() { - local message=$1 - local default=$2 - local var_ref=$3 - local res="" - local first=0 - while [ '!' -z "$res" ] ; do - echo -e "\n$message" - [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to [$default]")" - echo -en "> " - read res - if [ -z "$res" ] ; then - [ "$default" != "NO_DEFAULT" ] && res=$default - fi - done - eval $var_ref=$res - return 0 + local message=$1 + local default=$2 + local var_ref=$3 + local res="" + local first=0 + while [ '!' -z "$res" ] ; do + echo -e "\n$message" + [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" + echo -en "> " + read res + if [ -z "$res" ] ; then + [ "$default" != "NO_DEFAULT" ] && res=$default + fi + done + eval $var_ref=$res + return 0 } #---- @@ -269,29 +269,29 @@ answer() { ## @return 0 end #---- answer_with_testdir() { - local message=$1 - local default=$2 - local var_ref=$3 - local res="not_define" - local first=0 - while [ ! -d "$res" ] ; do - [ $first -eq 1 ] && echo_passed "$(gettext "$res is not a directory or does not exist.")" "$critical" - echo -e "\n$message" - [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to [$default]")" - echo -en "> " - read res - if [ -z "$res" ] ; then - [ "$default" != "NO_DEFAULT" ] && res=$default - fi - if [ -z ${res#/} ] ; then - echo_passed "$(gettext "You select slash...")" - res="not_define" - else - first=1 - fi - done - eval $var_ref=$res - return 0 + local message=$1 + local default=$2 + local var_ref=$3 + local res="not_define" + local first=0 + while [ ! -d "$res" ] ; do + [ $first -eq 1 ] && echo_passed "$res $(gettext "is not a directory or does not exist.")" "$critical" + echo -e "\n$message" + [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" + echo -en "> " + read res + if [ -z "$res" ] ; then + [ "$default" != "NO_DEFAULT" ] && res=$default + fi + if [ -z ${res#/} ] ; then + echo_passed "$(gettext "You cannot select slash")" + res="not_define" + else + first=1 + fi + done + eval $var_ref=$res + return 0 } #---- @@ -303,39 +303,39 @@ answer_with_testdir() { ## @return 0 end #---- answer_with_createdir() { - local message=$1 - local default=$2 - local var_ref=$3 - local res="not_define" - local first=0 - while [ ! -d "$res" ] ; do - [ $first -eq 1 ] && echo_passed "$(gettext "Directory $res does not exists.")" "$critical" - echo -e "\n$message" - [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" - echo -en "> " - read res - if [ -z "$res" ] ; then - [ "$default" != "NO_DEFAULT" ] && res=$default - fi - if [ -z "${res#/}" -o "$yes" = "$res" -o "$no" = "$res" ] ; then - echo_passed "$(gettext "You select slash...")" - res="not_define" - else - first=1 - [ -d "$res" ] && break - yes_no_default "$(gettext "Do you want me to create this directory ?") [$res]" - if [ $? -eq 0 ] ; then - mkdir -p $res - if [ $? -ne 0 ] ; then - echo_passed "$(gettext "Could not create directory.")" "$critical" - #continue - fi - log "INFO" "$(gettext "Creating") : $res" - fi - fi - done - eval $var_ref=$res - return 0 + local message=$1 + local default=$2 + local var_ref=$3 + local res="not_define" + local first=0 + while [ ! -d "$res" ] ; do + [ $first -eq 1 ] && echo_passed "$(gettext "Directory $res does not exists.")" "$critical" + echo -e "\n$message" + [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" + echo -en "> " + read res + if [ -z "$res" ] ; then + [ "$default" != "NO_DEFAULT" ] && res=$default + fi + if [ -z "${res#/}" -o "$yes" = "$res" -o "$no" = "$res" ] ; then + echo_passed "$(gettext "You cannot select slash")" + res="not_define" + else + first=1 + [ -d "$res" ] && break + yes_no_default "$(gettext "Do you want to create this directory ?") [$res]" + if [ $? -eq 0 ] ; then + mkdir -p $res + if [ $? -ne 0 ] ; then + echo_passed "$(gettext "Could not create directory.")" "$critical" + #continue + fi + log "INFO" "$(gettext "Creating") : $res" + fi + fi + done + eval $var_ref=$res + return 0 } #---- @@ -362,16 +362,16 @@ answer_with_createfile() { [ "$default" != "NO_DEFAULT" ] && res=$default fi if [ -z "${res#/}" -o "$yes" = "$res" -o "$no" = "$res" ] ; then - echo_passed "$(gettext "You select slash...")" + echo_passed "$(gettext "You cannot select slash")" res="not_define" else first=1 [ -f "$res" ] && break - yes_no_default "$(gettext "Do you want me to create this file ?") [$res]" + yes_no_default "$(gettext "Do you want to create this file ?") [$res]" if [ $? -eq 0 ] ; then touch $res if [ $? -ne 0 ] ; then - echo_passed "$(gettext "Could not create file.")" "$critical" + echo_passed "$(gettext "Could not create the file.")" "$critical" #continue fi log "INFO" "$(gettext "Creating") : $res" @@ -391,24 +391,24 @@ answer_with_createfile() { ## @return 0 end #---- answer_with_testfile() { - local message=$1 - local default=$2 - local var_ref=$3 - local res="not_define" - local first=0 - while [ ! -f "$res" ] ; do - [ $first -eq 1 ] && echo_passed "$(gettext "$res is not a valid file.")" "$critical" - echo -e "\n$message" - [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" - echo -en "> " - read res - if [ -z "$res" ] ; then - [ "$default" != "NO_DEFAULT" ] && res=$default - fi - first=1 - done - eval $var_ref=$res - return 0 + local message=$1 + local default=$2 + local var_ref=$3 + local res="not_define" + local first=0 + while [ ! -f "$res" ] ; do + [ $first -eq 1 ] && echo_passed "$(gettext "$res is not a valid file.")" "$critical" + echo -e "\n$message" + [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" + echo -en "> " + read res + if [ -z "$res" ] ; then + [ "$default" != "NO_DEFAULT" ] && res=$default + fi + first=1 + done + eval $var_ref=$res + return 0 } #---- @@ -419,38 +419,38 @@ answer_with_testfile() { ## @return 0 end #---- answer_with_creategroup() { - local message=$1 - local default=$2 - local var_ref=$3 - local res="not_def" - local first=0 - local group_tested=1 - while [ "$group_tested" -ne 0 ] ; do - [ $first -eq 1 ] && echo_passed "$(gettext "The group $res does not exist.")" "$critical" - echo -e "\n$message" - [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" - echo -en "> " - read res - if [ -z "$res" ]; then - [ "$default" != "NO_DEFAULT" ] && res=$default - fi - first=1 - if [ -n "$res" ]; then - group_test "$res" - if [ $? -ne 0 ] ; then - yes_no_default "$(gettext "Do you want me to create this group ?") [$res]" - if [ $? -eq 0 ]; then - group_create "$res" - fi - fi - else - res="not_def" - fi - group_test "$res" - group_tested=$? - done - eval "$var_ref"="$res" - return 0 + local message=$1 + local default=$2 + local var_ref=$3 + local res="not_def" + local first=0 + local group_tested=1 + while [ "$group_tested" -ne 0 ] ; do + [ $first -eq 1 ] && echo_passed "$(gettext "The group $res does not exist.")" "$critical" + echo -e "\n$message" + [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" + echo -en "> " + read res + if [ -z "$res" ]; then + [ "$default" != "NO_DEFAULT" ] && res=$default + fi + first=1 + if [ -n "$res" ]; then + group_test "$res" + if [ $? -ne 0 ] ; then + yes_no_default "$(gettext "Do you want to create this group ?") [$res]" + if [ $? -eq 0 ]; then + group_create "$res" + fi + fi + else + res="not_def" + fi + group_test "$res" + group_tested=$? + done + eval "$var_ref"="$res" + return 0 } #---- @@ -461,41 +461,41 @@ answer_with_creategroup() { ## @return 0 end #---- answer_with_createuser() { - local message=$1 - local default=$2 - local var_ref=$3 - local groups="$4" - local description="$5" - local home="$6" - local res="not_def" - local first=0 - local user_tested=1 - while [ "$user_tested" -ne 0 ] ; do - [ $first -eq 1 ] && echo_passed "$(gettext "The user $res does not exist.")" "$critical" - echo -e "\n$message" - [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" - echo -en "> " - read res - if [ -z "$res" ]; then - [ "$default" != "NO_DEFAULT" ] && res=$default - fi - first=1 - if [ -n "$res" ]; then - user_test "$res" - if [ $? -ne 0 ] ; then - yes_no_default "$(gettext "Do you want me to create this user ?") [$res]" - if [ $? -eq 0 ] ; then - user_create "$res" "$groups" "$description" "$home" - fi - fi - else - res="not_def" - fi - user_test "$res" - user_tested=$? - done - eval "$var_ref"="$res" - return 0 + local message=$1 + local default=$2 + local var_ref=$3 + local groups="$4" + local description="$5" + local home="$6" + local res="not_def" + local first=0 + local user_tested=1 + while [ "$user_tested" -ne 0 ] ; do + [ $first -eq 1 ] && echo_passed "$(gettext "The user $res does not exist.")" "$critical" + echo -e "\n$message" + [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" + echo -en "> " + read res + if [ -z "$res" ]; then + [ "$default" != "NO_DEFAULT" ] && res=$default + fi + first=1 + if [ -n "$res" ]; then + user_test "$res" + if [ $? -ne 0 ] ; then + yes_no_default "$(gettext "Do you want to create this user ?") [$res]" + if [ $? -eq 0 ] ; then + user_create "$res" "$groups" "$description" "$home" + fi + fi + else + res="not_def" + fi + user_test "$res" + user_tested=$? + done + eval "$var_ref"="$res" + return 0 } #---- @@ -505,29 +505,28 @@ answer_with_createuser() { ## @param global variable to set a result ## @return 0 end #---- -answer_with_testuser() -{ - local message=$1 - local default=$2 - local var_ref=$3 - local res="not_def" - local first=0 - local user_tested=1 - while [ "$user_tested" -ne 0 ] ; do - [ $first -eq 1 ] && echo_passed "$(gettext "The user $res does not exists.")" "$critical" - echo -e "\n$message" - [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" - echo -en "> " - read res - if [ -z "$res" ]; then - [ "$default" != "NO_DEFAULT" ] && res=$default - fi - first=1 - user_test "$res" - user_tested=$? - done - eval $var_ref=$res - return 0 +answer_with_testuser() { + local message=$1 + local default=$2 + local var_ref=$3 + local res="not_def" + local first=0 + local user_tested=1 + while [ "$user_tested" -ne 0 ] ; do + [ $first -eq 1 ] && echo_passed "$(gettext "The user $res does not exists.")" "$critical" + echo -e "\n$message" + [ "$default" != "NO_DEFAULT" ] && echo -e "$(gettext "default to") [$default]" + echo -en "> " + read res + if [ -z "$res" ]; then + [ "$default" != "NO_DEFAULT" ] && res=$default + fi + first=1 + user_test "$res" + user_tested=$? + done + eval $var_ref=$res + return 0 } #---- @@ -538,15 +537,15 @@ answer_with_testuser() ## @return 1 file does not exist #---- testfile_clean() { - local file="$1" - local var="$2" - [ -z "$file" ] && return 1 - if [ ! -e "$file" ] ; then - eval $var="" - return 1 - else - return 0 - fi + local file="$1" + local var="$2" + [ -z "$file" ] && return 1 + if [ ! -e "$file" ] ; then + eval $var="" + return 1 + else + return 0 + fi } #---- @@ -557,66 +556,63 @@ testfile_clean() { ## @return 1 directory does not exist #---- testdir_clean() { - local dir="$1" - local var="$2" - [ -z "$dir" ] && return 1 - if [ ! -d "$dir" ] ; then - eval $var="" - return 1 - else - return 0 - fi + local dir="$1" + local var="$2" + [ -z "$dir" ] && return 1 + if [ ! -d "$dir" ] ; then + eval $var="" + return 1 + else + return 0 + fi } dir_test_create() { - local dirname="$1" - if [ ! -d "$1" ] ; then - mkdir -p "$dirname" - if [ $? -ne 0 ] ; then - echo_failure "$(gettext "Could not create directory") $dirname" "$fail" - return 1 - fi - echo_success "$(gettext "Creating directory") $dirname" "$ok" - log "INFO" "$(gettext "Creating directory") $dirname" - fi - return 0 + local dirname="$1" + if [ ! -d "$1" ] ; then + mkdir -p "$dirname" + if [ $? -ne 0 ] ; then + echo_failure "$(gettext "Could not create directory") $dirname" "$fail" + return 1 + fi + echo_success "$(gettext "Creating directory") $dirname" "$ok" + fi + return 0 } user_test() { - grep "^$1:" /etc/passwd &>/dev/null - return $? + grep "^$1:" /etc/passwd &>/dev/null + return $? } user_create() { - local username="$1" - local groupname="$2" - local description="$3" - local home="$4" - useradd -r -c "$description" -s "/bin/sh" -d "$home" -g "$groupname" "$username" - if [ $? -ne 0 ]; then - echo_failure "$(gettext "Could not create user") $username" "$fail" - return 1 - fi - echo_success "$(gettext "Creating user") $username ($description)" "$ok" - log "INFO" "$(gettext "Creating user") $username" - return 0 + local username="$1" + local groupname="$2" + local description="$3" + local home="$4" + useradd -r -c "$description" -s "/bin/sh" -d "$home" -g "$groupname" "$username" + if [ $? -ne 0 ]; then + echo_failure "$(gettext "Could not create user") $username" "$fail" + return 1 + fi + echo_success "$(gettext "Creating user") $username ($description)" "$ok" + return 0 } group_test() { - grep "^$1:" /etc/group &>/dev/null - return $? + grep "^$1:" /etc/group &>/dev/null + return $? } group_create() { - local groupname="$1" - groupadd -r "$groupname" - if [ $? -ne 0 ] ; then - echo_failure "$(gettext "Could not create group") $groupname" "$fail" - return 1 - fi - echo_success "$(gettext "Creating group") $groupname" "$ok" - log "INFO" "$(gettext "Creating group") $groupname" - return 0 + local groupname="$1" + groupadd -r "$groupname" + if [ $? -ne 0 ] ; then + echo_failure "$(gettext "Could not create group") $groupname" "$fail" + return 1 + fi + echo_success "$(gettext "Creating group") $groupname" "$ok" + return 0 } #---- @@ -625,14 +621,14 @@ group_create() { ## @Globals PLUGIN_DIR, DEFAULT_PLUGIN_DIR #---- locate_plugindir() { - testdir_clean "$PLUGIN_DIR" "PLUGIN_DIR" - if [ -z "$PLUGIN_DIR" ] ; then - answer "$(gettext "Where is your monitoring plugins (libexec) directory ?")" "$DEFAULT_PLUGIN_DIR" "PLUGIN_DIR" - echo_success "$(gettext "Path" ) $PLUGIN_DIR" "$ok" - fi - PLUGIN_DIR=`trim ${PLUGIN_DIR%/}` - export PLUGIN_DIR - log "INFO" "PLUGIN_DIR: $PLUGIN_DIR" + testdir_clean "$PLUGIN_DIR" "PLUGIN_DIR" + if [ -z "$PLUGIN_DIR" ] ; then + answer "$(gettext "Where is your monitoring plugins (libexec) directory ?")" "$DEFAULT_PLUGIN_DIR" "PLUGIN_DIR" + echo_success "$(gettext "Path" ) $PLUGIN_DIR" "$ok" + fi + PLUGIN_DIR=`trim ${PLUGIN_DIR%/}` + export PLUGIN_DIR + log "INFO" "PLUGIN_DIR: $PLUGIN_DIR" } #---- @@ -644,21 +640,21 @@ locate_plugindir() { ## @Globals INIT.D, DEFAULT_INIT_D #---- locate_init_d() { - testdir_clean "$INIT_D" "INIT_D" - if [ -z "$INIT_D" ] ; then - if [ -d "/etc/init.d" ] ; then - INIT_D="/etc/init.d" - elif [ -d "/usr/local/etc/rc.d" ] ; then - INIT_D="/usr/local/etc/rc.d" - # Add most of init.d - else - answer_with_testdir "$(gettext "Where is your init.d directory ?")" "$DEFAULT_INIT_D" "INIT_D" - echo_success "$(gettext "Path" ) $INIT_D" "$ok" - fi - fi - INIT_D=`trim ${INIT_D%/}` - export INIT_D - log "INFO" "INIT_D: $INIT_D" + testdir_clean "$INIT_D" "INIT_D" + if [ -z "$INIT_D" ] ; then + if [ -d "/etc/init.d" ] ; then + INIT_D="/etc/init.d" + elif [ -d "/usr/local/etc/rc.d" ] ; then + INIT_D="/usr/local/etc/rc.d" + # Add most of init.d + else + answer_with_testdir "$(gettext "Where is your init.d directory ?")" "$DEFAULT_INIT_D" "INIT_D" + echo_success "$(gettext "Path" ) $INIT_D" "$ok" + fi + fi + INIT_D=`trim ${INIT_D%/}` + export INIT_D + log "INFO" "INIT_D: $INIT_D" } #---- @@ -676,35 +672,59 @@ locate_centreon_plugins() { log "INFO" "CENTREON_PLUGINS: $CENTREON_PLUGINS" } +#---- +## Define where is centreon gorgone module +## @Globals GORGONE_VARLIB, DEFAULT_GORGONE_VARLIB +#---- +locate_gorgone_varlib() { + if [ -z "$GORGONE_VARLIB" ] ; then + answer_with_testdir "$(gettext "Where is your gorgone module folder ?") [$DEFAULT_GORGONE_VARLIB]" "$DEFAULT_GORGONE_VARLIB" "GORGONE_VARLIB" + fi + GORGONE_VARLIB=`trim ${GORGONE_VARLIB%/}` + export GORGONE_VARLIB + echo_success "$(gettext "Path" ) $GORGONE_VARLIB" "$ok" + log "INFO" "GORGONE_VARLIB: $GORGONE_VARLIB" +} + +#---- +## Define where is centreon gorgone configuration folder +## @Globals GORGONE_CONFIG, DEFAULT_GORGONE_CONFIG +#---- +locate_gorgone_config() { + if [ -z "$GORGONE_CONFIG" ] ; then + answer_with_testdir "$(gettext "Where is your gorgone configuration folder ?") [$DEFAULT_GORGONE_CONFIG]" "$DEFAULT_GORGONE_CONFIG" "GORGONE_CONFIG" + fi + GORGONE_CONFIG=`trim ${GORGONE_CONFIG%/}` + export GORGONE_CONFIG + log "INFO" "GORGONE_CONFIG: $GORGONE_CONFIG" +} + -locate_monitoringengine_etc() -{ - if [ -z "$MONITORINGENGINE_ETC" ]; then - answer_with_testdir "$(gettext "What is the Monitoring engine configuration directory ?") [$DEFAULT_MONITORINGENGINE_ETC]" "$DEFAULT_MONITORINGENGINE_ETC" "MONITORINGENGINE_ETC" - fi - MONITORINGENGINE_ETC=`trim ${MONITORINGENGINE_ETC%/}` - export MONITORINGENGINE_ETC - log "INFO" "MONITORINGENGINE_ETC: $MONITORINGENGINE_ETC" +locate_monitoringengine_etc() { + if [ -z "$MONITORINGENGINE_ETC" ]; then + answer_with_testdir "$(gettext "What is the Monitoring engine configuration directory ?") [$DEFAULT_MONITORINGENGINE_ETC]" "$DEFAULT_MONITORINGENGINE_ETC" "MONITORINGENGINE_ETC" + fi + MONITORINGENGINE_ETC=`trim ${MONITORINGENGINE_ETC%/}` + export MONITORINGENGINE_ETC + log "INFO" "MONITORINGENGINE_ETC: $MONITORINGENGINE_ETC" } -locate_monitoringengine_log() -{ - if [ -z "$MONITORINGENGINE_LOG" ]; then - answer_with_testdir "$(gettext "What is the Monitoring engine log directory ?") [$DEFAULT_MONITORINGENGINE_LOG]" "$DEFAULT_MONITORINGENGINE_LOG" "MONITORINGENGINE_LOG" - fi - MONITORINGENGINE_LOG=`trim ${MONITORINGENGINE_LOG%/}` - export MONITORINGENGINE_LOG - log "INFO" "MONITORINGENGINE_LOG: $MONITORINGENGINE_LOG" +locate_monitoringengine_log() { + if [ -z "$MONITORINGENGINE_LOG" ]; then + answer_with_testdir "$(gettext "What is the Monitoring engine log directory ?") [$DEFAULT_MONITORINGENGINE_LOG]" "$DEFAULT_MONITORINGENGINE_LOG" "MONITORINGENGINE_LOG" + fi + MONITORINGENGINE_LOG=`trim ${MONITORINGENGINE_LOG%/}` + export MONITORINGENGINE_LOG + log "INFO" "MONITORINGENGINE_LOG: $MONITORINGENGINE_LOG" } -locate_broker_etc() -{ - if [ -z "$BROKER_ETC" ]; then - answer_with_testdir "$(gettext "Where is the configuration directory for broker module ?") [$DEFAULT_BROKER_ETC]" "$DEFAULT_BROKER_ETC" "BROKER_ETC" - fi - BROKER_ETC=`trim ${BROKER_ETC%/}` - export BROKER_ETC - log "INFO" "BROKER_ETC: $BROKER_ETC" +locate_broker_etc() { + if [ -z "$BROKER_ETC" ]; then + answer_with_testdir "$(gettext "Where is the configuration directory for broker module ?") [$DEFAULT_BROKER_ETC]" "$DEFAULT_BROKER_ETC" "BROKER_ETC" + fi + BROKER_ETC=`trim ${BROKER_ETC%/}` + export BROKER_ETC + log "INFO" "BROKER_ETC: $BROKER_ETC" } #---- @@ -712,19 +732,19 @@ locate_broker_etc() ## @Globals CENTREON_LOG, DEFAULT_CENTREON_LOG #---- locate_centreon_logdir() { - if [ -n "$CENTREON_LOG" ] ; then - dir_test_create "$CENTREON_LOG" - if [ $? -ne 0 ] ; then - CENTREON_LOG="" - fi - fi - if [ -z "$CENTREON_LOG" ] ; then - answer_with_createdir "$(gettext "Where is your Centreon log directory")" "$DEFAULT_CENTREON_LOG" "CENTREON_LOG" - echo_success "$(gettext "Path" ) $CENTREON_LOG" "$ok" - fi - CENTREON_LOG=`trim ${CENTREON_LOG%/}` - export CENTREON_LOG - log "INFO" "CENTREON_LOG: $CENTREON_LOG" + if [ -n "$CENTREON_LOG" ] ; then + dir_test_create "$CENTREON_LOG" + if [ $? -ne 0 ] ; then + CENTREON_LOG="" + fi + fi + if [ -z "$CENTREON_LOG" ] ; then + answer_with_createdir "$(gettext "Where is your Centreon log directory")" "$DEFAULT_CENTREON_LOG" "CENTREON_LOG" + echo_success "$(gettext "Path" ) $CENTREON_LOG" "$ok" + fi + CENTREON_LOG=`trim ${CENTREON_LOG%/}` + export CENTREON_LOG + log "INFO" "CENTREON_LOG: $CENTREON_LOG" } #---- @@ -732,19 +752,19 @@ locate_centreon_logdir() { ## @Globals CENTREON_ETC, DEFAULT_CENTREON_ETC #---- locate_centreon_etcdir() { - if [ -n "$CENTREON_ETC" ] ; then - dir_test_create "$CENTREON_ETC" - if [ $? -ne 0 ] ; then - CENTREON_ETC="" - fi - fi - if [ -z "$CENTREON_ETC" ] ; then - answer_with_createdir "$(gettext "Where is your Centreon etc directory")" "$DEFAULT_CENTREON_ETC" "CENTREON_ETC" - echo_success "$(gettext "Path" ) $CENTREON_ETC" "$ok" - fi - CENTREON_ETC=`trim ${CENTREON_ETC%/}` - export CENTREON_ETC - log "INFO" "CENTREON_ETC: $CENTREON_ETC" + if [ -n "$CENTREON_ETC" ] ; then + dir_test_create "$CENTREON_ETC" + if [ $? -ne 0 ] ; then + CENTREON_ETC="" + fi + fi + if [ -z "$CENTREON_ETC" ] ; then + answer_with_createdir "$(gettext "Where is your Centreon etc directory")" "$DEFAULT_CENTREON_ETC" "CENTREON_ETC" + echo_success "$(gettext "Path" ) $CENTREON_ETC" "$ok" + fi + CENTREON_ETC=`trim ${CENTREON_ETC%/}` + export CENTREON_ETC + log "INFO" "CENTREON_ETC: $CENTREON_ETC" } #---- @@ -754,8 +774,8 @@ locate_centreon_etcdir() { #---- locate_centreon_bindir() { CENTREON_BINDIR="$INSTALL_DIR_CENTREON/bin" - export CENTREON_BINDIR - log "INFO" "CENTREON_BINDIR: $CENTREON_BINDIR" + export CENTREON_BINDIR + log "INFO" "CENTREON_BINDIR: $CENTREON_BINDIR" } #---- @@ -763,19 +783,19 @@ locate_centreon_bindir() { ## @Globals INSTALL_DIR_CENTREON, DEFAULT_INSTALL_DIR_CENTREON #---- locate_centreon_installdir() { - if [ -n "$INSTALL_DIR_CENTREON" ] ; then - dir_test_create "$INSTALL_DIR_CENTREON" - if [ $? -ne 0 ] ; then - INSTALL_DIR_CENTREON="" - fi - fi - if [ -z "$INSTALL_DIR_CENTREON" ] ; then - answer_with_createdir "$(gettext "Where is your Centreon directory?")" "$DEFAULT_INSTALL_DIR_CENTREON" "INSTALL_DIR_CENTREON" - echo_success "$(gettext "Path" ) $INSTALL_DIR_CENTREON" "$ok" - fi - INSTALL_DIR_CENTREON=`trim ${INSTALL_DIR_CENTREON%/}` - export INSTALL_DIR_CENTREON - log "INFO" "INSTALL_DIR_CENTREON: $INSTALL_DIR_CENTREON" + if [ -n "$INSTALL_DIR_CENTREON" ] ; then + dir_test_create "$INSTALL_DIR_CENTREON" + if [ $? -ne 0 ] ; then + INSTALL_DIR_CENTREON="" + fi + fi + if [ -z "$INSTALL_DIR_CENTREON" ] ; then + answer_with_createdir "$(gettext "Where is your Centreon directory?")" "$DEFAULT_INSTALL_DIR_CENTREON" "INSTALL_DIR_CENTREON" + echo_success "$(gettext "Path" ) $INSTALL_DIR_CENTREON" "$ok" + fi + INSTALL_DIR_CENTREON=`trim ${INSTALL_DIR_CENTREON%/}` + export INSTALL_DIR_CENTREON + log "INFO" "INSTALL_DIR_CENTREON: $INSTALL_DIR_CENTREON" } #---- @@ -784,19 +804,19 @@ locate_centreon_installdir() { ## @Globals CENTREON_CACHEDIR, DEFAULT_CENTREON_CACHEDIR #---- locate_centreon_generationdir() { - if [ -n "$CENTREON_CACHEDIR" ] ; then - dir_test_create "$CENTREON_CACHEDIR" - if [ $? -ne 0 ] ; then - CENTREON_CACHEDIR="" - fi - fi - if [ -z "$CENTREON_CACHEDIR" ] ; then - answer_with_createdir "$(gettext "Where is your Centreon cache directory?")" "$DEFAULT_CENTREON_CACHEDIR" "CENTREON_CACHEDIR" - echo_success "$(gettext "Path" ) $CENTREON_CACHEDIR" "$ok" - fi - CENTREON_CACHEDIR=`trim ${CENTREON_CACHEDIR%/}` - export CENTREON_CACHEDIR - log "INFO" "CENTREON_CACHEDIR: $CENTREON_CACHEDIR" + if [ -n "$CENTREON_CACHEDIR" ] ; then + dir_test_create "$CENTREON_CACHEDIR" + if [ $? -ne 0 ] ; then + CENTREON_CACHEDIR="" + fi + fi + if [ -z "$CENTREON_CACHEDIR" ] ; then + answer_with_createdir "$(gettext "Where is your Centreon cache directory?")" "$DEFAULT_CENTREON_CACHEDIR" "CENTREON_CACHEDIR" + echo_success "$(gettext "Path" ) $CENTREON_CACHEDIR" "$ok" + fi + CENTREON_CACHEDIR=`trim ${CENTREON_CACHEDIR%/}` + export CENTREON_CACHEDIR + log "INFO" "CENTREON_CACHEDIR: $CENTREON_CACHEDIR" } #---- @@ -804,19 +824,19 @@ locate_centreon_generationdir() { ## @Globals CENTREON_RUNDIR, DEFAULT_CENTREON_RUNDIR #---- locate_centreon_rundir() { - if [ -n "$CENTREON_RUNDIR" ] ; then - dir_test_create "$CENTREON_RUNDIR" - if [ $? -ne 0 ] ; then - CENTREON_RUNDIR="" - fi - fi - if [ -z "$CENTREON_RUNDIR" ] ; then - answer_with_createdir "$(gettext "Where is your Centreon Run Dir directory?")" "$DEFAULT_CENTREON_RUNDIR" "CENTREON_RUNDIR" - echo_success "$(gettext "Path" ) $CENTREON_RUNDIR" "$ok" - fi - CENTREON_RUNDIR=`trim ${CENTREON_RUNDIR%/}` - export CENTREON_RUNDIR - log "INFO" "CENTREON_RUNDIR: $CENTREON_RUNDIR" + if [ -n "$CENTREON_RUNDIR" ] ; then + dir_test_create "$CENTREON_RUNDIR" + if [ $? -ne 0 ] ; then + CENTREON_RUNDIR="" + fi + fi + if [ -z "$CENTREON_RUNDIR" ] ; then + answer_with_createdir "$(gettext "Where is your Centreon Run Dir directory?")" "$DEFAULT_CENTREON_RUNDIR" "CENTREON_RUNDIR" + echo_success "$(gettext "Path" ) $CENTREON_RUNDIR" "$ok" + fi + CENTREON_RUNDIR=`trim ${CENTREON_RUNDIR%/}` + export CENTREON_RUNDIR + log "INFO" "CENTREON_RUNDIR: $CENTREON_RUNDIR" } #---- @@ -824,22 +844,22 @@ locate_centreon_rundir() { ## @Globals CENTREON_VARLIB, DEFAULT_CENTREON_VARLIB #---- locate_centreon_varlib() { - if [ -n "$CENTREON_VARLIB" ] ; then - dir_test_create "$CENTREON_VARLIB" - if [ $? -ne 0 ] ; then - CENTREON_VARLIB="" - fi - fi - if [ -z "$CENTREON_VARLIB" ] ; then - answer_with_createdir "$(gettext "Where is your Centreon variable library directory?")" "$DEFAULT_CENTREON_VARLIB" "CENTREON_VARLIB" - echo_success "$(gettext "Path" ) $CENTREON_VARLIB" "$ok" - fi - CENTREON_VARLIB=`trim ${CENTREON_VARLIB%/}` - if [ ! -d "$CENTREON_VARLIB/installs" ] ; then - mkdir -p "$CENTREON_VARLIB/installs" - fi - export CENTREON_VARLIB - log "INFO" "CENTREON_VARLIB: $CENTREON_VARLIB" + if [ -n "$CENTREON_VARLIB" ] ; then + dir_test_create "$CENTREON_VARLIB" + if [ $? -ne 0 ] ; then + CENTREON_VARLIB="" + fi + fi + if [ -z "$CENTREON_VARLIB" ] ; then + answer_with_createdir "$(gettext "Where is your Centreon variable library directory?")" "$DEFAULT_CENTREON_VARLIB" "CENTREON_VARLIB" + echo_success "$(gettext "Path" ) $CENTREON_VARLIB" "$ok" + fi + CENTREON_VARLIB=`trim ${CENTREON_VARLIB%/}` + if [ ! -d "$CENTREON_VARLIB/installs" ] ; then + mkdir -p "$CENTREON_VARLIB/installs" + fi + export CENTREON_VARLIB + log "INFO" "CENTREON_VARLIB: $CENTREON_VARLIB" } #---- @@ -847,19 +867,19 @@ locate_centreon_varlib() { ## @Globals CENTSTORAGE_RRD, DEFAULT_CENTSTORAGE_RRD #---- locate_centstorage_rrddir() { - if [ -n "$CENTSTORAGE_RRD" ] ; then - dir_test_create "$CENTSTORAGE_RRD" - if [ $? -ne 0 ] ; then - CENTSTORAGE_RRD="" - fi - fi - if [ -z "$CENTSTORAGE_RRD" ] ; then - answer_with_createdir "$(gettext "Where is your CentStorage RRD directory")" "$DEFAULT_CENTSTORAGE_RRD" "CENTSTORAGE_RRD" - echo_success "$(gettext "Path" ) $CENTSTORAGE_RRD" "$ok" - fi - CENTSTORAGE_RRD=`trim ${CENTSTORAGE_RRD%/}` - export CENTSTORAGE_RRD - log "INFO" "CENTSTORAGE_RRD: $CENTSTORAGE_RRD" + if [ -n "$CENTSTORAGE_RRD" ] ; then + dir_test_create "$CENTSTORAGE_RRD" + if [ $? -ne 0 ] ; then + CENTSTORAGE_RRD="" + fi + fi + if [ -z "$CENTSTORAGE_RRD" ] ; then + answer_with_createdir "$(gettext "Where is your CentStorage RRD directory")" "$DEFAULT_CENTSTORAGE_RRD" "CENTSTORAGE_RRD" + echo_success "$(gettext "Path" ) $CENTSTORAGE_RRD" "$ok" + fi + CENTSTORAGE_RRD=`trim ${CENTSTORAGE_RRD%/}` + export CENTSTORAGE_RRD + log "INFO" "CENTSTORAGE_RRD: $CENTSTORAGE_RRD" } #---- @@ -867,16 +887,16 @@ locate_centstorage_rrddir() { ## @Globals CENTSTORAGE_BINDIR, INSTALL_DIR_CENTREON, DEFAULT_CENTSTORAGE_BINDIR #---- locate_centstorage_bindir() { - if [ -z "$CENTSTORAGE_BINDIR" ] ; then - answer_with_createdir "$(gettext "Where is your CentStorage binary directory")" "$INSTALL_DIR_CENTREON/$DEFAULT_CENTSTORAGE_BINDIR" "CENTSTORAGE_BINDIR" - echo_success "$(gettext "Path" ) $CENTSTORAGE_BINDIR" "$ok" - elif [ ! -d "$CENTSTORAGE_BINDIR" -a "$silent_install" -eq 1 ] ; then - mkdir -p "$CENTSTORAGE_BINDIR" - log "INFO" "$(gettext "Create") $CENTSTORAGE_BINDIR" - fi - CENTSTORAGE_BINDIR=`trim ${CENTSTORAGE_BINDIR%/}` - export CENTSTORAGE_BINDIR - log "INFO" "CENTSTORAGE_BINDIR: $CENTSTORAGE_BINDIR" + if [ -z "$CENTSTORAGE_BINDIR" ] ; then + answer_with_createdir "$(gettext "Where is your CentStorage binary directory")" "$INSTALL_DIR_CENTREON/$DEFAULT_CENTSTORAGE_BINDIR" "CENTSTORAGE_BINDIR" + echo_success "$(gettext "Path" ) $CENTSTORAGE_BINDIR" "$ok" + elif [ ! -d "$CENTSTORAGE_BINDIR" -a "$silent_install" -eq 1 ] ; then + mkdir -p "$CENTSTORAGE_BINDIR" + log "INFO" "$(gettext "Create") $CENTSTORAGE_BINDIR" + fi + CENTSTORAGE_BINDIR=`trim ${CENTSTORAGE_BINDIR%/}` + export CENTSTORAGE_BINDIR + log "INFO" "CENTSTORAGE_BINDIR: $CENTSTORAGE_BINDIR" } #---- @@ -884,33 +904,16 @@ locate_centstorage_bindir() { ## @Globals CENTSTORAGE_LIBDIR, INSTALL_DIR_CENTREON, DEFAULT_CENTSTORAGE_LIBDIR #---- locate_centstorage_libdir() { - if [ -z "$CENTSTORAGE_LIBDIR" ] ; then - answer_with_createdir "$(gettext "Where is your CentStorage library directory")" "$INSTALL_DIR_CENTREON/$DEFAULT_CENTSTORAGE_LIBDIR" "CENTSTORAGE_LIBDIR" - echo_success "$(gettext "Path" ) $CENTSTORAGE_LIBDIR" "$ok" - elif [ ! -d "$CENTSTORAGE_LIBDIR" -a "$silent_install" -eq 1 ] ; then - mkdir -p "$CENTSTORAGE_LIBDIR" - log "INFO" "$(gettext "Create") $CENTSTORAGE_LIBDIR" - fi - CENTSTORAGE_LIBDIR=`trim ${CENTSTORAGE_LIBDIR%/}` - export CENTSTORAGE_LIBDIR - log "INFO" "CENTSTORAGE_LIBDIR: $CENTSTORAGE_LIBDIR" -} - -#---- -## Define where is centCore binary directory -## @Globals CENTCORE_BINDIR, INSTALL_DIR_CENTREON, DEFAULT_CENTCORE_BINDIR -#---- -locate_centcore_bindir() { - if [ -z "$CENTCORE_BINDIR" ] ; then - answer_with_createdir "$(gettext "Where is your CentCore binary directory")" "$INSTALL_DIR_CENTREON/$DEFAULT_CENTCORE_BINDIR" "CENTCORE_BINDIR" - echo_success "$(gettext "Path" ) $CENTCORE_BINDIR" "$ok" - elif [ ! -d "$CENTCORE_BINDIR" -a "$silent_install" -eq 1 ] ; then - mkdir -p $CENTCORE_BINDIR - log "INFO" "$(gettext "Create") $CENTCORE_BINDIR" - fi - CENTCORE_BINDIR=`trim ${CENTCORE_BINDIR%/}` - export CENTCORE_BINDIR - log "INFO" "CENTCORE_BINDIR: $CENTCORE_BINDIR" + if [ -z "$CENTSTORAGE_LIBDIR" ] ; then + answer_with_createdir "$(gettext "Where is your CentStorage library directory")" "$INSTALL_DIR_CENTREON/$DEFAULT_CENTSTORAGE_LIBDIR" "CENTSTORAGE_LIBDIR" + echo_success "$(gettext "Path" ) $CENTSTORAGE_LIBDIR" "$ok" + elif [ ! -d "$CENTSTORAGE_LIBDIR" -a "$silent_install" -eq 1 ] ; then + mkdir -p "$CENTSTORAGE_LIBDIR" + log "INFO" "$(gettext "Create") $CENTSTORAGE_LIBDIR" + fi + CENTSTORAGE_LIBDIR=`trim ${CENTSTORAGE_LIBDIR%/}` + export CENTSTORAGE_LIBDIR + log "INFO" "CENTSTORAGE_LIBDIR: $CENTSTORAGE_LIBDIR" } #---- @@ -918,21 +921,21 @@ locate_centcore_bindir() { ## @Globals CENTPLUGINS_TMP, DEFAULT_CENTPLUGINS_TMP #---- locate_centplugins_tmpdir() { - if [ -n "$CENTPLUGINS_TMP" ] ; then - dir_test_create "$CENTPLUGINS_TMP" - if [ $? -ne 0 ] ; then - CENTPLUGINS_TMP="" - else - $CHMOD g+w "$CENTPLUGINS_TMP" - fi - fi - if [ -z "$CENTPLUGINS_TMP" ] ; then - answer_with_createdir "$(gettext "Where is your CentPlugins lib directory")" "$DEFAULT_CENTPLUGINS_TMP" "CENTPLUGINS_TMP" - echo_success "$(gettext "Path" ) $CENTPLUGINS_TMP" "$ok" - fi - CENTPLUGINS_TMP=`trim ${CENTPLUGINS_TMP%/}` - export CENTPLUGINS_TMP - log "INFO" "CENTPLUGINS_TMP: $CENTPLUGINS_TMP" + if [ -n "$CENTPLUGINS_TMP" ] ; then + dir_test_create "$CENTPLUGINS_TMP" + if [ $? -ne 0 ] ; then + CENTPLUGINS_TMP="" + else + $CHMOD g+w "$CENTPLUGINS_TMP" + fi + fi + if [ -z "$CENTPLUGINS_TMP" ] ; then + answer_with_createdir "$(gettext "Where is your CentPlugins lib directory")" "$DEFAULT_CENTPLUGINS_TMP" "CENTPLUGINS_TMP" + echo_success "$(gettext "Path" ) $CENTPLUGINS_TMP" "$ok" + fi + CENTPLUGINS_TMP=`trim ${CENTPLUGINS_TMP%/}` + export CENTPLUGINS_TMP + log "INFO" "CENTPLUGINS_TMP: $CENTPLUGINS_TMP" } #---- @@ -940,14 +943,14 @@ locate_centplugins_tmpdir() { ## @Globals SNMP_ETC, DEFAULT_SNMP_ETC #---- locate_snmp_etcdir() { - testdir_clean "$SNMP_ETC" "SNMP_ETC" - if [ -z "$SNMP_ETC" ] ; then - answer_with_testdir "$(gettext "Where is your SNMP configuration directory")" "$DEFAULT_SNMP_ETC" "SNMP_ETC" - echo_success "$SNMP_ETC" "$ok" - fi - SNMP_ETC=${SNMP_ETC%/} - export SNMP_ETC - log "INFO" "SNMP_ETC: $SNMP_ETC" + testdir_clean "$SNMP_ETC" "SNMP_ETC" + if [ -z "$SNMP_ETC" ] ; then + answer_with_testdir "$(gettext "Where is your SNMP configuration directory")" "$DEFAULT_SNMP_ETC" "SNMP_ETC" + echo_success "$SNMP_ETC" "$ok" + fi + SNMP_ETC=${SNMP_ETC%/} + export SNMP_ETC + log "INFO" "SNMP_ETC: $SNMP_ETC" } #---- @@ -955,13 +958,13 @@ locate_snmp_etcdir() { ## @Globals CENTREONTRAPD_BINDIR, DEFAULT_CENTREONTRAPD_BINDIR #---- locate_centreontrapd_bindir() { - if [ -z "$CENTREONTRAPD_BINDIR" ] ; then - answer_with_createdir "$(gettext "Where is your CentreonTrapd binaries directory")" "$DEFAULT_CENTREON_BINDIR" "CENTREONTRAPD_BINDIR" - echo_success "$CENTREONTRAPD_BINDIR" "$ok" - fi - CENTREONTRAPD_BINDIR=`trim ${CENTREONTRAPD_BINDIR%/}` - export CENTREONTRAPD_BINDIR - log "INFO" "CENTREONTRAPD_BINDIR: $CENTREONTRAPD_BINDIR" + if [ -z "$CENTREONTRAPD_BINDIR" ] ; then + answer_with_createdir "$(gettext "Where is your CentreonTrapd binaries directory")" "$DEFAULT_CENTREON_BINDIR" "CENTREONTRAPD_BINDIR" + echo_success "$CENTREONTRAPD_BINDIR" "$ok" + fi + CENTREONTRAPD_BINDIR=`trim ${CENTREONTRAPD_BINDIR%/}` + export CENTREONTRAPD_BINDIR + log "INFO" "CENTREONTRAPD_BINDIR: $CENTREONTRAPD_BINDIR" } #---- @@ -969,13 +972,13 @@ locate_centreontrapd_bindir() { ## @Globals SUDO_FILE, DEFAULT_SUDO_FILE #---- locate_sudo() { - if [ -z "$SUDO_FILE" ] ; then - answer_with_createfile "$(gettext "Where is sudo configuration file")" "$DEFAULT_SUDO_FILE" "SUDO_FILE" - echo_success "$SUDO_FILE" "$ok" - fi - SUDO_FILE=`trim ${SUDO_FILE%/}` - export SUDO_FILE - log "INFO" "SUDO_FILE: $SUDO_FILE" + if [ -z "$SUDO_FILE" ] ; then + answer_with_createfile "$(gettext "Where is sudo configuration file")" "$DEFAULT_SUDO_FILE" "SUDO_FILE" + echo_success "$SUDO_FILE" "$ok" + fi + SUDO_FILE=`trim ${SUDO_FILE%/}` + export SUDO_FILE + log "INFO" "SUDO_FILE: $SUDO_FILE" } #---- @@ -984,19 +987,19 @@ locate_sudo() { ## @Globals BIN_RRDTOOL, DEFAULT_BIN_RRDTOOL #---- locate_rrdtool() { - testfile_clean "$BIN_RRDTOOL" "BIN_RRDTOOL" - if [ -z "$BIN_RRDTOOL" ] ; then - pathfind_ret "rrdtool" "BIN_RRDTOOL" - if [ "$?" -ne 0 ] ; then - answer_with_testfile "$(gettext "Where is rrdtool")" "$DEFAULT_BIN_RRDTOOL" "BIN_RRDTOOL" - else - BIN_RRDTOOL="$BIN_RRDTOOL/rrdtool" - fi - echo_success "$BIN_RRDTOOL" "$ok" - fi - BIN_RRDTOOL=`trim ${BIN_RRDTOOL%/}` - export BIN_RRDTOOL - log "INFO" "BIN_RRDTOOL: $BIN_RRDTOOL" + testfile_clean "$BIN_RRDTOOL" "BIN_RRDTOOL" + if [ -z "$BIN_RRDTOOL" ] ; then + pathfind_ret "rrdtool" "BIN_RRDTOOL" + if [ "$?" -ne 0 ] ; then + answer_with_testfile "$(gettext "Where is rrdtool")" "$DEFAULT_BIN_RRDTOOL" "BIN_RRDTOOL" + else + BIN_RRDTOOL="$BIN_RRDTOOL/rrdtool" + fi + echo_success "$BIN_RRDTOOL" "$ok" + fi + BIN_RRDTOOL=`trim ${BIN_RRDTOOL%/}` + export BIN_RRDTOOL + log "INFO" "BIN_RRDTOOL: $BIN_RRDTOOL" } #---- @@ -1005,19 +1008,19 @@ locate_rrdtool() { ## @Globals BIN_PERL, DEFAULT_BIN_PERL #---- locate_perl() { - testfile_clean "$BIN_PERL" "BIN_PERL" - if [ -z "$BIN_PERL" ] ; then - pathfind_ret "perl" "BIN_PERL" - if [ "$?" -ne 0 ] ; then - answer_with_testfile "$(gettext "Where is perl")" "$DEFAULT_BIN_PERL" "BIN_PERL" - else - BIN_PERL="$BIN_PERL/perl" - fi - echo_success "$BIN_PERL" "$ok" - fi - BIN_PERL=`trim ${BIN_PERL%/}` - export BIN_PERL - log "INFO" "BIN_PERL: $BIN_PERL" + testfile_clean "$BIN_PERL" "BIN_PERL" + if [ -z "$BIN_PERL" ] ; then + pathfind_ret "perl" "BIN_PERL" + if [ "$?" -ne 0 ] ; then + answer_with_testfile "$(gettext "Where is perl")" "$DEFAULT_BIN_PERL" "BIN_PERL" + else + BIN_PERL="$BIN_PERL/perl" + fi + echo_success "$BIN_PERL" "$ok" + fi + BIN_PERL=`trim ${BIN_PERL%/}` + export BIN_PERL + log "INFO" "BIN_PERL: $BIN_PERL" } #---- @@ -1026,19 +1029,19 @@ locate_perl() { ## @Globals BIN_MAIL, DEFAULT_BIN_MAIL #---- locate_mail() { - testfile_clean "$BIN_MAIL" "BIN_MAIL" - if [ -z "$BIN_MAIL" ] ; then - pathfind_ret "mail" "BIN_MAIL" - if [ "$?" -ne 0 ] ; then - answer_with_testfile "$(gettext "Where is mail binary")" "$DEFAULT_BIN_MAIL" "BIN_MAIL" - else - BIN_MAIL="$BIN_MAIL/mail" - fi - echo_success "$BIN_MAIL" "$ok" - fi - BIN_MAIL=`trim ${BIN_MAIL%/}` - export BIN_MAIL - log "INFO" "BIN_MAIL: $BIN_MAIL" + testfile_clean "$BIN_MAIL" "BIN_MAIL" + if [ -z "$BIN_MAIL" ] ; then + pathfind_ret "mail" "BIN_MAIL" + if [ "$?" -ne 0 ] ; then + answer_with_testfile "$(gettext "Where is mail binary")" "$DEFAULT_BIN_MAIL" "BIN_MAIL" + else + BIN_MAIL="$BIN_MAIL/mail" + fi + echo_success "$BIN_MAIL" "$ok" + fi + BIN_MAIL=`trim ${BIN_MAIL%/}` + export BIN_MAIL + log "INFO" "BIN_MAIL: $BIN_MAIL" } #---- @@ -1047,14 +1050,14 @@ locate_mail() { ## @Globals PHP_BIN, DEFAULT_PHP_BIN #---- locate_php_bin() { - testfile_clean "$PHP_BIN" "PHP_BIN" - if [ -z "$PHP_BIN" ] ; then - answer_with_testfile "$(gettext "Where is your php binary ? ")" "$DEFAULT_PHP_BIN" "PHP_BIN" - echo_success "$PHP_BIN" "$ok" - fi - PHP_BIN=`trim ${PHP_BIN%/}` - export PHP_BIN - log "INFO" "PHP_BIN: $PHP_BIN" + testfile_clean "$PHP_BIN" "PHP_BIN" + if [ -z "$PHP_BIN" ] ; then + answer_with_testfile "$(gettext "Where is your php binary ? ")" "$DEFAULT_PHP_BIN" "PHP_BIN" + echo_success "$PHP_BIN" "$ok" + fi + PHP_BIN=`trim ${PHP_BIN%/}` + export PHP_BIN + log "INFO" "PHP_BIN: $PHP_BIN" } #---- @@ -1062,15 +1065,15 @@ locate_php_bin() { ## @Globals PEAR_PATH, DEFAULT_PEAR_PATH #---- locate_pear() { - testdir_clean "$PEAR_PATH" "PEAR_PATH" - if [ -z "$PEAR_PATH" ] ; then - answer_with_testfile "$(gettext "Where is PEAR [PEAR.php] ")" "$DEFAULT_PEAR_PATH/PEAR.php" "PEAR_PATH" - PEAR_PATH=$(dirname $PEAR_PATH) - echo_success "$(gettext "Path" ) $PEAR_PATH" "$ok" - fi - PEAR_PATH=`trim ${PEAR_PATH%/}` - export PEAR_PATH - log "INFO" "PEAR_PATH: $PEAR_PATH" + testdir_clean "$PEAR_PATH" "PEAR_PATH" + if [ -z "$PEAR_PATH" ] ; then + answer_with_testfile "$(gettext "Where is PEAR [PEAR.php] ")" "$DEFAULT_PEAR_PATH/PEAR.php" "PEAR_PATH" + PEAR_PATH=$(dirname $PEAR_PATH) + echo_success "$(gettext "Path" ) $PEAR_PATH" "$ok" + fi + PEAR_PATH=`trim ${PEAR_PATH%/}` + export PEAR_PATH + log "INFO" "PEAR_PATH: $PEAR_PATH" } #---- @@ -1078,19 +1081,19 @@ locate_pear() { ## @Globals CRON_D, DEFAULT_CRON_D #---- locate_cron_d() { - testdir_clean "$CRON_D" "CRON_D" - if [ -z "$CRON_D" ] ; then - if [ -d "/etc/cron.d" ] ; then - CRON_D="/etc/cron.d" - # Add most of init.d - else - answer_with_testdir "$(gettext "Where is your cron.d directory ?")" "$DEFAULT_CRON_D" "CRON_D" - echo_success "Path $CRON_D" "$ok" - fi - fi - CRON_D=`trim ${CRON_D%/}` - export CRON_D - log "INFO" "CRON_D: $CRON_D" + testdir_clean "$CRON_D" "CRON_D" + if [ -z "$CRON_D" ] ; then + if [ -d "/etc/cron.d" ] ; then + CRON_D="/etc/cron.d" + # Add most of init.d + else + answer_with_testdir "$(gettext "Where is your cron.d directory ?")" "$DEFAULT_CRON_D" "CRON_D" + echo_success "Path $CRON_D" "$ok" + fi + fi + CRON_D=`trim ${CRON_D%/}` + export CRON_D + log "INFO" "CRON_D: $CRON_D" } #---- @@ -1098,19 +1101,19 @@ locate_cron_d() { ## @Globals LOGROTATE_D, DEFAULT_LOGROTATE_D #---- locate_logrotate_d() { - testdir_clean "$LOGROTATE_D" "LOGROTATE_D" - if [ -z "$LOGROTATE_D" ] ; then - if [ -d "/etc/logrotate.d" ] ; then - LOGROTATE_D="/etc/logrotate.d" - # Add most of init.d - else - answer_with_testdir "$(gettext "Where is your logrotate.d directory ?")" "$DEFAULT_LOGROTATE_D" "LOGROTATE_D" - echo_success "Path $LOGROTATE_D" "$ok" - fi - fi - LOGROTATE_D=`trim ${LOGROTATE_D%/}` - export LOGROTATE_D - log "INFO" "LOGROTATE_D: $LOGROTATE_D" + testdir_clean "$LOGROTATE_D" "LOGROTATE_D" + if [ -z "$LOGROTATE_D" ] ; then + if [ -d "/etc/logrotate.d" ] ; then + LOGROTATE_D="/etc/logrotate.d" + # Add most of init.d + else + answer_with_testdir "$(gettext "Where is your logrotate.d directory ?")" "$DEFAULT_LOGROTATE_D" "LOGROTATE_D" + echo_success "Path $LOGROTATE_D" "$ok" + fi + fi + LOGROTATE_D=`trim ${LOGROTATE_D%/}` + export LOGROTATE_D + log "INFO" "LOGROTATE_D: $LOGROTATE_D" } #---- @@ -1164,18 +1167,18 @@ check_frontend_application() { ## @return 1 False #---- is_single() { - local var="$1" + local var="$1" - local count=0 - for value in $var ; do - let "count += 1" - done + local count=0 + for value in $var ; do + let "count += 1" + done - if [ "$count" -eq 1 ] ; then - return 0 - else - return 1 - fi + if [ "$count" -eq 1 ] ; then + return 0 + else + return 1 + fi } #---- @@ -1188,14 +1191,14 @@ is_single() { ## @Globals line, DIR_APACHE_CONF, LOG_FILE, silent_install #---- configureApache() { - echo -e "\n$line" - echo -e "\t$(gettext "Configure Apache server")" - echo -e "$line" + echo -e "\n$line" + echo -e "\t$(gettext "Configure Apache server")" + echo -e "$line" - local write_config="0" - local dir_conf="$1" - # Generate a apache config in directory - prepare_apache_config "$dir_conf" + local write_config="0" + local dir_conf="$1" + # Generate a apache config in directory + prepare_apache_config "$dir_conf" if [ "$silent_install" -ne 1 ] ; then if [ -e $DIR_APACHE_CONF/centreon.conf ] ; then @@ -1235,47 +1238,144 @@ configureApache() { fi } +#---- +## Copy ssh keys to gorgone and add proper rights +#---- +copy_ssh_keys_to_gorgone() { + if [ ! -d "$GORGONE_VARLIB/.ssh" ] ; then + mkdir -p "$GORGONE_VARLIB/.ssh" + if [ $? -ne 0 ] ; then + echo_failure "$(gettext "Cannot create the subfolder $GORGONE_VARLIB/.ssh")" "$fail" + return 1 + fi + fi + + if [ -z $CENTREON_SPOOL_SSH ] ; then + echo_failure "$(gettext "Cannot find the '.ssh' folder in the $CENTREON_USER home folder")" "$fail" + return 1 + fi + + cp -Rf "$CENTREON_SPOOL_SSH/.ssh" "$GORGONE_VARLIB" + if [ $? -ne 0 ] ; then + echo_failure "$(gettext "Cannot move the SSH keys to $GORGONE_VARLIB/.ssh")" "$fail" + return 1 + fi + + ${CHOWN} -R "$GORGONE_USER:$GORGONE_GROUP" "$GORGONE_VARLIB/.ssh" + if [ $? -ne 0 ] ; then + echo_failure "$(gettext "Cannot modify the owner of the files in $GORGONE_VARLIB/.ssh folder to $GORGONE_USER:$GORGONE_GROUP")" "$fail" + return 1 + fi + + ${CHMOD} 600 "$GORGONE_VARLIB/.ssh/id_rsa" + if [ $? -ne 0 ] ; then + echo_failure "$(gettext "Cannot modify the rights of files in folder $GORGONE_VARLIB/.ssh")" "$fail" + return 1 + fi + + echo_success "$(gettext "Copy SSH keys to $GORGONE_VARLIB/.ssh")" "$ok" + return 0 +} + +#---- +## Create gorgone configuration folders +#---- +create_gorgone_configuration_structure() { + ## check the required gorgone configuration structure + conf_folder="$GORGONE_CONFIG/config.d" + if [ ! -d "$conf_folder" ] ; then + echo_failure "$(gettext "Gorgone configuration folder is missing") $conf_folder" "$fail" + echo_failure "$(gettext "Please reinstall Gorgone service")" "$fail" + return 1 + fi + + # gorgone's config.d/30-centreon.yaml + destination="$conf_folder/30-centreon.yaml" + if [ -e $destination ] ; then + yes_no_default "$(gettext "A configuration file already exists. Do you want to overwrite it ?")" + if [ $? -ne 0 ] ; then + echo_info "$(gettext "If needed, please update") $destination" "$passed" + else + ${CAT} <<- __EOT__ > $destination +name: centreon.yaml +description: Configure Centreon Gorgone to work with Centreon Web. +centreon: !include $CENTREON_ETC/config.d/*.yaml +__EOT__ + + echo_success "$(gettext "Create gorgone's 30-centreon.yaml file")" "$ok" + fi + fi + + ## create the required centreon configuration structure + if [ ! -d "$CENTREON_ETC/config.d" ] ; then + mkdir "$CENTREON_ETC/config.d" + if [ $? -ne 0 ] ; then + echo_failure "$(gettext "Cannot create the subfolder") $CENTREON_ETC/config.d" "$fail" + return 1 + fi + fi + echo_success "$(gettext "Create centreon config folders")" "$ok" + + # centreon's config.yaml + destination="$CENTREON_ETC/config.yaml" + if [ -e $destination ] ; then + yes_no_default "$(gettext "A configuration file already exists. Do you want to overwrite it ?")" + if [ $? -ne 0 ] ; then + echo_info "$(gettext "If needed, please update") $destination" "$passed" + else + ${CAT} <<__EOT__ > $destination +name: config.yaml +description: Configuration for Central server +configuration: !include config.d/*.yaml +__EOT__ + + echo_success "$(gettext "Create centreon config.yaml")" "$ok" + fi + fi + echo_success "$(gettext "Gorgone configuration structure")" "$ok" + return 0 +} + #---- ## Define apache service init script and ask to reload apache ## @return 0 Apache reload OK ## @return 1 Apache reload FAIL #---- reload_service_apache() { - local service="" - log "INFO" "$(gettext "Reloading Apache...")" - if [ -x /etc/init.d/apache ] ; then - service="apache" - elif [ -x /etc/init.d/httpd ] ; then - service="httpd" - elif [ -x /bin/systemctl ] ; then - if [ $(/bin/systemctl list-units | grep httpd24-httpd | wc -l) -gt "0" ] ; then - service="httpd24-httpd" + local service="" + log "INFO" "$(gettext "Reloading Apache...")" + if [ -x /etc/init.d/apache ] ; then + service="apache" + elif [ -x /etc/init.d/httpd ] ; then + service="httpd" + elif [ -x /bin/systemctl ] ; then + if [ $(/bin/systemctl list-units | grep httpd24-httpd | wc -l) -gt "0" ] ; then + service="httpd24-httpd" elif [ $(/bin/systemctl list-units | grep httpd | wc -l) -gt "0" ] ; then - service="httpd" + service="httpd" elif [ $(/bin/systemctl list-units | grep apache2 | wc -l) -gt "0" ] ; then service="apache2" - fi - elif [ -x /etc/init.d/apache2 ] ; then - service="apache2" - elif [ -x /usr/local/etc/rc.d/apache ] ; then - service="apache" - elif [ -x /usr/local/etc/rc.d/apache2 ]; then - service="apache2" - else - echo_warning "$(gettext "Unable to reload Apache server")" "$warning" - log "WARN" "$(gettext "Unable to reload Apache server")" - fi - - log "DEBUG" "$(gettext "use") : $service" - # reload apache service - $SERVICE_BINARY $service reload >> $LOG_FILE 2>&1 - if [ "$?" -eq 0 ] ; then - echo_success "$(gettext "Reloading Apache service")" "$ok" - return 0 - else - echo_failure "$(gettext "Reloading Apache service")" "$fail" - return 1 - fi + fi + elif [ -x /etc/init.d/apache2 ] ; then + service="apache2" + elif [ -x /usr/local/etc/rc.d/apache ] ; then + service="apache" + elif [ -x /usr/local/etc/rc.d/apache2 ]; then + service="apache2" + else + echo_warning "$(gettext "Unable to reload Apache server")" "$warning" + fi + + log "DEBUG" "$(gettext "use") : $service" + # reload apache service + $SERVICE_BINARY $service reload >> $LOG_FILE 2>&1 + if [ "$?" -eq 0 ] ; then + echo_success "$(gettext "Reloading Apache service")" "$ok" + return 0 + else + echo_failure "$(gettext "Reloading Apache service")" "$fail" + return 1 + fi } #---- @@ -1287,10 +1387,10 @@ reload_service_apache() { ## @return 1 create file fail #---- prepare_apache_config() { - local directory="$1" + local directory="$1" - # if INSTALL_DIR_CENTREON not found, ask: - [ -z "$INSTALL_DIR_CENTREON" ] && locate_centreon_installdir + # if INSTALL_DIR_CENTREON not found, ask: + [ -z "$INSTALL_DIR_CENTREON" ] && locate_centreon_installdir # Prepare apache config ${CAT} << __EOT__ > $directory/centreon.apache.conf @@ -1337,12 +1437,12 @@ RedirectMatch ^/$ /centreon __EOT__ - if [ -e $directory/centreon.apache.conf ] ; then - return 0 - else - log "INFO" "$(gettext "Problem when I generate an apache configuration")" - return 1 - fi + if [ -e $directory/centreon.apache.conf ] ; then + return 0 + else + log "INFO" "$(gettext "Problem when generating apache configuration")" + return 1 + fi } #---- @@ -1364,11 +1464,11 @@ check_php_fpm_directory() { answer_with_testdir "$(gettext "Where is your PHP FPM conf.d directory")" "NO_DEFAULT" "DIR_PHP_FPM_CONF" fi fi - DIR_PHP_FPM_CONF=${DIR_PHP_FPM_CONF%/} - export DIR_PHP_FPM_CONF - log "INFO" "DIR_PHP_FPM_CONF: $DIR_PHP_FPM_CONF" + DIR_PHP_FPM_CONF=${DIR_PHP_FPM_CONF%/} + export DIR_PHP_FPM_CONF + log "INFO" "DIR_PHP_FPM_CONF: $DIR_PHP_FPM_CONF" - return 0 + return 0 } #---- @@ -1377,52 +1477,52 @@ check_php_fpm_directory() { #---- configure_php_fpm() { echo -e "\n$line" - echo -e "\t$(gettext "Configure PHP FPM service")" - echo -e "$line" - - local write_config="0" - local dir_conf="$1" - # Generate a apache config in directory - prepare_php_fpm_config "$dir_conf" - - if [ "$silent_install" -ne 1 ] ; then - if [ -e $DIR_PHP_FPM_CONF/centreon.conf ] ; then - echo "$(gettext "Finding PHP FPM Centreon configuration file")" - echo_success "'$DIR_PHP_FPM_CONF/centreon.conf' :" "$ok" - yes_no_default "$(gettext "Do you want to update Centreon PHP FPM sub configuration file ?")" + echo -e "\t$(gettext "Configure PHP FPM service")" + echo -e "$line" + + local write_config="0" + local dir_conf="$1" + # Generate a apache config in directory + prepare_php_fpm_config "$dir_conf" + + if [ "$silent_install" -ne 1 ] ; then + if [ -e $DIR_PHP_FPM_CONF/centreon.conf ] ; then + echo "$(gettext "Finding PHP FPM Centreon configuration file")" + echo_success "'$DIR_PHP_FPM_CONF/centreon.conf' :" "$ok" + yes_no_default "$(gettext "Do you want to update Centreon PHP FPM sub configuration file ?")" if [ "$?" -eq 0 ] ; then write_config="1" cp -f $DIR_PHP_FPM_CONF/centreon.conf $DIR_PHP_FPM_CONF/centreon.conf-bak >> $LOG_FILE 2>&1 echo_info "$(gettext "Backup Centreon PHP FPM configuration completed")" fi - else - yes_no_default "$(gettext "Do you want to add Centreon PHP FPM sub configuration file ?")" - [ "$?" -eq 0 ] && write_config="1" - fi - else - write_config="1" + else + yes_no_default "$(gettext "Do you want to add Centreon PHP FPM sub configuration file ?")" + [ "$?" -eq 0 ] && write_config="1" + fi + else + write_config="1" fi - if [ "$write_config" -eq 1 ] ; then - dir_test_create "$CENTREON_VARLIB/sessions" + if [ "$write_config" -eq 1 ] ; then + dir_test_create "$CENTREON_VARLIB/sessions" if [ "$upgrade" -eq 1 ] ; then cp -f $dir_conf/centreon.php-fpm.conf $DIR_PHP_FPM_CONF/centreon.conf.new >> $LOG_FILE 2>&1 else cp -f $dir_conf/centreon.php-fpm.conf $DIR_PHP_FPM_CONF/centreon.conf >> $LOG_FILE 2>&1 fi - echo_success "$(gettext "Create") '$DIR_PHP_FPM_CONF/centreon.conf'" "$ok" - echo_success "$(gettext "Configuring PHP FPM")" "$ok" - - # Reload php-fpm ? - if [ "${PHP_FPM_RELOAD:-0}" -eq 0 ] ; then - yes_no_default "$(gettext "Do you want to reload PHP FPM service ?")" - [ $? -eq 0 ] && reload_service_php_fpm - elif [ "${PHP_FPM_RELOAD:-0}" -eq 1 ] ; then - reload_service_php_fpm - fi - else - echo_info "$(gettext "Please configure PHP FPM with this example"):\n $dir_conf/centreon.php-fpm.conf" - fi + echo_success "$(gettext "Create") '$DIR_PHP_FPM_CONF/centreon.conf'" "$ok" + echo_success "$(gettext "Configuring PHP FPM")" "$ok" + + # Reload php-fpm ? + if [ "${PHP_FPM_RELOAD:-0}" -eq 0 ] ; then + yes_no_default "$(gettext "Do you want to reload PHP FPM service ?")" + [ $? -eq 0 ] && reload_service_php_fpm + elif [ "${PHP_FPM_RELOAD:-0}" -eq 1 ] ; then + reload_service_php_fpm + fi + else + echo_info "$(gettext "Please configure PHP FPM with this example"):\n $dir_conf/centreon.php-fpm.conf" + fi } #---- @@ -1430,10 +1530,10 @@ configure_php_fpm() { ## @Globals INSTALL_DIR_CENTREON #---- prepare_php_fpm_config() { - local directory="$1" + local directory="$1" - # if INSTALL_DIR_CENTREON not found, ask: - [ -z "$INSTALL_DIR_CENTREON" ] && locate_centreon_installdir + # if INSTALL_DIR_CENTREON not found, ask: + [ -z "$INSTALL_DIR_CENTREON" ] && locate_centreon_installdir # Prepare apache config ${CAT} << __EOT__ > $directory/centreon.php-fpm.conf @@ -1457,7 +1557,7 @@ __EOT__ if [ -e $directory/centreon.php-fpm.conf ] ; then return 0 else - log "INFO" "$(gettext "Problem when I generate an PHP FPM configuration")" + log "INFO" "$(gettext "Problem when generating PHP FPM configuration")" return 1 fi } @@ -1467,8 +1567,8 @@ __EOT__ #---- reload_service_php_fpm() { local service_reloaded=0 - log "INFO" "$(gettext "Reloading PHP FPM...")" - if [ -x /bin/systemctl ] ; then + log "INFO" "$(gettext "Reloading PHP FPM...")" + if [ -x /bin/systemctl ] ; then local php_fpm_service=$(/bin/systemctl list-units | grep php | grep fpm | cut -f 1 -d " ") if [ ! -z "$php_fpm_service" ] ; then /bin/systemctl reload $php_fpm_service >> $LOG_FILE 2>&1 @@ -1477,14 +1577,13 @@ reload_service_php_fpm() { service_reloaded=1 else echo_failure "$(gettext "Reloading PHP FPM service")" "$fail" - fi + fi fi - fi + fi - if [ "$service_reloaded" -eq 0 ] ; then - echo_warning "$(gettext "Unable to reload PHP FPM service")" "$warning" - log "WARN" "$(gettext "Unable to reload PHP FPM service")" - fi + if [ "$service_reloaded" -eq 0 ] ; then + echo_warning "$(gettext "Unable to reload PHP FPM service")" "$warning" + fi } #---- @@ -1499,15 +1598,15 @@ reload_service_php_fpm() { ## @Globals MONITORINGENGINE_BINARY, INIT_D, WEB_USER #---- prepare_sudo_config() { - local directory="$1" + local directory="$1" locate_sudo - # find nagios binary if not define - [ -z "$MONITORINGENGINE_BINARY" ] && answer_with_testfile "$(gettext "What is the Monitoring engine binary ?") [$DEFAULT_MONITORINGENGINE_BINARY]" "$DEFAULT_MONITORINGENGINE_BINARY" "MONITORINGENGINE_BINARY" - [ -z "$MONITORINGENGINE_ETC" ] && locate_monitoringengine_etc - [ -z "$BROKER_ETC" ] && locate_broker_etc - [ -z "$SERVICE_BINARY" ] && answer_with_testfile "$(gettext "Where is your service command binary ?")" "$(which service)" "SERVICE_BINARY" - # Prepare sudo.conf + # find nagios binary if not define + [ -z "$MONITORINGENGINE_BINARY" ] && answer_with_testfile "$(gettext "What is the Monitoring engine binary ?") [$DEFAULT_MONITORINGENGINE_BINARY]" "$DEFAULT_MONITORINGENGINE_BINARY" "MONITORINGENGINE_BINARY" + [ -z "$MONITORINGENGINE_ETC" ] && locate_monitoringengine_etc + [ -z "$BROKER_ETC" ] && locate_broker_etc + [ -z "$SERVICE_BINARY" ] && answer_with_testfile "$(gettext "Where is your service command binary ?")" "$(which service)" "SERVICE_BINARY" + # Prepare sudo.conf ${CAT} <<- __EOT__ > $directory/centreon.sudo ## BEGIN: CENTREON SUDO @@ -1537,12 +1636,12 @@ CENTREON ALL = NOPASSWD: $SERVICE_BINARY cbd reload ## END: CENTREON SUDO __EOT__ - if [ -e $directory/centreon.sudo ] ; then - return 0 - else - log "INFO" "$(gettext "Problem when I generate a sudo configuration")" - return 1 - fi + if [ -e $directory/centreon.sudo ] ; then + return 0 + else + log "INFO" "$(gettext "Problem when generating sudo configuration")" + return 1 + fi } #---- @@ -1553,15 +1652,15 @@ __EOT__ ## @return 1 possible problem in sudo file #---- is_suspect_conf_sudo() { - local sudo_file="$1" - ${GREP} -e "^Defaults.*requiretty$" $sudo_file >> $LOG_FILE 2>&1 - if [ "$?" -eq 0 ] ; then - echo_warning "$(gettext "I think you'll have a problem with\n'Default requiretty' in sudo file")" - echo -e "$(gettext "Press enter to continue.")" - read - return 1 - fi - return 0 + local sudo_file="$1" + ${GREP} -e "^Defaults.*requiretty$" $sudo_file >> $LOG_FILE 2>&1 + if [ "$?" -eq 0 ] ; then + echo_warning "$(gettext "I think you'll have a problem with\n'Default requiretty' in sudo file")" + echo -e "$(gettext "Press enter to continue.")" + read + return 1 + fi + return 0 } #---- @@ -1573,49 +1672,49 @@ is_suspect_conf_sudo() { ## @return 0 end #---- configureSUDO() { - echo -e "\n$line" - echo -e "\t$(gettext "Configure Sudo")" - echo -e "$line" - local no_force_sudo="0" - local dir_conf="$1" - # Generate a sudo config in directory - prepare_sudo_config "$dir_conf" - - # Try to detect old configuration - sudo=`${GREP} -e "CENTREON SUDO" $SUDO_FILE > /dev/null 2>&1 ; echo $?` - if [ $sudo -eq 1 ]; then - echo_info "$(gettext "Your sudo is not configured")" - - if [ "${FORCE_SUDO_CONF:-0}" -eq 1 ] ; then - no_force_sudo="0" - else - yes_no_default "$(gettext "Do you want me to configure your sudo ? (WARNING) ")" - no_force_sudo="$?" - fi - if [ $no_force_sudo -eq 0 ] ; then - ${CAT} $dir_conf/centreon.sudo >> $SUDO_FILE - echo_success "$(gettext "Configuring Sudo")" "$ok" - else - echo_passed "$(gettext "Please configure your sudo with this example"):\n\t $dir_conf/centreon.sudo" "$passed" - fi - else - echo_info "$(gettext "Your sudo has been configured previously")" - if [ "${FORCE_SUDO_CONF:-0}" -eq 1 ] ; then - no_force_sudo="0" - else - yes_no_default "$(gettext "Do you want me to reconfigure your sudo ? (WARNING) ")" - no_force_sudo="$?" - fi - if [ $no_force_sudo -eq 0 ] ; then - clean_sudo $SUDO_FILE 0 - ${CAT} $dir_conf/centreon.sudo >> $SUDO_FILE - echo_success "$(gettext "Configuring Sudo")" "$ok" - else - echo_passed "$(gettext "Please configure your sudo with this example"):\n\t $dir_conf/centreon.sudo" "$passed" - fi - fi - log "INFO" "$(gettext "Please configure your sudo with this example"): $dir_conf/centreon.sudo" - return 0 + echo -e "\n$line" + echo -e "\t$(gettext "Configure Sudo")" + echo -e "$line" + local no_force_sudo="0" + local dir_conf="$1" + # Generate a sudo config in directory + prepare_sudo_config "$dir_conf" + + # Try to detect old configuration + sudo=`${GREP} -e "CENTREON SUDO" $SUDO_FILE > /dev/null 2>&1 ; echo $?` + if [ $sudo -eq 1 ]; then + echo_info "$(gettext "Your sudo is not configured")" + + if [ "${FORCE_SUDO_CONF:-0}" -eq 1 ] ; then + no_force_sudo="0" + else + yes_no_default "$(gettext "Do you want to configure your sudo ? (WARNING) ")" + no_force_sudo="$?" + fi + if [ $no_force_sudo -eq 0 ] ; then + ${CAT} $dir_conf/centreon.sudo >> $SUDO_FILE + echo_success "$(gettext "Configuring Sudo")" "$ok" + else + echo_passed "$(gettext "Please configure your sudo with this example"):\n\t $dir_conf/centreon.sudo" "$passed" + fi + else + echo_info "$(gettext "Your sudo has been configured previously")" + if [ "${FORCE_SUDO_CONF:-0}" -eq 1 ] ; then + no_force_sudo="0" + else + yes_no_default "$(gettext "Do you want to reconfigure your sudo ? (WARNING) ")" + no_force_sudo="$?" + fi + if [ $no_force_sudo -eq 0 ] ; then + clean_sudo $SUDO_FILE 0 + ${CAT} $dir_conf/centreon.sudo >> $SUDO_FILE + echo_success "$(gettext "Configuring Sudo")" "$ok" + else + echo_passed "$(gettext "Please configure your sudo with this example"):\n\t $dir_conf/centreon.sudo" "$passed" + fi + fi + log "INFO" "$(gettext "Please configure your sudo using this example"): $dir_conf/centreon.sudo" + return 0 } #---- @@ -1626,13 +1725,13 @@ configureSUDO() { ## @Globals CENTREON_USER, BIN_MAIL #---- createConfFile() { - echo -e "\n$line" - echo -e "\t\t$(gettext "Centreon Post Install")" - echo -e "$line" + echo -e "\n$line" + echo -e "\t\t$(gettext "Centreon Post Install")" + echo -e "$line" - INSTALL_DIR_CENTREON_CONF="$INSTALL_DIR_CENTREON/www/install/install.conf.php" - # Reinit file if exist - touch $INSTALL_DIR_CENTREON_CONF + INSTALL_DIR_CENTREON_CONF="$INSTALL_DIR_CENTREON/www/install/install.conf.php" + # Reinit file if exist + touch $INSTALL_DIR_CENTREON_CONF ${CAT} << __EOT__ > $INSTALL_DIR_CENTREON_CONF " >> $INSTALL_DIR_CENTREON_CONF - log "INFO" "$(gettext "Change right on") : $INSTALL_DIR_CENTREON_CONF" - ${CHOWN} $WEB_USER:$WEB_GROUP $INSTALL_DIR_CENTREON_CONF >> $LOG_FILE 2>&1 - echo_success "Create $INSTALL_DIR_CENTREON_CONF" "OK" + echo "?>" >> $INSTALL_DIR_CENTREON_CONF + log "INFO" "$(gettext "Change rights on") : $INSTALL_DIR_CENTREON_CONF" + ${CHOWN} $WEB_USER:$WEB_GROUP $INSTALL_DIR_CENTREON_CONF >> $LOG_FILE 2>&1 + echo_success "Create $INSTALL_DIR_CENTREON_CONF" "OK" } #---- @@ -1746,8 +1845,8 @@ createCentreonInstallConf() { CENTREON_PLUGINS=$CENTREON_PLUGINS __EOT__ - echo_success "Create $CENTREON_ETC/instCentWeb.conf " "OK" - return 0 + echo_success "Create $CENTREON_ETC/instCentWeb.conf " "OK" + return 0 } #--- @@ -1775,36 +1874,8 @@ createCentStorageInstallConf() { CENTREON_GROUP=$CENTREON_GROUP __EOT__ - echo_success "Create $CENTREON_ETC/instCentStorage.conf " "OK" - return 0 -} - -#--- -## Create a config file for CentCore -## This file will use for upgrade process -## @Globals CENTREON_ETC, INSTALL_DIR_CENTREON, CENTREON_LOG, CENTREON_ETC -## @Globals CENTREON_RUNDIR, CENTSTORAGE_RRD, CENTSTORAGE_BINDIR -## @Globals NAGIOS_USER, NAGIOS_GROUP, RRD_PERL, CRON_D, INIT_D -#---- -createCentCoreInstallConf() { - ${CAT} <<- __EOT__ > $CENTREON_ETC/instCentCore.conf - INSTALL_DIR_CENTREON=$INSTALL_DIR_CENTREON - CENTREON_ETC=$CENTREON_ETC - CENTREON_RUNDIR=$CENTREON_RUNDIR - CENTREON_LOG=$CENTREON_LOG - CENTREON_VARLIB=$CENTREON_VARLIB - CENTREON_CACHEDIR=$CENTREON_CACHEDIR - CENTCORE_BINDIR=$CENTCORE_BINDIR - BIN_SSH=$BIN_SSH - BIN_SCP=$BIN_SCP - CENTREON_GROUP=$CENTREON_GROUP - CENTREON_USER=$CENTREON_USER - RRD_PERL=$RRD_PERL - INIT_D=$INIT_D - __EOT__ - - echo_success "Create $CENTREON_ETC/instCentCore.conf " "OK" - return 0 + echo_success "Create $CENTREON_ETC/instCentStorage.conf " "OK" + return 0 } #--- @@ -1834,8 +1905,8 @@ createCentPluginsInstallConf() { MONITORINGENGINE_USER=$MONITORINGENGINE_USER __EOT__ - echo_success "Create $CENTREON_ETC/instCentPlugins.conf " "OK" - return 0 + echo_success "Create $CENTREON_ETC/instCentPlugins.conf " "OK" + return 0 } #--- @@ -1859,8 +1930,8 @@ createCentPluginsForTrapdInstallConf() { CENTREON_LOG=$CENTREON_LOG __EOT__ - echo_success "Create $CENTREON_ETC/instCentPlugins.conf " "OK" - return 0 + echo_success "Create $CENTREON_ETC/instCentPlugins.conf " "OK" + return 0 } #---- @@ -1868,8 +1939,7 @@ createCentPluginsForTrapdInstallConf() { ## @return 0 ## @Globals DIR_APACHE, DIR_APACHE_CONF, APACHE_CONF #---- -check_httpd_directory() -{ +check_httpd_directory() { if [ -z "$DIR_APACHE" -o -z "$DIR_APACHE_CONF" ] ; then if [ -d /opt/rh/httpd24/root/etc/httpd/conf ] ; then DIR_APACHE="/opt/rh/httpd24/root/etc/httpd/conf" @@ -1915,208 +1985,241 @@ check_httpd_directory() answer_with_testdir "$(gettext "Where is your Apache conf.d directory")" "NO_DEFAULT" "DIR_APACHE_CONF" fi fi - DIR_APACHE=${DIR_APACHE%/} - export DIR_APACHE - DIR_APACHE_CONF=${DIR_APACHE_CONF%/} - export DIR_APACHE_CONF - log "INFO" "DIR_APACHE: $DIR_APACHE" - log "INFO" "DIR_APACHE_CONF: $DIR_APACHE_CONF" - - if [ -z "$APACHE_CONF" ] ; then - if [ -e $DIR_APACHE/apache2.conf ] ; then - APACHE_CONF="apache2.conf" - elif [ -e $DIR_APACHE/apache.conf ] ; then - APACHE_CONF="apache.conf" - elif [ -e $DIR_APACHE/commondhttpd.conf ] ; then - APACHE_CONF="commondhttpd.conf" - elif [ -e $DIR_APACHE/httpd.conf ] ; then - APACHE_CONF="httpd.conf" - else - echo_passed "$(gettext "Apache config file not found")" "$critical" - answer_with_testfile "$(gettext "Where is your Apache config file")" "NO_DEFAULT" "APACHE_CONF" - fi - fi - APACHE_CONF=${APACHE_CONF%/} - export APACHE_CONF - log "INFO" "APACHE_CONF: $APACHE_CONF" - return 0 + DIR_APACHE=${DIR_APACHE%/} + export DIR_APACHE + DIR_APACHE_CONF=${DIR_APACHE_CONF%/} + export DIR_APACHE_CONF + log "INFO" "DIR_APACHE: $DIR_APACHE" + log "INFO" "DIR_APACHE_CONF: $DIR_APACHE_CONF" + + if [ -z "$APACHE_CONF" ] ; then + if [ -e $DIR_APACHE/apache2.conf ] ; then + APACHE_CONF="apache2.conf" + elif [ -e $DIR_APACHE/apache.conf ] ; then + APACHE_CONF="apache.conf" + elif [ -e $DIR_APACHE/commondhttpd.conf ] ; then + APACHE_CONF="commondhttpd.conf" + elif [ -e $DIR_APACHE/httpd.conf ] ; then + APACHE_CONF="httpd.conf" + else + echo_passed "$(gettext "Apache config file not found")" "$critical" + answer_with_testfile "$(gettext "Where is your Apache config file")" "NO_DEFAULT" "APACHE_CONF" + fi + fi + APACHE_CONF=${APACHE_CONF%/} + export APACHE_CONF + log "INFO" "APACHE_CONF: $APACHE_CONF" + return 0 } #---- ## Find Apache user ## @Globals WEB_USER, DIR_APACHE, APACHE_CONF #---- -check_user_apache() -{ - # init WEB_USER if not define - WEB_USER="$WEB_USER" - - if [ -n "$WEB_USER" ] ; then - echo_info "$(gettext "Finding Apache user") :" "$WEB_USER" - return 0 - fi - local found=0 - if [ -e /etc/apache2/envvars ] ; then - log "INFO" "$(gettext "Use envvars file for apache user")" - # for Debian system (lenny) - WEB_USER=`${CAT} /etc/apache2/envvars |${GREP} "USER" | cut -d= -f2` - if [ -z "$WEB_USER" ] ; then - found=0 - else - found=1 - fi - elif [ -e /etc/apache2/uid.conf ] ; then - log "INFO" "$(gettext "Use uid.conf file for apache user")" - # for SuSe system - WEB_USER=`${CAT} /etc/apache2/uid.conf |${GREP} -e "^User" | cut -d" " -f2` - if [ -z "$WEB_USER" ] ; then - found=0 - else - found=1 - fi - fi - if [ "$found" -eq 0 ] ; then - WEB_USER=`${CAT} $DIR_APACHE/$APACHE_CONF | ${GREP} -e "^User" | cut -d" " -f2` - if [ -z "$WEB_USER" ] ; then - local WEB_USER_TEMP="" - for fichier in $DIR_APACHE/* - do - if [ -f "$fichier" ] ; then - log "INFO" "$(gettext "check apache user in") : $fichier" - WEB_USER_TEMP=`${CAT} $fichier | ${GREP} -e "^User" | cut -d" " -f2` - if [ -n "$WEB_USER_TEMP" ] ; then - log "INFO" "$(gettext "found apache user in") : $fichier" - WEB_USER=$WEB_USER_TEMP - fi - fi - done - fi - fi - echo_info "$(gettext "Finding Apache user") :" "$WEB_USER" - return 0 +check_user_apache() { + # init WEB_USER if not define + WEB_USER="$WEB_USER" + + if [ -n "$WEB_USER" ] ; then + echo_info "$(gettext "Finding Apache user") :" "$WEB_USER" + return 0 + fi + local found=0 + if [ -e /etc/apache2/envvars ] ; then + log "INFO" "$(gettext "Use envvars file for apache user")" + # for Debian system (lenny) + WEB_USER=`${CAT} /etc/apache2/envvars |${GREP} "USER" | cut -d= -f2` + if [ -z "$WEB_USER" ] ; then + found=0 + else + found=1 + fi + elif [ -e /etc/apache2/uid.conf ] ; then + log "INFO" "$(gettext "Use uid.conf file for apache user")" + # for SuSe system + WEB_USER=`${CAT} /etc/apache2/uid.conf |${GREP} -e "^User" | cut -d" " -f2` + if [ -z "$WEB_USER" ] ; then + found=0 + else + found=1 + fi + fi + if [ "$found" -eq 0 ] ; then + WEB_USER=`${CAT} $DIR_APACHE/$APACHE_CONF | ${GREP} -e "^User" | cut -d" " -f2` + if [ -z "$WEB_USER" ] ; then + local WEB_USER_TEMP="" + for fichier in $DIR_APACHE/* + do + if [ -f "$fichier" ] ; then + log "INFO" "$(gettext "check apache user in") : $fichier" + WEB_USER_TEMP=`${CAT} $fichier | ${GREP} -e "^User" | cut -d" " -f2` + if [ -n "$WEB_USER_TEMP" ] ; then + log "INFO" "$(gettext "found apache user in") : $fichier" + WEB_USER=$WEB_USER_TEMP + fi + fi + done + fi + fi + echo_info "$(gettext "Finding Apache user") :" "$WEB_USER" + return 0 } #---- ## Find Apache group ## @Globals WEB_GROUP, DIR_APACHE, APACHE_CONF #---- -check_group_apache() -{ - # init WEB_GROUP if not define - WEB_GROUP="$WEB_GROUP" - - if [ -n "$WEB_GROUP" ] ; then - echo_info "$(gettext "Finding Apache group") :" "$WEB_GROUP" - return 0 - fi - local found=0 - if [ -e /etc/apache2/envvars ] ; then - # for debian system - WEB_GROUP=`${CAT} /etc/apache2/envvars |${GREP} "GROUP" |cut -d= -f2` - if [ -z "$WEB_GROUP" ] ; then - found=0 - else - found=1 - fi - elif [ -e /etc/apache2/uid.conf ] ; then - # for SuSe system - WEB_GROUP=`${CAT} /etc/apache2/uid.conf |${GREP} -e "^Group" | cut -d" " -f2` - if [ -z "$WEB_GROUP" ] ; then - found=0 - else - found=1 - fi - fi - if [ "$found" -eq 0 ] ; then - WEB_GROUP=`${CAT} $DIR_APACHE/$APACHE_CONF | ${GREP} -e "^Group" | cut -d" " -f2` - if [ -z "$WEB_GROUP" ] ; then - local WEB_GROUP_TMP="" - for fichier in $DIR_APACHE/* - do - if [ -f "$fichier" ]; then - WEB_GROUP_TEMP=`${CAT} $fichier | ${GREP} -e "^Group" | cut -d" " -f2` - if [ -n "$WEB_GROUP_TEMP" ]; then - WEB_GROUP=$WEB_GROUP_TEMP - fi - fi - done - fi - fi - echo_info "$(gettext "Finding Apache group") :" "$WEB_GROUP" - return 0 +check_group_apache() { + # init WEB_GROUP if not define + WEB_GROUP="$WEB_GROUP" + + if [ -n "$WEB_GROUP" ] ; then + echo_info "$(gettext "Finding Apache group") :" "$WEB_GROUP" + return 0 + fi + local found=0 + if [ -e /etc/apache2/envvars ] ; then + # for debian system + WEB_GROUP=`${CAT} /etc/apache2/envvars |${GREP} "GROUP" |cut -d= -f2` + if [ -z "$WEB_GROUP" ] ; then + found=0 + else + found=1 + fi + elif [ -e /etc/apache2/uid.conf ] ; then + # for SuSe system + WEB_GROUP=`${CAT} /etc/apache2/uid.conf |${GREP} -e "^Group" | cut -d" " -f2` + if [ -z "$WEB_GROUP" ] ; then + found=0 + else + found=1 + fi + fi + if [ "$found" -eq 0 ] ; then + WEB_GROUP=`${CAT} $DIR_APACHE/$APACHE_CONF | ${GREP} -e "^Group" | cut -d" " -f2` + if [ -z "$WEB_GROUP" ] ; then + local WEB_GROUP_TMP="" + for fichier in $DIR_APACHE/* + do + if [ -f "$fichier" ]; then + WEB_GROUP_TEMP=`${CAT} $fichier | ${GREP} -e "^Group" | cut -d" " -f2` + if [ -n "$WEB_GROUP_TEMP" ]; then + WEB_GROUP=$WEB_GROUP_TEMP + fi + fi + done + fi + fi + echo_info "$(gettext "Finding Apache group") :" "$WEB_GROUP" + return 0 } #---- ## Ask for centreon user ## @Globals CENTREON_USER, DEFAULT_CENTREON_USER #---- -check_centreon_user() -{ - local groups="$CENTREON_GROUP" - local description="Centreon Web user" - local home="$CENTREON_VARLIB" - if [ -n "$CENTREON_USER" ] ; then - user_test "$CENTREON_USER" - if [ $? -ne 0 ] ; then - user_create "$CENTREON_USER" "$groups" "$description" "$home" - if [ $? -ne 0 ] ; then - CENTREON_USER="" - fi - fi - fi - if [ -z "$CENTREON_USER" ] ; then - answer_with_createuser "$(gettext "What is the Centreon user ?") [$DEFAULT_CENTREON_USER]" "$DEFAULT_CENTREON_USER" "CENTREON_USER" "$groups" "$description" "$home" - fi - log "INFO" "$(gettext "Centreon user") : $CENTREON_USER" - return 0 +check_centreon_user() { + local groups="$CENTREON_GROUP" + local description="Centreon Web user" + local home="$CENTREON_VARLIB" + if [ -n "$CENTREON_USER" ] ; then + user_test "$CENTREON_USER" + if [ $? -ne 0 ] ; then + user_create "$CENTREON_USER" "$groups" "$description" "$home" + if [ $? -ne 0 ] ; then + CENTREON_USER="" + fi + fi + fi + if [ -z "$CENTREON_USER" ] ; then + answer_with_createuser "$(gettext "What is the Centreon user ?") [$DEFAULT_CENTREON_USER]" "$DEFAULT_CENTREON_USER" "CENTREON_USER" "$groups" "$description" "$home" + fi + log "INFO" "$(gettext "Centreon user") : $CENTREON_USER" + return 0 } #---- ## Ask for centreon user, and create it if not exists ## @Globals CENTREON_GROUP, DEFAULT_CENTREON_GROUP #---- -check_centreon_group() -{ - if [ -n "$CENTREON_GROUP" ] ; then - group_test "$CENTREON_GROUP" - if [ $? -ne 0 ] ; then - group_create "$CENTREON_GROUP" - if [ $? -ne 0 ] ; then - CENTREON_GROUP="" - fi - fi - fi - if [ -z "$CENTREON_GROUP" ] ; then - answer_with_creategroup "$(gettext "What is the Centreon group ?") [$DEFAULT_CENTREON_GROUP]" "$DEFAULT_CENTREON_GROUP" "CENTREON_GROUP" - fi - log "INFO" "$(gettext "Centreon group") : $CENTREON_GROUP" - return 0 +check_centreon_group() { + if [ -n "$CENTREON_GROUP" ] ; then + group_test "$CENTREON_GROUP" + if [ $? -ne 0 ] ; then + group_create "$CENTREON_GROUP" + if [ $? -ne 0 ] ; then + CENTREON_GROUP="" + fi + fi + fi + if [ -z "$CENTREON_GROUP" ] ; then + answer_with_creategroup "$(gettext "What is the Centreon group ?") [$DEFAULT_CENTREON_GROUP]" "$DEFAULT_CENTREON_GROUP" "CENTREON_GROUP" + fi + log "INFO" "$(gettext "Centreon group") : $CENTREON_GROUP" + return 0 } #---- ## Ask for Centreon Engine user. ## @Globals MONITORINGENGINE_USER #---- -check_engine_user() -{ - if [ -z "${MONITORINGENGINE_USER}" ]; then - answer_with_testuser "$(gettext "What is the Monitoring engine user ?") [$DEFAULT_MONITORINGENGINE_USER]" "$DEFAULT_MONITORINGENGINE_USER" "MONITORINGENGINE_USER" - fi - log "INFO" "$(gettext "Monitoring engine user") : $MONITORINGENGINE_USER" - return 0 +check_engine_user() { + if [ -z "${MONITORINGENGINE_USER}" ]; then + answer_with_testuser "$(gettext "What is the Monitoring engine user ?") [$DEFAULT_MONITORINGENGINE_USER]" "$DEFAULT_MONITORINGENGINE_USER" "MONITORINGENGINE_USER" + fi + log "INFO" "$(gettext "Monitoring engine user") : $MONITORINGENGINE_USER" + return 0 } #---- ## Ask for Centreon Broker user. ## @Globals BROKER_USER #---- -check_broker_user() -{ - if [ -z "${BROKER_USER}" ]; then - answer_with_testuser "$(gettext "What is the Broker user ?") [$DEFAULT_BROKER_USER]" "$DEFAULT_BROKER_USER" "BROKER_USER" - fi - log "INFO" "$(gettext "Broker user") : $BROKER_USER" - return 0 +check_broker_user() { + if [ -z "${BROKER_USER}" ]; then + answer_with_testuser "$(gettext "What is the Broker user ?") [$DEFAULT_BROKER_USER]" "$DEFAULT_BROKER_USER" "BROKER_USER" + fi + log "INFO" "$(gettext "Broker user") : $BROKER_USER" + return 0 +} + + +#---- +## Ask for gorgone user +## @Globals GORGONE_USER, DEFAULT_GORGONE_USER +#---- +check_gorgone_user() { + local groups="$GORGONE_GROUP" + local description="Centreon Gorgone user" + if [ -n "$GORGONE_USER" ] ; then + user_test "$GORGONE_USER" + fi + if [ -z "$GORGONE_USER" ] ; then + answer_with_testuser "$(gettext "What is the Gorgone user ?") [$DEFAULT_GORGONE_USER]" "$DEFAULT_GORGONE_USER" "GORGONE_USER" + fi + log "INFO" "$(gettext "Gorgone user") : $GORGONE_USER" + return 0 +} + +#---- +## Ask for gorgone group, and create it if not exists +## @Globals GORGONE_GROUP, DEFAULT_GORGONE_GROUP +#---- +check_gorgone_group() { + if [ -n "$GORGONE_GROUP" ] ; then + group_test "$GORGONE_GROUP" + if [ $? -ne 0 ] ; then + group_create "$GORGONE_GROUP" + if [ $? -ne 0 ] ; then + GORGONE_GROUP="" + fi + fi + fi + if [ -z "$GORGONE_GROUP" ] ; then + answer_with_creategroup "$(gettext "What is the Gorgone group ?") [$DEFAULT_GORGONE_GROUP]" "$DEFAULT_GORGONE_GROUP" "GORGONE_GROUP" + fi + log "INFO" "$(gettext "Centreon group") : $GORGONE_GROUP" + return 0 } #---- @@ -2124,23 +2227,22 @@ check_broker_user() ## Copy Source directory and prepare work and final ## @Globals TMP_DIR #---- -copyInTempFile() -{ - local srclistcp="bin cron config logrotate GPL_LIB lang lib snmptrapd src vendor www api libinstall .env .env.local.php bootstrap.php container.php composer.json package.json package-lock.json" - # Prepare centreon Plugins - echo "$(gettext "Preparing Centreon temporary files")" - if [ -d $TMP_DIR ] ; then - echo_passed "$TMP_DIR $(gettext "exists, it will be moved...")" - mv $TMP_DIR $TMP_DIR.`date +%Y%m%d-%k%m%S` - fi - mkdir -p $TMP_DIR/src - mkdir -p $TMP_DIR/work - mkdir -p $TMP_DIR/final +copyInTempFile() { + local srclistcp="bin cron config logrotate GPL_LIB lang lib snmptrapd src vendor www api libinstall .env .env.local.php bootstrap.php container.php composer.json package.json package-lock.json" + # Prepare centreon Plugins + echo "$(gettext "Preparing Centreon temporary files")" + if [ -d $TMP_DIR ] ; then + echo_passed "$TMP_DIR $(gettext "exists, it will be moved...")" + mv $TMP_DIR $TMP_DIR.`date +%Y%m%d-%k%m%S` + fi + mkdir -p "$TMP_DIR/src" + mkdir -p "$TMP_DIR/work" + mkdir -p "$TMP_DIR/final" - for folder in $srclistcp ; do - log "INFO" "$(gettext "Copy") $BASE_DIR/$folder $TMP_DIR/src/" - cp -Rf $BASE_DIR/$folder $TMP_DIR/src/ - done + for folder in $srclistcp ; do + log "INFO" "$(gettext "Copy") $BASE_DIR/$folder $(gettext "to") $TMP_DIR/src/" + cp -Rf $BASE_DIR/$folder $TMP_DIR/src/ + done } #---- @@ -2150,10 +2252,10 @@ copyInTempFile() ## @Globals PHP_BIN, INSTALL_DIR #---- check_pear_module() { - local module_list=$1 - echo -e "$(gettext "Check PEAR modules")" - $PHP_BIN $INSTALL_DIR/check_pear.php check $module_list - return "$?" + local module_list=$1 + echo -e "$(gettext "Check PEAR modules")" + $PHP_BIN $INSTALL_DIR/check_pear.php check $module_list + return "$?" } #---- @@ -2163,10 +2265,10 @@ check_pear_module() { ## @Globals PHP_BIN, INSTALL_DIR #---- install_pear_module() { - local module_list=$1 - echo -e "$(gettext "Installing PEAR modules")" - $PHP_BIN $INSTALL_DIR/check_pear.php install $module_list - return "$?" + local module_list=$1 + echo -e "$(gettext "Installing PEAR modules")" + $PHP_BIN $INSTALL_DIR/check_pear.php install $module_list + return "$?" } #---- @@ -2176,10 +2278,10 @@ install_pear_module() { ## @Globals PHP_BIN, INSTALL_DIR #---- upgrade_pear_module() { - local module_list=$1 - echo -e "$(gettext "Upgrading PEAR modules")" - $PHP_BIN $INSTALL_DIR/check_pear.php upgrade $module_list - return "$?" + local module_list=$1 + echo -e "$(gettext "Upgrading PEAR modules")" + $PHP_BIN $INSTALL_DIR/check_pear.php upgrade $module_list + return "$?" } #---- @@ -2196,27 +2298,27 @@ install_init_service() { # redhat chkconfig # Suse chkconfig # FreeBSD add ${service}_enable=YES in /etc/rc.conf - local service=$1 - OS="" - find_OS "OS" - if [ "$OS" = "DEBIAN" ] ; then - update-rc.d $service start 40 2 3 4 5 . stop 30 0 1 6 . - elif [ "$OS" = "SUSE" ] ; then - chkconfig --add $service - elif [ "$OS" = "REDHAT" ] ; then + local service=$1 + OS="" + find_OS "OS" + if [ "$OS" = "DEBIAN" ] ; then + update-rc.d $service start 40 2 3 4 5 . stop 30 0 1 6 . + elif [ "$OS" = "SUSE" ] ; then + chkconfig --add $service + elif [ "$OS" = "REDHAT" ] ; then # Just for CentOS :p bug #1148 if [ -x /sbin/chkconfig ] ; then /sbin/chkconfig --add $service else chkconfig --add $service fi - elif [ "$OS" = "FREEBSD" ] ; then - echo_info "$(gettext "You must configure your /etc/rc.conf with"): ${service}_enable=YES" - else - echo_passed "$(gettext "Impossible to install your run level for ") $service" "$fail" - return 1 - fi - return 0 + elif [ "$OS" = "FREEBSD" ] ; then + echo_info "$(gettext "You must configure your /etc/rc.conf with"): ${service}_enable=YES" + else + echo_passed "$(gettext "Impossible to install your run level for ") $service" "$fail" + return 1 + fi + return 0 } #---- @@ -2228,56 +2330,56 @@ install_init_service() { ## @return 1 OS not found #---- find_OS() { - local distrib=$1 - local dist_found="" - local system="" - local lsb_release="" - system="$(uname -s)" - if [ "$system" = "Linux" ] ; then - if [ "$(pathfind lsb_release; echo $?)" -eq "0" ] ; then - lsb_release="$(lsb_release -i -s)" - else - lsb_release="NOT_FOUND" - fi - if [ "$lsb_release" = "Debian" ] || \ - [ "$lsb_release" = "Ubuntu" ] || \ - [ -e "/etc/debian_version" ] ; then - dist_found="DEBIAN" - log "INFO" "$(gettext "GNU/Linux Debian Distribution")" - elif [ "$lsb_release" = "SUSE LINUX" ] || \ - [ -e "/etc/SuSE-release" ] ; then - dist_found="SUSE" - log "INFO" "$(gettext "GNU/Linux Suse Distribution")" + local distrib=$1 + local dist_found="" + local system="" + local lsb_release="" + system="$(uname -s)" + if [ "$system" = "Linux" ] ; then + if [ "$(pathfind lsb_release; echo $?)" -eq "0" ] ; then + lsb_release="$(lsb_release -i -s)" + else + lsb_release="NOT_FOUND" + fi + if [ "$lsb_release" = "Debian" ] || \ + [ "$lsb_release" = "Ubuntu" ] || \ + [ -e "/etc/debian_version" ] ; then + dist_found="DEBIAN" + log "INFO" "$(gettext "GNU/Linux Debian Distribution")" + elif [ "$lsb_release" = "SUSE LINUX" ] || \ + [ -e "/etc/SuSE-release" ] ; then + dist_found="SUSE" + log "INFO" "$(gettext "GNU/Linux Suse Distribution")" elif [ "$lsb_release" = "openSUSE project" ] || \ - [ -e "/etc/SuSE-release" ] ; then - dist_found="SUSE" - log "INFO" "$(gettext "GNU/openSUSE Distribution")" - elif [ "$lsb_release" = "RedHatEnterpriseES" ] || \ - [ "$lsb_release" = "Fedora" ] || \ - [ -e "/etc/redhat-release" ] ; then - dist_found="REDHAT" - log "INFO" "$(gettext "GNU/Linux Redhat Distribution")" - else - dist_found="NOT_FOUND" - log "INFO" "$(gettext "GNU/Linux distribution not found")" - return 1 - fi - elif [ "$system" = "FreeBSD" ] ; then - dist_found="FREEBSD" - log "INFO" "$(gettext "FreeBSD System")" - elif [ "$system" = "AIX" ] ; then - dist_found="AIX" - log "INFO" "$(gettext "AIX System")" - elif [ "$system" = "SunOS" ] ; then - dist_found="SUNOS" - log "INFO" "$(gettext "SunOS System")" - else - dist_found="NOT_FOUND" - log "INFO" "$(gettext "System not found")" - fi - - eval $distrib=$dist_found - return 0 + [ -e "/etc/SuSE-release" ] ; then + dist_found="SUSE" + log "INFO" "$(gettext "GNU/openSUSE Distribution")" + elif [ "$lsb_release" = "RedHatEnterpriseES" ] || \ + [ "$lsb_release" = "Fedora" ] || \ + [ -e "/etc/redhat-release" ] ; then + dist_found="REDHAT" + log "INFO" "$(gettext "GNU/Linux Redhat Distribution")" + else + dist_found="NOT_FOUND" + log "INFO" "$(gettext "GNU/Linux distribution not found")" + return 1 + fi + elif [ "$system" = "FreeBSD" ] ; then + dist_found="FREEBSD" + log "INFO" "$(gettext "FreeBSD System")" + elif [ "$system" = "AIX" ] ; then + dist_found="AIX" + log "INFO" "$(gettext "AIX System")" + elif [ "$system" = "SunOS" ] ; then + dist_found="SUNOS" + log "INFO" "$(gettext "SunOS System")" + else + dist_found="NOT_FOUND" + log "INFO" "$(gettext "System not found")" + fi + + eval $distrib=$dist_found + return 0 } #---- @@ -2289,19 +2391,19 @@ find_OS() { ## - ... #---- clean_and_exit() { - local trap_sig=${1:-0} - if [ $trap_sig -eq 0 ] ; then - echo -e "$(gettext "\nTrap interrupt, Centreon'll exit now and clean install")" - yes_no_default "$(gettext "Do you really want to quit Centreon install process ? ")" "$no" - if [ $? -eq 1 ] ; then - echo "$(gettext "Continue...")" - return 1 + local trap_sig=${1:-0} + if [ $trap_sig -eq 0 ] ; then + echo -e "$(gettext "\nTrap interrupt, Centreon'll exit now and clean install")" + yes_no_default "$(gettext "Do you really want to quit Centreon install process ? ")" "$no" + if [ $? -eq 1 ] ; then + echo "$(gettext "Continue...")" + return 1 + fi fi - fi - log "EXIT" "$(gettext "Exit Centreon install")" - [ -n "$SUDO_FILE" -a $upgrade -eq 0 ] && clean_sudo "$SUDO_FILE" 0 - purge_centreon_tmp_dir "silent" - exit 1 + log "EXIT" "$(gettext "Exit Centreon install")" + [ -n "$SUDO_FILE" -a $upgrade -eq 0 ] && clean_sudo "$SUDO_FILE" 0 + purge_centreon_tmp_dir "silent" + exit 1 } #---- @@ -2311,20 +2413,20 @@ clean_and_exit() { ## @Globals TMP_DIR #---- check_tmp_disk_space() { - local min_space="35584" - local free_space="" - local tmp_dir="" + local min_space="35584" + local free_space="" + local tmp_dir="" - tmp_dir=$(dirname $TMP_DIR) + tmp_dir=$(dirname $TMP_DIR) - free_space=$(df -P $tmp_dir | tail -1 | awk '{print $4}') + free_space=$(df -P $tmp_dir | tail -1 | awk '{print $4}') - if [ "$free_space" -lt "$min_space" ] ; then - echo_failure "$(gettext "No space left on tmp dir") : $tmp_dir (<$min_space Ko)" "$fail" - return 1 - else - return 0 - fi + if [ "$free_space" -lt "$min_space" ] ; then + echo_failure "$(gettext "No space left on tmp dir") : $tmp_dir (<$min_space Ko)" "$fail" + return 1 + else + return 0 + fi } #---- @@ -2335,27 +2437,27 @@ check_tmp_disk_space() { ## @Globals TMP_DIR, yes #---- purge_centreon_tmp_dir() { - local silent="$1" - local not_clean="1" - local rc="0" - while [ $not_clean -ne 0 ] ; do - if [ "$silent" != "silent" ] ; then - yes_no_default "$(gettext "Do you want me to remove the centreon temporary working space to continue installation ?")" "$yes" - rc=$? - else - rc=0 - fi - if [ $rc -eq 0 ] ; then - local tmp_base_dir=`dirname $TMP_DIR` - local tmp_dir=`basename $TMP_DIR` - find $tmp_base_dir -name "$tmp_dir*" -type d \ - -exec rm -rf {} \; 2>/dev/null - not_clean="0" - else - return 1 - fi - done - return 0 + local silent="$1" + local not_clean="1" + local rc="0" + while [ $not_clean -ne 0 ] ; do + if [ "$silent" != "silent" ] ; then + yes_no_default "$(gettext "Do you want to remove the centreon temporary working space to continue installation ?")" "$yes" + rc=$? + else + rc=0 + fi + if [ $rc -eq 0 ] ; then + local tmp_base_dir=`dirname $TMP_DIR` + local tmp_dir=`basename $TMP_DIR` + find $tmp_base_dir -name "$tmp_dir*" -type d \ + -exec rm -rf {} \; 2>/dev/null + not_clean="0" + else + return 1 + fi + done + return 0 } #---- @@ -2367,35 +2469,35 @@ purge_centreon_tmp_dir() { ## @Globals TMP_DIR, LOG_FILE #---- clean_sudo() { - local RC="1" - local sudo_old="$1" - local validate="${2:-0}" + local RC="1" + local sudo_old="$1" + local validate="${2:-0}" if [ ! -d "$TMP_DIR" ] ; then local sudo_clean="/tmp/sudo.clean" else - local sudo_clean="$TMP_DIR/sudo.clean" + local sudo_clean="$TMP_DIR/sudo.clean" fi if ! grep "CENTREON SUDO" $sudo_old &>/dev/null ; then return 1 fi - ${CAT} $sudo_old | \ - awk 'BEGIN { flag=0; } - /^## BEGIN: CENTREON SUDO/ { flag=1; next; } - /^## END: CENTREON SUDO/ { flag=0; next; } - { if (flag == 0) { print $0; } next; }' > $sudo_clean + ${CAT} $sudo_old | \ + awk 'BEGIN { flag=0; } + /^## BEGIN: CENTREON SUDO/ { flag=1; next; } + /^## END: CENTREON SUDO/ { flag=0; next; } + { if (flag == 0) { print $0; } next; }' > $sudo_clean - log "INFO" "$(gettext "New sudo file generate in:") $sudo_clean" - if [ "$validate" -eq 1 ] ; then - yes_no_default "$(gettext "Do you want me to clean your sudo files ? (clean centreon config)")" - RC="$?" - fi - if [ "$RC" -eq 0 -o "$validate" -eq 0 ] ; then - ${CAT} $sudo_clean > $sudo_old 2>$LOG_FILE - return 0 - fi - return 0 + log "INFO" "$(gettext "New sudo file generate in:") $sudo_clean" + if [ "$validate" -eq 1 ] ; then + yes_no_default "$(gettext "Do you want to clean your sudo files ? (clean centreon config)")" + RC="$?" + fi + if [ "$RC" -eq 0 -o "$validate" -eq 0 ] ; then + ${CAT} $sudo_clean > $sudo_old 2>$LOG_FILE + return 0 + fi + return 0 } #---- @@ -2408,25 +2510,25 @@ clean_sudo() { ## @Globals LOG_FILE, TMP_DIR #---- find_macros_in_dir() { - local macro="$1" - local src_dir="$2" - local sub_dir="$3" - local file="$4" - local var_ref="$5" - local file_out_tmp="" - file_out_tmp=$(mktemp $TMP_DIR/file_out_tmp.XXXXXX) - - for mac in ${macro//,/ } ; do - log "INFO" "$(gettext "Search file for macro") : $mac" - ( cd $src_dir ; - find $sub_dir -mindepth 1 -type f -name "$file" | \ - xargs ${GREP} -l "$mac" | \ - uniq >> "$file_out_tmp" 2>>"$LOG_FILE"; - ) - done + local macro="$1" + local src_dir="$2" + local sub_dir="$3" + local file="$4" + local var_ref="$5" + local file_out_tmp="" + file_out_tmp=$(mktemp $TMP_DIR/file_out_tmp.XXXXXX) + + for mac in ${macro//,/ } ; do + log "INFO" "$(gettext "Search file for macro") : $mac" + ( cd $src_dir ; + find $sub_dir -mindepth 1 -type f -name "$file" | \ + xargs ${GREP} -l "$mac" | \ + uniq >> "$file_out_tmp" 2>>"$LOG_FILE"; + ) + done - eval $var_ref=$file_out_tmp - return 0 + eval $var_ref=$file_out_tmp + return 0 } @@ -2436,16 +2538,16 @@ find_macros_in_dir() { ## @param message to print #---- check_result() { - local code=$1 - shift - local message=$@ + local code=$1 + shift + local message=$@ - if [ $code -eq 0 ] ; then - echo_success "$message" "$ok" - else - echo_failure "$message" "$fail" - fi - return 0 + if [ $code -eq 0 ] ; then + echo_success "$message" "$ok" + else + echo_failure "$message" "$fail" + fi + return 0 } #---- @@ -2457,16 +2559,16 @@ check_result() { ## @return 1 fail #---- add_group() { - local user=$1 - local group=$2 - if [ -z "$user" -o -z "$group" ]; then - echo_failure "$(gettext "Add group $group to user $user")" "$fail" - return 1 - fi - usermod -a -G $group $user &>/dev/null - local ret=$? - check_result $ret "$(gettext "Add group $group to user $user")" - return $ret + local user=$1 + local group=$2 + if [ -z "$user" -o -z "$group" ]; then + echo_failure "$(gettext "Could not add group $group to user $user")" "$fail" + return 1 + fi + usermod -a -G $group $user &>/dev/null + local ret=$? + check_result $ret "$(gettext "Add group $group to user $user")" + return $ret } #---- @@ -2477,19 +2579,19 @@ add_group() { ## @return 0 end #---- get_primary_group() { - local user=$1 - local var_ref=$2 - local group_name=$(id -ng "$user" 2>/dev/null) - if [ -z "$group_name" ]; then - return 1 - fi - eval $var_ref=$group_name - return 0 + local user=$1 + local var_ref=$2 + local group_name=$(id -ng "$user" 2>/dev/null) + if [ -z "$group_name" ]; then + return 1 + fi + eval $var_ref=$group_name + return 0 } check_rrd_right() { - if [ -d "${CENTSTORAGE_RRD}" ]; then - ${CHOWN} -R ${CENTREON_USER}:${CENTREON_GROUP} "${CENTSTORAGE_RRD}" - ${CHMOD} -R g+w "${CENTSTORAGE_RRD}" - fi + if [ -d "${CENTSTORAGE_RRD}" ]; then + ${CHOWN} -R ${CENTREON_USER}:${CENTREON_GROUP} "${CENTSTORAGE_RRD}" + ${CHMOD} -R g+w "${CENTSTORAGE_RRD}" + fi } diff --git a/logrotate/centcore b/logrotate/centcore deleted file mode 100644 index 1af33cd7ddc..00000000000 --- a/logrotate/centcore +++ /dev/null @@ -1,10 +0,0 @@ -@CENTREON_LOG@/centcore.log { - copytruncate - weekly - rotate 52 - compress - delaycompress - notifempty - missingok - su root root -} diff --git a/src/Centreon/Application/Controller/GorgoneController.php b/src/Centreon/Application/Controller/GorgoneController.php new file mode 100644 index 00000000000..ca209521196 --- /dev/null +++ b/src/Centreon/Application/Controller/GorgoneController.php @@ -0,0 +1,122 @@ +gorgoneService = $gorgoneService; + } + + /** + * Entry point to send a command to a specific command + * + * @Rest\Get( + * "/gorgone/pollers/{pollerId}/commands/{commandName}", + * condition="request.attributes.get('version') == 2.0") + * @param string $commandName Name of the Gorgone command + * @param int $pollerId Id of the poller for which this command is intended + * + * @return View + * @throws \Exception + */ + public function sendCommand(int $pollerId, string $commandName): View + { + $command = $this->createFromName($commandName, $pollerId); + $gorgoneResponse = $this->gorgoneService->send($command); + + return $this->view([ + 'token' => $gorgoneResponse->getCommand() !== null + ? $gorgoneResponse->getCommand()->getToken() + : null + ]); + } + + /** + * Entry point to get the response to a specific command + * + * @Rest\Get( + * "/gorgone/pollers/{pollerId}/responses/{token}", + * condition="request.attributes.get('version') == 2.0") + * @param int $pollerId Id of the poller for which the command is intended + * @param string $token Token of the command attributed by the Gorgone server + * + * @return View + */ + public function getResponses(int $pollerId, string $token): View + { + $gorgoneResponse = $this->gorgoneService->getResponseFromToken($pollerId, $token); + // We force a call to read the Gorgon Server API responses + $gorgoneResponse->getLastActionLog(); + $responseTemplate = ($gorgoneResponse->getError() !== null) + ? ['error' => $gorgoneResponse->getError()] + : []; + + return $this->view(array_merge($responseTemplate, [ + 'message' => $gorgoneResponse->getMessage(), + 'token' => $gorgoneResponse->getToken(), + 'data' => $gorgoneResponse->getActionLogs() + ])); + } + + /** + * Check whether the command type exists or not. + * + * @param string $commandType Type of the command (ex: thumbprint, ...) + * @param int $pollerId Id of the poller for which the command is intended + * + * @return CommandInterface + */ + private function createFromName(string $commandType, int $pollerId): CommandInterface + { + switch ($commandType) { + case 'thumbprint': + return new ThumbprintCommand($pollerId); + default: + throw new \LogicException('Unrecognized Command'); + } + } +} diff --git a/src/Centreon/Domain/ConfigurationLoader/YamlConfigurationLoader.php b/src/Centreon/Domain/ConfigurationLoader/YamlConfigurationLoader.php new file mode 100644 index 00000000000..80d356578ac --- /dev/null +++ b/src/Centreon/Domain/ConfigurationLoader/YamlConfigurationLoader.php @@ -0,0 +1,142 @@ +configurationFile = $configurationFile; + } + + /** + * Loads the configuration file defined in the constructor and returns its equivalent in the form of an array. + * + * @return array Configuration data + * @throws \FileNotFoundException + */ + public function load(): array + { + $configuration = $this->loadFile($this->configurationFile); + + return $this->iterateConfiguration( + $configuration, + realpath(dirname($this->configurationFile)), + realpath($this->configurationFile) + ); + } + + /** + * Iterate each key and value to detect the request to load another configuration file. + * + * @param array $configuration Configuration data to analyse + * @param string $currentDirectory Directory of the currently analyzed configuration file + * @param string $historyLoadedFile History of analyzed configuration files + * + * @return array Returns the configuration data including other configuration data from the include files + * @throws \FileNotFoundException + */ + private function iterateConfiguration( + array $configuration, + string $currentDirectory, + string $historyLoadedFile + ): array { + foreach ($configuration as $key => $value) { + if (is_array($value)) { + $configuration[$key] = $this->iterateConfiguration($value, $currentDirectory, $historyLoadedFile); + } elseif ($value instanceof TaggedValue && $value->getTag() === self::INCLUDE_TOKEN) { + $fileToLoad = $value->getValue(); + if ($fileToLoad[0] !== DIRECTORY_SEPARATOR) { + $fileToLoad = $currentDirectory . '/' . $fileToLoad; + } + $dataToIterate = $this->loadFile($fileToLoad); + + if (!$this->isLoopDetected($fileToLoad, $historyLoadedFile)) { + $configuration[$key] = $this->iterateConfiguration( + $dataToIterate, + realpath(dirname($fileToLoad)), + $historyLoadedFile . ':' . realpath($fileToLoad) + ); + } else { + $loadedFile = explode(':', $historyLoadedFile); + throw new \Exception('Loop detected in file ' . array_pop($loadedFile)); + } + } + } + + return $configuration; + } + + /** + * Indicates if a loop is detected. + * + * @param string $fileToLoad File to load + * @param string $historyLoadedFile File load History + * + * @return bool Returns TRUE if a loop is detected + */ + private function isLoopDetected(string $fileToLoad, string $historyLoadedFile): bool + { + $fileToLoad = realpath($fileToLoad); + $loadedFile = explode(':', $historyLoadedFile); + + return in_array($fileToLoad, $loadedFile); + } + + /** + * Load and parse a Yaml configuration file. + * + * @param string $yamlFile Yaml configuration file to load + * + * @return array Returns the configuration data in the form of an array + * @throws \FileNotFoundException + */ + private function loadFile(string $yamlFile): array + { + if (!file_exists($yamlFile)) { + throw new \FileNotFoundException('The configuration file \'' . $yamlFile . '\' does not exists'); + } + + return (array)Yaml::parseFile($yamlFile, Yaml::PARSE_CUSTOM_TAGS); + } +} diff --git a/src/Centreon/Domain/Entity/NagiosServer.php b/src/Centreon/Domain/Entity/NagiosServer.php index 30120c2af35..5aee33cc521 100644 --- a/src/Centreon/Domain/Entity/NagiosServer.php +++ b/src/Centreon/Domain/Entity/NagiosServer.php @@ -138,12 +138,12 @@ class NagiosServer implements Mapping\MetadataInterface /** * @var int */ - private $sshPort; + private $gorgoneCommunicationType; /** - * @var string + * @var int */ - private $sshPrivateKey; + private $gorgonePort; /** * @var string @@ -178,7 +178,7 @@ class NagiosServer implements Mapping\MetadataInterface /** * @var string */ - private $remoteServerCentcoreSshProxy; + private $remoteServerUseAsProxy; /** * {@inheritdoc} @@ -204,15 +204,15 @@ public static function loadMetadata(Mapping\ClassMetadata $metadata): void ->add('centreonbrokerCfgPath', 'centreonbroker_cfg_path') ->add('centreonbrokerModulePath', 'centreonbroker_module_path') ->add('centreonconnectorPath', 'centreonconnector_path') - ->add('sshPort', 'ssh_port', PDO::PARAM_INT) - ->add('sshPrivateKey', 'ssh_private_key') + ->add('gorgoneCommunicationType', 'gorgone_communication_type', PDO::PARAM_INT) + ->add('gorgonePort', 'gorgone_port', PDO::PARAM_INT) ->add('initScriptCentreontrapd', 'init_script_centreontrapd') ->add('snmpTrapdPathConf', 'snmp_trapd_path_conf') ->add('engineName', 'engine_name') ->add('engineVersion', 'engine_version') ->add('centreonbrokerLogsPath', 'centreonbroker_logs_path') ->add('remoteId', 'remote_id', PDO::PARAM_INT) - ->add('remoteServerCentcoreSshProxy', 'remote_server_centcore_ssh_proxy'); + ->add('remoteServerUseAsProxy', 'remote_server_use_as_proxy'); } /** @@ -380,17 +380,17 @@ public function getCentreonconnectorPath(): ?string /** * @return int|null */ - public function getSshPort(): ?int + public function getGorgoneCommunicationType(): ?int { - return $this->sshPort; + return $this->gorgoneCommunicationType; } /** - * @return string|null + * @return int|null */ - public function getSshPrivateKey(): ?string + public function getGorgonePort(): ?int { - return $this->sshPrivateKey; + return $this->gorgonePort; } /** @@ -444,9 +444,9 @@ public function getRemoteId(): ?int /** * @return string|null */ - public function getRemoteServerCentcoreSshProxy(): ?string + public function getRemoteServerUseAsProxy(): ?string { - return $this->remoteServerCentcoreSshProxy; + return $this->remoteServerUseAsProxy; } /** @@ -594,21 +594,21 @@ public function setCentreonconnectorPath(string $centreonconnectorPath = null): } /** - * @param string|int $sshPort + * @param string|int $gorgoneCommunicationType * @return void */ - public function setSshPort($sshPort = null): void + public function setGorgoneCommunicationType($gorgoneCommunicationType = null): void { - $this->sshPort = (int)$sshPort; + $this->gorgoneCommunicationType = (int)$gorgoneCommunicationType; } /** - * @param string $sshPrivateKey + * @param string|int $gorgonePort * @return void */ - public function setSshPrivateKey(string $sshPrivateKey = null): void + public function setGorgonePort($gorgonePort = null): void { - $this->sshPrivateKey = $sshPrivateKey; + $this->gorgonePort = (int)$gorgonePort; } /** @@ -666,11 +666,11 @@ public function setRemoteId($remoteId = null): void } /** - * @param string $remoteServerCentcoreSshProxy + * @param string $remoteServerUseAsProxy * @return void */ - public function setRemoteServerCentcoreSshProxy(string $remoteServerCentcoreSshProxy = null): void + public function setRemoteServerUseAsProxy(string $remoteServerUseAsProxy = null): void { - $this->remoteServerCentcoreSshProxy = $remoteServerCentcoreSshProxy; + $this->remoteServerUseAsProxy = $remoteServerUseAsProxy; } } diff --git a/src/Centreon/Domain/Gorgone/ActionLog.php b/src/Centreon/Domain/Gorgone/ActionLog.php new file mode 100644 index 00000000000..6997968487d --- /dev/null +++ b/src/Centreon/Domain/Gorgone/ActionLog.php @@ -0,0 +1,201 @@ + $details Details used to create an action log + * @return ActionLog + * @throws \Exception + */ + public static function create(array $details): ActionLog + { + if (empty($details['token'])) { + throw new \LogicException('Token can not empty, null or not defined'); + } + return (new ActionLog($details['token'])) + ->setId((int) ($details['id'] ?? 0)) + ->setCode((int) ($details['code'] ?? 0)) + ->setCreationTime((new \DateTime())->setTimestamp((int) ($details['ctime'] ?? 0))) + ->setEventTime((new \DateTime())->setTimestamp((int) ($details['etime'] ?? 0))) + ->setData($details['data'] ?? '{}'); + } + + /** + * @param string $token + * @see ActionLog::$token + */ + public function __construct(string $token) + { + $this->token = $token; + } + + /** + * @return \DateTime + * @see ActionLog::$creationTime + */ + public function getCreationTime(): \DateTime + { + return $this->creationTime; + } + + /** + * @param \DateTime $creationTime + * @return ActionLog + * @see ActionLog::$creationTime + */ + public function setCreationTime(\DateTime $creationTime): ActionLog + { + $this->creationTime = $creationTime; + return $this; + } + + /** + * @return \DateTime + * @see ActionLog::$eventTime + */ + public function getEventTime(): \DateTime + { + return $this->eventTime; + } + + /** + * @param \DateTime $eventTime + * @return ActionLog + * @see ActionLog::$eventTime + */ + public function setEventTime(\DateTime $eventTime): ActionLog + { + $this->eventTime = $eventTime; + return $this; + } + + /** + * @return int + */ + public function getId(): int + { + return $this->id; + } + + /** + * @param int $id + * @return ActionLog + */ + public function setId(int $id): ActionLog + { + $this->id = $id; + return $this; + } + + /** + * @return string + * @see ActionLog::$token + */ + public function getToken(): string + { + return $this->token; + } + + /** + * @return int + * @see ActionLog::$code + */ + public function getCode(): int + { + return $this->code; + } + + /** + * @param int $code + * @return ActionLog + */ + public function setCode(int $code): ActionLog + { + $this->code = $code; + return $this; + } + + /** + * @return string + * @see ActionLog::$data + */ + public function getData(): string + { + return $this->data; + } + + /** + * @param string $data + * @return ActionLog + * @see ActionLog::$data + */ + public function setData(string $data): ActionLog + { + $this->data = $data; + return $this; + } +} diff --git a/src/Centreon/Domain/Gorgone/Command/BasicCommand.php b/src/Centreon/Domain/Gorgone/Command/BasicCommand.php new file mode 100644 index 00000000000..84feaaccb21 --- /dev/null +++ b/src/Centreon/Domain/Gorgone/Command/BasicCommand.php @@ -0,0 +1,82 @@ +monitoringInstanceId = $pollerId; + $this->bodyRequest = $bodyRequest; + } + + /** + * @return int + * @see CommandInterface::getMonitoringInstanceId() + */ + public function getMonitoringInstanceId(): int + { + return $this->monitoringInstanceId; + } + + /** + * @return string + * @see CommandInterface::getToken() + */ + public function getToken(): string + { + return $this->token; + } + + /** + * @param string $token + * @see CommandInterface::setToken() + */ + public function setToken(string $token): void + { + $this->token = $token; + } +} diff --git a/src/Centreon/Domain/Gorgone/Command/CommandFactory.php b/src/Centreon/Domain/Gorgone/Command/CommandFactory.php new file mode 100644 index 00000000000..10519acc02c --- /dev/null +++ b/src/Centreon/Domain/Gorgone/Command/CommandFactory.php @@ -0,0 +1,54 @@ + GorgoneCommandInterface[] + */ + private static $commands = []; + + /** + * @param CommandInterface $command Command to add + */ + public static function addCommand(CommandInterface $command): void + { + static::$commands[$command->getName()] = $command; + } + + /*** + * @param string $commandName Gorgone command name + * @return CommandInterface + */ + public static function create(string $commandName): CommandInterface + { + if (array_key_exists($commandName, static::$commands)) { + return static::$commands[$commandName]; + } else { + throw new \LogicException('Command not found'); + } + } +} diff --git a/src/Centreon/Domain/Gorgone/Command/EmptyCommand.php b/src/Centreon/Domain/Gorgone/Command/EmptyCommand.php new file mode 100644 index 00000000000..8c0faacc45a --- /dev/null +++ b/src/Centreon/Domain/Gorgone/Command/EmptyCommand.php @@ -0,0 +1,61 @@ +monitoringInstanceId . '/internal/thumbprint'; + } + + /** + * @inheritDoc + */ + public function getBodyRequest(): string + { + return ''; + } + + /** + * @inheritDoc + */ + public function getName(): string + { + return self::NAME; + } + + public function getMethod(): string + { + return self::METHOD_GET; + } +} diff --git a/src/Centreon/Domain/Gorgone/ConfigurationLoader.php b/src/Centreon/Domain/Gorgone/ConfigurationLoader.php new file mode 100644 index 00000000000..50fa85b39e7 --- /dev/null +++ b/src/Centreon/Domain/Gorgone/ConfigurationLoader.php @@ -0,0 +1,172 @@ + Parameters of the Gorgone server + */ + private $gorgoneParameters; + + /** + * @var bool Indicates whether options are already loaded or not + */ + private $isOptionsLoaded = false; + + /** + * @param OptionServiceInterface $optionService + */ + public function __construct(OptionServiceInterface $optionService) + { + $this->optionService = $optionService; + } + + /** + * @inheritDoc + */ + public function getApiIpAddress(): ?string + { + if (!$this->isOptionsLoaded) { + $this->loadConfiguration(); + } + return (string) $this->gorgoneParameters[self::GORGONE_API_ADDRESS] ?? null; + } + + /** + * @inheritDoc + */ + public function getApiPort(): ?int + { + if (!$this->isOptionsLoaded) { + $this->loadConfiguration(); + } + return (int) $this->gorgoneParameters[self::GORGONE_API_PORT] ?? null; + } + + /** + * @inheritDoc + */ + public function getApiUsername(): ?string + { + if (!$this->isOptionsLoaded) { + $this->loadConfiguration(); + } + return (string) $this->gorgoneParameters[self::GORGONE_API_USERNAME] ?? null; + } + + /** + * @inheritDoc + */ + public function getApiPassword(): ?string + { + if (!$this->isOptionsLoaded) { + $this->loadConfiguration(); + } + return (string) $this->gorgoneParameters[self::GORGONE_API_PASSWORD] ?? null; + } + + /** + * @inheritDoc + */ + public function isApiConnectionSecure(): bool + { + if (!$this->isOptionsLoaded) { + $this->loadConfiguration(); + } + return (bool) $this->gorgoneParameters[self::GORGONE_API_SSL] ?? false; + } + + /** + * @inheritDoc + */ + public function isSecureConnectionSelfSigned(): bool + { + if (!$this->isOptionsLoaded) { + $this->loadConfiguration(); + } + return (bool) $this->gorgoneParameters[self::GORGONE_API_CERTIFICATE_SELF_SIGNED] ?? false; + } + + /** + * @inheritDoc + */ + public function getCommandTimeout(): int + { + if (!$this->isOptionsLoaded) { + $this->loadConfiguration(); + } + $timeout = (int) $this->gorgoneParameters[self::GORGONE_COMMAND_TIMEOUT] ?? self::DEFAULT_TIMEOUT; + // Do not use a timeout at 0 + return $timeout > 0 ? $timeout : 1; + } + + /** + * Loads configuration of the Gorgone server + * + * @throws \Exception + */ + private function loadConfiguration(): void + { + try { + $options = $this->optionService->findSelectedOptions([ + self::GORGONE_API_ADDRESS, + self::GORGONE_API_PORT, + self::GORGONE_API_USERNAME, + self::GORGONE_API_PASSWORD, + self::GORGONE_API_SSL, + self::GORGONE_API_CERTIFICATE_SELF_SIGNED, + self::GORGONE_COMMAND_TIMEOUT + ]); + foreach ($options as $option) { + $this->gorgoneParameters[$option->getName()] = $option->getValue(); + } + $this->isOptionsLoaded = true; + } catch (\Exception $ex) { + $this->isOptionsLoaded = false; + throw $ex; + } + } +} diff --git a/src/Centreon/Domain/Gorgone/GorgoneException.php b/src/Centreon/Domain/Gorgone/GorgoneException.php new file mode 100644 index 00000000000..50d969589e2 --- /dev/null +++ b/src/Centreon/Domain/Gorgone/GorgoneException.php @@ -0,0 +1,27 @@ +responseRepository = $responseRepository; + $this->commandRepository = $commandRepository; + Response::setRepository($responseRepository); + } + + /** + * @inheritDoc + * @see ResponseInterface + */ + public function send(CommandInterface $command): ResponseInterface + { + try { + $responseToken = $this->commandRepository->send($command); + } catch (\Throwable $ex) { + throw new GorgoneException('Error when connecting to the Gorgone server'); + } + $command->setToken($responseToken); + return Response::create($command); + } + + /** + * @inheritDoc + */ + public function getResponseFromToken(int $monitoringInstanceId, string $token): ResponseInterface + { + $emptyCommand = new EmptyCommand($monitoringInstanceId); + $emptyCommand->setToken($token); + return Response::create($emptyCommand); + } +} diff --git a/src/Centreon/Domain/Gorgone/Interfaces/CommandInterface.php b/src/Centreon/Domain/Gorgone/Interfaces/CommandInterface.php new file mode 100644 index 00000000000..03aac00bbb9 --- /dev/null +++ b/src/Centreon/Domain/Gorgone/Interfaces/CommandInterface.php @@ -0,0 +1,79 @@ +command = $command; + $this->responseRepository = $responseRepository; + } + + /** + * @return CommandInterface|null + */ + public function getCommand(): ?CommandInterface + { + return $this->command; + } + + /** + * @return string|null + */ + public function getMessage(): ?string + { + return $this->message; + } + + /** + * @return ActionLog[] + * @throws \Exception + * @see Response::$actionLogs + */ + public function getActionLogs(): array + { + $this->actionLogs = []; + $rawResponse = $this->responseRepository->getResponse($this->command); + $jsonResponse = json_decode($rawResponse, true); + $this->error = $jsonResponse['error'] ?? null; + $this->token = (string) $jsonResponse['token']; + + if ($this->error === null) { + foreach ($jsonResponse['data'] as $key => $responseData) { + $this->actionLogs[$key] = ActionLog::create($responseData); + } + } + $this->message = ((string) $jsonResponse['message'] ?? null); + return $this->actionLogs; + } + + /** + * @return ActionLog|null + * @throws \Exception + */ + public function getLastActionLog(): ?ActionLog + { + $this->getActionLogs(); + return $this->actionLogs[count($this->actionLogs) - 1] ?? null; + } + + + /** + * @inheritDoc + * @see Response::$token + */ + public function getToken(): ?string + { + return $this->token; + } + + /** + * @inheritDoc + * @see Response::$error + */ + public function getError(): ?string + { + return $this->error; + } +} diff --git a/src/Centreon/Domain/Option/Interfaces/OptionRepositoryInterface.php b/src/Centreon/Domain/Option/Interfaces/OptionRepositoryInterface.php new file mode 100644 index 00000000000..a04d3be04e1 --- /dev/null +++ b/src/Centreon/Domain/Option/Interfaces/OptionRepositoryInterface.php @@ -0,0 +1,41 @@ + + * $selectedOptions = $optionService->findSelectedOptions(['snmp_version', 'session_expire']); + * + * + * @param string[] $optionsToFind Keys of the options to find + * @return Option[] Options list corresponding to the options requested + * @throws \Exception + */ + public function findSelectedOptions(array $optionsToFind): array; + + /** + * Find all options. + * + * @param bool $useCache Indicates whether we should use the cache system or not (TRUE by default) + * @return Option[] Returns all available options + * @throws \Exception + */ + public function findAllOptions(bool $useCache): array; +} diff --git a/src/Centreon/Domain/Option/Option.php b/src/Centreon/Domain/Option/Option.php new file mode 100644 index 00000000000..eca968870da --- /dev/null +++ b/src/Centreon/Domain/Option/Option.php @@ -0,0 +1,81 @@ +name; + } + + /** + * @param string $name + * @return Option + * @see Option::$name + */ + public function setName(string $name): Option + { + $this->name = $name; + return $this; + } + + /** + * @return string|null + * @see Option::$value + */ + public function getValue(): ?string + { + return $this->value; + } + + /** + * @param string|null $value + * @return Option + * @see Option::$value + */ + public function setValue(?string $value): Option + { + $this->value = $value; + return $this; + } +} diff --git a/src/Centreon/Domain/Option/OptionException.php b/src/Centreon/Domain/Option/OptionException.php new file mode 100644 index 00000000000..d8cb6fca20b --- /dev/null +++ b/src/Centreon/Domain/Option/OptionException.php @@ -0,0 +1,27 @@ +repository = $repository; + } + + /** + * @inheritDoc + */ + public function findSelectedOptions(array $optionsToFind): array + { + $optionsFound = $this->repository->findAllOptions(); + $requestedOptions = []; + foreach ($optionsFound as $option) { + if (in_array($option->getName(), $optionsToFind)) { + $requestedOptions[] = $option; + } + } + return $requestedOptions; + } + + /** + * @inheritDoc + */ + public function findAllOptions(bool $useCache): array + { + return $this->repository->findAllOptions($useCache); + } +} diff --git a/src/Centreon/Infrastructure/Gorgone/CommandRepositoryAPI.php b/src/Centreon/Infrastructure/Gorgone/CommandRepositoryAPI.php new file mode 100644 index 00000000000..27f766a16aa --- /dev/null +++ b/src/Centreon/Infrastructure/Gorgone/CommandRepositoryAPI.php @@ -0,0 +1,105 @@ +client = new CurlHttpClient(); + $this->optionService = $optionService; + $this->configuration = $configuration; + } + + /** + * @inheritDoc + */ + public function send(CommandInterface $command): string + { + $isCertificateShouldBeVerify = $this->configuration->isSecureConnectionSelfSigned() === false; + $options = [ + 'body' => $command->getBodyRequest(), + 'timeout' => $this->configuration->getCommandTimeout(), + 'verify_peer' => $isCertificateShouldBeVerify, + 'verify_host' => $isCertificateShouldBeVerify, + ]; + if ($this->configuration->getApiUsername() !== null) { + $options = array_merge( + $options, + [ 'auth_basic' => $this->configuration->getApiUsername() . ':' + . $this->configuration->getApiPassword()] + ); + } + try { + $uri = sprintf( + '%s://%s:%d/api/%s', + $this->configuration->isApiConnectionSecure() ? 'https' : 'http', + $this->configuration->getApiIpAddress(), + $this->configuration->getApiPort(), + $command->getUriRequest() + ); + $response = $this->client->request($command->getMethod(), $uri, $options); + if ($response->getStatusCode() !== 200) { + throw new \Exception('Bad request', $response->getStatusCode()); + } + $jsonResponse = json_decode($response->getContent(), true); + if (!array_key_exists('token', $jsonResponse)) { + throw new \Exception('Token not found'); + } + return (string) $jsonResponse['token']; + } catch (\Throwable $e) { + throw new \Exception($e->getMessage(), (int) $e->getCode(), $e); + } + } +} diff --git a/src/Centreon/Infrastructure/Gorgone/Interfaces/ConfigurationLoaderApiInterface.php b/src/Centreon/Infrastructure/Gorgone/Interfaces/ConfigurationLoaderApiInterface.php new file mode 100644 index 00000000000..93fe6f58ef1 --- /dev/null +++ b/src/Centreon/Infrastructure/Gorgone/Interfaces/ConfigurationLoaderApiInterface.php @@ -0,0 +1,82 @@ +client = new CurlHttpClient(); + $this->optionService = $optionService; + $this->configuration = $configuration; + } + + /** + * @inheritDoc + */ + public function getResponse(CommandInterface $command): string + { + $isCertificateShouldBeVerify = $this->configuration->isSecureConnectionSelfSigned() === false; + $options = [ + 'timeout' => $this->configuration->getCommandTimeout(), + 'verify_peer' => $isCertificateShouldBeVerify, + 'verify_host' => $isCertificateShouldBeVerify, + ]; + if ($this->configuration->getApiUsername() !== null) { + $options = array_merge( + $options, + [ 'auth_basic' => $this->configuration->getApiUsername() . ':' + . $this->configuration->getApiPassword()] + ); + } + try { + $uri = sprintf( + '%s://%s:%d/api/nodes/%d/log/%s', + $this->configuration->isApiConnectionSecure() ? 'https' : 'http', + $this->configuration->getApiIpAddress(), + $this->configuration->getApiPort(), + $command->getMonitoringInstanceId(), + $command->getToken() + ); + $response = $this->client->request('GET', $uri, $options); + if ($response->getStatusCode() !== 200) { + throw new \Exception('Request error', $response->getStatusCode()); + } + return $response->getContent(); + } catch (\Throwable $ex) { + throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex); + } + } +} diff --git a/src/Centreon/Infrastructure/Option/OptionRepositoryRDB.php b/src/Centreon/Infrastructure/Option/OptionRepositoryRDB.php new file mode 100644 index 00000000000..6f4754347a7 --- /dev/null +++ b/src/Centreon/Infrastructure/Option/OptionRepositoryRDB.php @@ -0,0 +1,70 @@ +db = $db; + } + + /** + * @inheritDoc + */ + public function findAllOptions(bool $useCache = true): array + { + if ($useCache && !empty($this->options)) { + return $this->options; + } + $request = $this->translateDbName('SELECT `key` AS `name`, `value` FROM `:db`.options'); + if (false !== ($statement = $this->db->query($request))) { + $statement->execute(); + + while (false !== ($option = $statement->fetch(\PDO::FETCH_ASSOC))) { + $this->options[] = EntityCreator::createEntityByArray(Option::class, $option); + } + } + return $this->options; + } +} diff --git a/src/Centreon/Infrastructure/Service/CentcoreConfigService.php b/src/Centreon/Infrastructure/Service/CentcoreConfigService.php index d4929074728..09cb4773c07 100644 --- a/src/Centreon/Infrastructure/Service/CentcoreConfigService.php +++ b/src/Centreon/Infrastructure/Service/CentcoreConfigService.php @@ -1,14 +1,18 @@ parseIniFile(_CENTREON_ETC_ . '/' . static::CONF_CORE), - $this->parseIniFile(_CENTREON_ETC_ . '/' . static::CONF_PLUGINS), - $this->parseIniFile(_CENTREON_ETC_ . '/' . static::CONF_WEB) - ); + $data = $this->parseIniFile(_CENTREON_ETC_ . '/' . static::CONF_WEB); $this->macros = [ 'centreon_dir' => "{$data['INSTALL_DIR_CENTREON']}/", diff --git a/src/CentreonRemote/Domain/Resources/DefaultConfig/NagiosServer.php b/src/CentreonRemote/Domain/Resources/DefaultConfig/NagiosServer.php index fd7920c4b4e..7355320c99e 100644 --- a/src/CentreonRemote/Domain/Resources/DefaultConfig/NagiosServer.php +++ b/src/CentreonRemote/Domain/Resources/DefaultConfig/NagiosServer.php @@ -33,8 +33,8 @@ public static function getConfiguration(): array 'centreonbroker_cfg_path' => '@broker_etc@', 'centreonbroker_module_path' => '@centreonbroker_lib@', 'centreonconnector_path' => '@centreon_engine_connectors@', - 'ssh_port' => 22, - 'ssh_private_key' => null, + 'gorgone_communication_type' => '1', + 'gorgone_port' => 5556, 'init_script_centreontrapd' => 'centreontrapd', 'snmp_trapd_path_conf' => '/etc/snmp/centreon_traps/', ]; diff --git a/src/CentreonRemote/Domain/Resources/RemoteConfig/NagiosServer.php b/src/CentreonRemote/Domain/Resources/RemoteConfig/NagiosServer.php index 185ef53715d..3bf86044d45 100644 --- a/src/CentreonRemote/Domain/Resources/RemoteConfig/NagiosServer.php +++ b/src/CentreonRemote/Domain/Resources/RemoteConfig/NagiosServer.php @@ -7,6 +7,9 @@ */ class NagiosServer { + // ZMQ enum value + public const ZMQ = '1'; + /** * Get template configuration * @todo move it as yml @@ -34,8 +37,8 @@ public static function getConfiguration(string $name, string $ip): array 'centreonbroker_cfg_path' => '/etc/centreon-broker', 'centreonbroker_module_path' => '/usr/share/centreon/lib/centreon-broker', 'centreonconnector_path' => '/usr/lib64/centreon-connector', - 'ssh_port' => '22', - 'ssh_private_key' => null, + 'gorgone_communication_type' => self::ZMQ, + 'gorgone_port' => 5556, 'init_script_centreontrapd' => 'centreontrapd', 'snmp_trapd_path_conf' => '/etc/snmp/centreon_traps/', 'centreonbroker_logs_path' => '/var/log/centreon-broker/', diff --git a/src/Kernel.php b/src/Kernel.php index a8aec5903b5..32992fb7e9e 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -17,19 +17,28 @@ * For more information : contact@centreon.com * */ + namespace App; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Debug\Debug; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\Routing\RouteCollectionBuilder; +/** + * Class Kernel + * + * @package App + */ class Kernel extends BaseKernel { use MicroKernelTrait; + private static $instance; + /** * @var string cache path */ @@ -42,6 +51,31 @@ class Kernel extends BaseKernel private const CONFIG_EXTS = '.{php,xml,yaml,yml}'; + /** + * @return \App\Kernel + */ + public static function createForWeb(): Kernel + { + if (static::$instance === null) { + include_once __DIR__ . '/../config/bootstrap.php'; + if ($_SERVER['APP_DEBUG']) { + umask(0000); + + Debug::enable(); + } + static::$instance = new Kernel($_SERVER['APP_ENV'], (bool)$_SERVER['APP_DEBUG']); + static::$instance->boot(); + } + + return static::$instance; + } + + /** + * Kernel constructor. + * + * @param string $environment + * @param bool $debug + */ public function __construct(string $environment, bool $debug) { parent::__construct($environment, $debug); @@ -53,9 +87,12 @@ public function __construct(string $environment, bool $debug) } } + /** + * @return iterable + */ public function registerBundles(): iterable { - $contents = require $this->getProjectDir().'/config/bundles.php'; + $contents = require $this->getProjectDir() . '/config/bundles.php'; foreach ($contents as $class => $envs) { if ($envs[$this->environment] ?? $envs['all'] ?? false) { yield new $class(); @@ -63,40 +100,59 @@ public function registerBundles(): iterable } } + /** + * @return string + */ public function getProjectDir(): string { return \dirname(__DIR__); } + /** + * @return string + */ public function getCacheDir() { return $this->cacheDir; } + /** + * @return string + */ public function getLogDir() { return $this->logDir; } - + /** + * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container + * @param \Symfony\Component\Config\Loader\LoaderInterface $loader + * + * @throws \Exception + */ protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { - $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php')); + $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); $container->setParameter('container.dumper.inline_class_loader', true); - $confDir = $this->getProjectDir().'/config'; + $confDir = $this->getProjectDir() . '/config'; - $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); - $loader->load($confDir.'/{packages}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob'); - $loader->load($confDir.'/{services}'.self::CONFIG_EXTS, 'glob'); - $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/{packages}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); + $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); } + /** + * @param \Symfony\Component\Routing\RouteCollectionBuilder $routes + * + * @throws \Symfony\Component\Config\Exception\LoaderLoadException + */ protected function configureRoutes(RouteCollectionBuilder $routes): void { - $confDir = $this->getProjectDir().'/config'; + $confDir = $this->getProjectDir() . '/config'; - $routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob'); - $routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob'); - $routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob'); + $routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob'); + $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob'); + $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob'); } } diff --git a/symfony.lock b/symfony.lock index b5e28e2cfec..02fe47699f8 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,605 +1,5 @@ { - "adlawson/vfs": { - "version": "0.12.1" - }, - "behat/behat": { - "version": "v3.5.0" - }, - "behat/gherkin": { - "version": "v4.6.0" - }, - "behat/mink": { - "version": "1.7.x-dev" - }, - "behat/mink-extension": { - "version": "2.3.1" - }, - "behat/mink-selenium2-driver": { - "version": "v1.3.1" - }, - "behat/transliterator": { - "version": "v1.2.0" - }, - "centreon/centreon-test-lib": { - "version": "dev-mon-4113" - }, - "composer/xdebug-handler": { - "version": "1.3.3" - }, - "container-interop/container-interop": { - "version": "1.2.0" - }, - "curl/curl": { - "version": "1.9.3" - }, - "doctrine/annotations": { - "version": "1.0", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.0", - "ref": "cb4152ebcadbe620ea2261da1a1c5a9b8cea7672" - }, - "files": [ - "config/routes/annotations.yaml" - ] - }, - "doctrine/inflector": { - "version": "v1.3.0" - }, - "doctrine/instantiator": { - "version": "1.2.0" - }, - "doctrine/lexer": { - "version": "1.1.0" - }, - "friendsofsymfony/rest-bundle": { - "version": "2.2", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "master", - "version": "2.2", - "ref": "cad41ef93d6150067ae2bb3c7fd729492dff6f0a" - }, - "files": [ - "config/packages/fos_rest.yaml" - ] - }, - "guzzlehttp/guzzle": { - "version": "6.3.3" - }, - "guzzlehttp/promises": { - "version": "v1.3.1" - }, - "guzzlehttp/psr7": { - "version": "1.6.1" - }, - "instaclick/php-webdriver": { - "version": "1.4.5" - }, - "jean85/pretty-package-versions": { - "version": "1.2" - }, - "jms/metadata": { - "version": "1.7.0" - }, - "jms/parser-lib": { - "version": "1.0.0" - }, - "jms/serializer": { - "version": "1.14.0" - }, - "jms/serializer-bundle": { - "version": "2.0", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "master", - "version": "2.0", - "ref": "fe60ce509ef04a3f40da96e3979bc8d9b13b2372" - }, - "files": [ - "config/packages/dev/jms_serializer.yaml", - "config/packages/jms_serializer.yaml", - "config/packages/prod/jms_serializer.yaml" - ] - }, - "justinrainbow/json-schema": { - "version": "5.2.9" - }, - "mehr-als-nix/parallel": { - "version": "v1.0.0" - }, - "myclabs/deep-copy": { - "version": "1.9.3" - }, - "nelmio/cors-bundle": { - "version": "1.5", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.5", - "ref": "6e1f64cc0f55362be49764634e8f14ce34a033c6" - }, - "files": [ - "config/packages/nelmio_cors.yaml" - ] - }, - "nette/bootstrap": { - "version": "v3.0.1" - }, - "nette/di": { - "version": "v3.0.1" - }, - "nette/finder": { - "version": "v2.5.1" - }, - "nette/neon": { - "version": "v3.0.0" - }, - "nette/php-generator": { - "version": "v3.2.3" - }, - "nette/robot-loader": { - "version": "v3.2.0" - }, - "nette/schema": { - "version": "v1.0.1" - }, - "nette/utils": { - "version": "v3.0.2" - }, - "nikic/php-parser": { - "version": "v4.2.4" - }, - "ocramius/package-versions": { - "version": "1.4.0" - }, - "openpsa/quickform": { - "version": "v3.3.6.1" - }, - "pear/console_getopt": { - "version": "v1.4.2" - }, - "pear/pear-core-minimal": { - "version": "v1.10.9" - }, - "pear/pear_exception": { - "version": "v1.0.0" - }, - "phar-io/manifest": { - "version": "1.0.3" - }, - "phar-io/version": { - "version": "2.0.1" - }, - "phing/phing": { - "version": "3.0.0a3" - }, "php": { "version": "7.2" - }, - "phpcollection/phpcollection": { - "version": "0.5.0" - }, - "phpdocumentor/reflection-common": { - "version": "2.0.0" - }, - "phpdocumentor/reflection-docblock": { - "version": "4.3.2" - }, - "phpdocumentor/type-resolver": { - "version": "1.0.1" - }, - "phpoption/phpoption": { - "version": "1.5.0" - }, - "phpspec/prophecy": { - "version": "1.8.1" - }, - "phpstan/phpdoc-parser": { - "version": "0.3.5" - }, - "phpstan/phpstan": { - "version": "0.11.19" - }, - "phpunit/php-code-coverage": { - "version": "6.1.4" - }, - "phpunit/php-file-iterator": { - "version": "2.0.2" - }, - "phpunit/php-text-template": { - "version": "1.2.1" - }, - "phpunit/php-timer": { - "version": "2.1.2" - }, - "phpunit/php-token-stream": { - "version": "3.1.1" - }, - "phpunit/phpunit": { - "version": "4.7", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.7", - "ref": "33b1f53500a7b822985048baf55456aa5281405a" - }, - "files": [ - ".env.test", - "phpunit.xml.dist", - "config/bootstrap.php", - "tests/.gitignore" - ] - }, - "pimple/pimple": { - "version": "v3.2.3" - }, - "psr/cache": { - "version": "1.0.1" - }, - "psr/container": { - "version": "1.0.0" - }, - "psr/http-message": { - "version": "1.0.1" - }, - "psr/log": { - "version": "1.1.0" - }, - "ralouphie/getallheaders": { - "version": "3.0.3" - }, - "sebastian/code-unit-reverse-lookup": { - "version": "1.0.1" - }, - "sebastian/comparator": { - "version": "3.0.2" - }, - "sebastian/diff": { - "version": "3.0.2" - }, - "sebastian/environment": { - "version": "4.2.2" - }, - "sebastian/exporter": { - "version": "3.1.2" - }, - "sebastian/global-state": { - "version": "2.0.0" - }, - "sebastian/object-enumerator": { - "version": "3.0.3" - }, - "sebastian/object-reflector": { - "version": "1.1.1" - }, - "sebastian/recursion-context": { - "version": "3.0.0" - }, - "sebastian/resource-operations": { - "version": "2.0.1" - }, - "sebastian/version": { - "version": "2.0.1" - }, - "sensio/framework-extra-bundle": { - "version": "5.2", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.2", - "ref": "fb7e19da7f013d0d422fa9bce16f5c510e27609b" - }, - "files": [ - "config/packages/sensio_framework_extra.yaml" - ] - }, - "sensiolabs/security-checker": { - "version": "4.0", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.0", - "ref": "160c9b600564faa1224e8f387d49ef13ceb8b793" - }, - "files": [ - "config/packages/security_checker.yaml" - ] - }, - "smarty/smarty": { - "version": "v2.6.31" - }, - "squizlabs/php_codesniffer": { - "version": "2.9.2" - }, - "symfony/cache": { - "version": "v4.3.4" - }, - "symfony/cache-contracts": { - "version": "v1.1.5" - }, - "symfony/config": { - "version": "v4.3.4" - }, - "symfony/console": { - "version": "3.3", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "482d233eb8de91ebd042992077bbd5838858890c" - }, - "files": [ - "bin/console", - "config/bootstrap.php" - ] - }, - "symfony/css-selector": { - "version": "v4.3.4" - }, - "symfony/debug": { - "version": "v4.3.4" - }, - "symfony/dependency-injection": { - "version": "v4.3.4" - }, - "symfony/dotenv": { - "version": "v4.3.4" - }, - "symfony/error-handler": { - "version": "v4.4.5" - }, - "symfony/event-dispatcher": { - "version": "v4.3.4" - }, - "symfony/event-dispatcher-contracts": { - "version": "v1.1.5" - }, - "symfony/expression-language": { - "version": "v4.3.4" - }, - "symfony/filesystem": { - "version": "v4.3.4" - }, - "symfony/finder": { - "version": "v4.3.4" - }, - "symfony/flex": { - "version": "1.0", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.0", - "ref": "dc3fc2e0334a4137c47cfd5a3ececc601fa61a0b" - }, - "files": [ - ".env" - ] - }, - "symfony/framework-bundle": { - "version": "4.2", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.2", - "ref": "61ad963f28c091b8bb9449507654b9c7d8bbb53c" - }, - "files": [ - "config/bootstrap.php", - "config/packages/cache.yaml", - "config/packages/framework.yaml", - "config/packages/test/framework.yaml", - "config/services.yaml", - "public/index.php", - "src/Controller/.gitignore", - "src/Kernel.php" - ] - }, - "symfony/http-client": { - "version": "v4.3.5" - }, - "symfony/http-client-contracts": { - "version": "v1.1.7" - }, - "symfony/http-foundation": { - "version": "v4.3.4" - }, - "symfony/http-kernel": { - "version": "v4.3.4" - }, - "symfony/inflector": { - "version": "v4.3.4" - }, - "symfony/maker-bundle": { - "version": "1.0", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.0", - "ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f" - } - }, - "symfony/mime": { - "version": "v4.3.4" - }, - "symfony/options-resolver": { - "version": "v4.3.4" - }, - "symfony/phpunit-bridge": { - "version": "4.3", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.3", - "ref": "b0582341f1df39aaf3a9a866cdbe49937da35984" - }, - "files": [ - ".env.test", - "bin/phpunit", - "config/bootstrap.php", - "phpunit.xml.dist", - "tests/.gitignore" - ] - }, - "symfony/polyfill-intl-idn": { - "version": "v1.12.0" - }, - "symfony/polyfill-mbstring": { - "version": "v1.12.0" - }, - "symfony/polyfill-php72": { - "version": "v1.12.0" - }, - "symfony/polyfill-php73": { - "version": "v1.12.0" - }, - "symfony/profiler-pack": { - "version": "v1.0.4" - }, - "symfony/property-access": { - "version": "v4.3.4" - }, - "symfony/property-info": { - "version": "v4.3.4" - }, - "symfony/routing": { - "version": "4.2", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.2", - "ref": "4c107a8d23a16b997178fbd4103b8d2f54f688b7" - }, - "files": [ - "config/packages/dev/routing.yaml", - "config/packages/routing.yaml", - "config/packages/test/routing.yaml", - "config/routes.yaml" - ] - }, - "symfony/security-bundle": { - "version": "3.3", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "e5a0228251d1dd2bca4c8ef918e14423c06db625" - }, - "files": [ - "config/packages/security.yaml" - ] - }, - "symfony/security-core": { - "version": "v4.3.4" - }, - "symfony/security-csrf": { - "version": "v4.3.4" - }, - "symfony/security-guard": { - "version": "v4.3.4" - }, - "symfony/security-http": { - "version": "v4.3.4" - }, - "symfony/serializer": { - "version": "v4.3.4" - }, - "symfony/serializer-pack": { - "version": "v1.0.2" - }, - "symfony/service-contracts": { - "version": "v1.1.6" - }, - "symfony/stopwatch": { - "version": "v4.3.11" - }, - "symfony/translation": { - "version": "3.3", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "2ad9d2545bce8ca1a863e50e92141f0b9d87ffcd" - }, - "files": [ - "config/packages/translation.yaml", - "translations/.gitignore" - ] - }, - "symfony/translation-contracts": { - "version": "v1.1.6" - }, - "symfony/twig-bridge": { - "version": "v4.3.11" - }, - "symfony/twig-bundle": { - "version": "3.3", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "1da1987340b5ba64b16383906d678b989e3d096e" - }, - "files": [ - "config/packages/test/twig.yaml", - "config/packages/twig.yaml", - "config/routes/dev/twig.yaml", - "templates/base.html.twig" - ] - }, - "symfony/validator": { - "version": "4.3", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.3", - "ref": "d902da3e4952f18d3bf05aab29512eb61cabd869" - }, - "files": [ - "config/packages/test/validator.yaml", - "config/packages/validator.yaml" - ] - }, - "symfony/var-dumper": { - "version": "v4.3.11" - }, - "symfony/var-exporter": { - "version": "v4.3.4" - }, - "symfony/web-profiler-bundle": { - "version": "3.3", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6" - }, - "files": [ - "config/packages/dev/web_profiler.yaml", - "config/packages/test/web_profiler.yaml", - "config/routes/dev/web_profiler.yaml" - ] - }, - "symfony/yaml": { - "version": "v4.3.4" - }, - "theseer/tokenizer": { - "version": "1.1.3" - }, - "twig/twig": { - "version": "v2.12.3" - }, - "webmozart/assert": { - "version": "1.5.0" - }, - "willdurand/jsonp-callback-validator": { - "version": "v1.1.0" - }, - "willdurand/negotiation": { - "version": "v2.3.1" - }, - "zircote/swagger-php": { - "version": "3.0.2" } } diff --git a/tests/clapi_export/clapi-configuration.txt b/tests/clapi_export/clapi-configuration.txt index e1c76031ba4..4b20b2dcc54 100644 --- a/tests/clapi_export/clapi-configuration.txt +++ b/tests/clapi_export/clapi-configuration.txt @@ -53,7 +53,7 @@ ACLMENU;GRANTRW;test_access-group;0;Configuration;Pollers; ACLMENU;GRANTRW;test_access-group;0;Configuration;Pollers;Resources; ACLMENU;GRANTRW;test_access-group;0;Administration;Parameters;Centreon UI; ACLMENU;GRANTRW;test_access-group;0;Administration;Parameters;Monitoring; -ACLMENU;GRANTRW;test_access-group;0;Administration;Parameters;CentCore; +ACLMENU;GRANTRW;test_access-group;0;Administration;Parameters;Gorgone; ACLMENU;GRANTRW;test_access-group;0;Administration;Parameters;My Account; ACLMENU;GRANTRW;test_access-group;0;Administration;Parameters;LDAP; ACLMENU;GRANTRW;test_access-group;0;Administration;Parameters;RRDTool; @@ -94,7 +94,7 @@ ACLACTION;GRANT;Simple User;host_schedule_check; ACLACTION;GRANT;Simple User;host_schedule_forced_check; ACLACTION;GRANT;Simple User;host_schedule_downtime; ACLACTION;GRANT;Simple User;host_comment; -INSTANCE;ADD;Central;127.0.0.1;22 +INSTANCE;ADD;Central;127.0.0.1;1;5556 INSTANCE;setparam;Central;localhost;1 INSTANCE;setparam;Central;is_default;0 INSTANCE;setparam;Central;ns_activate;1 @@ -112,28 +112,8 @@ INSTANCE;setparam;Central;centreonbroker_module_path;/usr/share/centreon/lib/cen INSTANCE;setparam;Central;centreonconnector_path;/usr/lib64/centreon-connector INSTANCE;setparam;Central;init_script_centreontrapd;centreontrapd INSTANCE;setparam;Central;snmp_trapd_path_conf;/etc/snmp/centreon_traps/ -INSTANCE;setparam;Central;remote_server_centcore_ssh_proxy;1 +INSTANCE;setparam;Central;remote_server_use_as_proxy;1 INSTANCE;setparam;Central;updated;0 -INSTANCE;ADD;test_poller;127.0.0.1;22 -INSTANCE;setparam;test_poller;localhost;0 -INSTANCE;setparam;test_poller;is_default;0 -INSTANCE;setparam;test_poller;ns_activate;0 -INSTANCE;setparam;test_poller;ns_status;0 -INSTANCE;setparam;test_poller;engine_start_command;service centengine start -INSTANCE;setparam;test_poller;engine_stop_command;service centengine stop -INSTANCE;setparam;test_poller;engine_restart_command;service centengine restart -INSTANCE;setparam;test_poller;engine_reload_command;service centengine reload -INSTANCE;setparam;test_poller;nagios_bin;/usr/sbin/centengine -INSTANCE;setparam;test_poller;nagiostats_bin;/usr/sbin/centenginestats -INSTANCE;setparam;test_poller;nagios_perfdata;/var/log/centreon-engine/service-perfdata -INSTANCE;setparam;test_poller;broker_reload_command;service cbd reload -INSTANCE;setparam;test_poller;centreonbroker_cfg_path;/etc/centreon-broker -INSTANCE;setparam;test_poller;centreonbroker_module_path;/usr/share/centreon/lib/centreon-broker -INSTANCE;setparam;test_poller;centreonconnector_path;/usr/lib64/centreon-connector -INSTANCE;setparam;test_poller;init_script_centreontrapd;centreontrapd -INSTANCE;setparam;test_poller;snmp_trapd_path_conf;/etc/snmp/centreon_traps/ -INSTANCE;setparam;test_poller;remote_server_centcore_ssh_proxy;1 -INSTANCE;setparam;test_poller;updated;0 TP;ADD;24x7;Always TP;setparam;24x7;tp_sunday;00:00-24:00 TP;setparam;24x7;tp_monday;00:00-24:00 @@ -628,90 +608,6 @@ ENGINECFG;setparam;Centreon Engine Central;cfg_file;centengine.cfg ENGINECFG;setparam;Centreon Engine Central;log_pid;1 ENGINECFG;setparam;Centreon Engine Central;enable_macros_filter;0 ENGINECFG;setparam;Centreon Engine Central;broker_module;/usr/lib64/centreon-engine/externalcmd.so|/usr/lib64/nagios/cbmod.so /etc/centreon-broker/central-module.json -ENGINECFG;ADD;Centreon Engine Central_1;test_poller;Centreon Engine -ENGINECFG;setparam;Centreon Engine Central_1;log_file;/var/log/centreon-engine/centengine.log -ENGINECFG;setparam;Centreon Engine Central_1;cfg_dir;/etc/centreon-engine -ENGINECFG;setparam;Centreon Engine Central_1;temp_file;/var/log/centreon-engine/centengine.tmp -ENGINECFG;setparam;Centreon Engine Central_1;status_file;/var/log/centreon-engine/status.dat -ENGINECFG;setparam;Centreon Engine Central_1;nagios_user;centreon-engine -ENGINECFG;setparam;Centreon Engine Central_1;nagios_group;centreon-engine -ENGINECFG;setparam;Centreon Engine Central_1;enable_notifications;1 -ENGINECFG;setparam;Centreon Engine Central_1;execute_service_checks;1 -ENGINECFG;setparam;Centreon Engine Central_1;accept_passive_service_checks;1 -ENGINECFG;setparam;Centreon Engine Central_1;execute_host_checks;2 -ENGINECFG;setparam;Centreon Engine Central_1;accept_passive_host_checks;2 -ENGINECFG;setparam;Centreon Engine Central_1;enable_event_handlers;1 -ENGINECFG;setparam;Centreon Engine Central_1;log_rotation_method;d -ENGINECFG;setparam;Centreon Engine Central_1;log_archive_path;/var/log/centreon-engine/archives/ -ENGINECFG;setparam;Centreon Engine Central_1;check_external_commands;1 -ENGINECFG;setparam;Centreon Engine Central_1;command_check_interval;1s -ENGINECFG;setparam;Centreon Engine Central_1;command_file;/var/lib/centreon-engine/rw/centengine.cmd -ENGINECFG;setparam;Centreon Engine Central_1;lock_file;/var/lock/subsys/centengine.lock -ENGINECFG;setparam;Centreon Engine Central_1;retain_state_information;1 -ENGINECFG;setparam;Centreon Engine Central_1;state_retention_file;/var/log/centreon-engine/retention.dat -ENGINECFG;setparam;Centreon Engine Central_1;retention_update_interval;60 -ENGINECFG;setparam;Centreon Engine Central_1;use_retained_program_state;1 -ENGINECFG;setparam;Centreon Engine Central_1;use_retained_scheduling_info;1 -ENGINECFG;setparam;Centreon Engine Central_1;use_syslog;0 -ENGINECFG;setparam;Centreon Engine Central_1;log_notifications;1 -ENGINECFG;setparam;Centreon Engine Central_1;log_service_retries;1 -ENGINECFG;setparam;Centreon Engine Central_1;log_host_retries;1 -ENGINECFG;setparam;Centreon Engine Central_1;log_event_handlers;1 -ENGINECFG;setparam;Centreon Engine Central_1;log_external_commands;1 -ENGINECFG;setparam;Centreon Engine Central_1;log_passive_checks;2 -ENGINECFG;setparam;Centreon Engine Central_1;sleep_time;0.2 -ENGINECFG;setparam;Centreon Engine Central_1;service_inter_check_delay_method;s -ENGINECFG;setparam;Centreon Engine Central_1;service_interleave_factor;s -ENGINECFG;setparam;Centreon Engine Central_1;max_concurrent_checks;400 -ENGINECFG;setparam;Centreon Engine Central_1;max_service_check_spread;5 -ENGINECFG;setparam;Centreon Engine Central_1;check_result_reaper_frequency;5 -ENGINECFG;setparam;Centreon Engine Central_1;interval_length;60 -ENGINECFG;setparam;Centreon Engine Central_1;auto_reschedule_checks;2 -ENGINECFG;setparam;Centreon Engine Central_1;use_aggressive_host_checking;1 -ENGINECFG;setparam;Centreon Engine Central_1;enable_flap_detection;0 -ENGINECFG;setparam;Centreon Engine Central_1;low_service_flap_threshold;25.0 -ENGINECFG;setparam;Centreon Engine Central_1;high_service_flap_threshold;50.0 -ENGINECFG;setparam;Centreon Engine Central_1;low_host_flap_threshold;25.0 -ENGINECFG;setparam;Centreon Engine Central_1;high_host_flap_threshold;50.0 -ENGINECFG;setparam;Centreon Engine Central_1;soft_state_dependencies;0 -ENGINECFG;setparam;Centreon Engine Central_1;service_check_timeout;60 -ENGINECFG;setparam;Centreon Engine Central_1;host_check_timeout;12 -ENGINECFG;setparam;Centreon Engine Central_1;event_handler_timeout;30 -ENGINECFG;setparam;Centreon Engine Central_1;notification_timeout;30 -ENGINECFG;setparam;Centreon Engine Central_1;ocsp_timeout;5 -ENGINECFG;setparam;Centreon Engine Central_1;ochp_timeout;5 -ENGINECFG;setparam;Centreon Engine Central_1;perfdata_timeout;5 -ENGINECFG;setparam;Centreon Engine Central_1;obsess_over_services;0 -ENGINECFG;setparam;Centreon Engine Central_1;obsess_over_hosts;2 -ENGINECFG;setparam;Centreon Engine Central_1;process_performance_data;0 -ENGINECFG;setparam;Centreon Engine Central_1;host_perfdata_file_mode;2 -ENGINECFG;setparam;Centreon Engine Central_1;service_perfdata_file_mode;2 -ENGINECFG;setparam;Centreon Engine Central_1;check_for_orphaned_services;0 -ENGINECFG;setparam;Centreon Engine Central_1;check_for_orphaned_hosts;0 -ENGINECFG;setparam;Centreon Engine Central_1;check_service_freshness;1 -ENGINECFG;setparam;Centreon Engine Central_1;check_host_freshness;2 -ENGINECFG;setparam;Centreon Engine Central_1;date_format;euro -ENGINECFG;setparam;Centreon Engine Central_1;illegal_object_name_chars;~!$%^&*"|'<>?,()= -ENGINECFG;setparam;Centreon Engine Central_1;illegal_macro_output_chars;`~$^&"|'<> -ENGINECFG;setparam;Centreon Engine Central_1;use_regexp_matching;2 -ENGINECFG;setparam;Centreon Engine Central_1;use_true_regexp_matching;2 -ENGINECFG;setparam;Centreon Engine Central_1;admin_email;admin@localhost -ENGINECFG;setparam;Centreon Engine Central_1;admin_pager;admin -ENGINECFG;setparam;Centreon Engine Central_1;nagios_activate;1 -ENGINECFG;setparam;Centreon Engine Central_1;event_broker_options;-1 -ENGINECFG;setparam;Centreon Engine Central_1;enable_predictive_host_dependency_checks;2 -ENGINECFG;setparam;Centreon Engine Central_1;enable_predictive_service_dependency_checks;2 -ENGINECFG;setparam;Centreon Engine Central_1;cached_host_check_horizon;60 -ENGINECFG;setparam;Centreon Engine Central_1;use_large_installation_tweaks;2 -ENGINECFG;setparam;Centreon Engine Central_1;enable_environment_macros;2 -ENGINECFG;setparam;Centreon Engine Central_1;debug_file;/var/log/centreon-engine/centengine.debug -ENGINECFG;setparam;Centreon Engine Central_1;debug_level;0 -ENGINECFG;setparam;Centreon Engine Central_1;debug_level_opt;0 -ENGINECFG;setparam;Centreon Engine Central_1;debug_verbosity;2 -ENGINECFG;setparam;Centreon Engine Central_1;cfg_file;centengine.cfg -ENGINECFG;setparam;Centreon Engine Central_1;log_pid;1 -ENGINECFG;setparam;Centreon Engine Central_1;enable_macros_filter;0 -ENGINECFG;setparam;Centreon Engine Central_1;broker_module;/usr/lib64/centreon-engine/externalcmd.so|/usr/lib64/nagios/cbmod.so /etc/centreon-broker/central-module.json CONTACTTPL;ADD;contact_template;contact_template;;md5__d41d8cd98f00b204e9800998ecf8427e;0;1;;local CONTACTTPL;setparam;contact_template;hostnotifopt;n CONTACTTPL;setparam;contact_template;servicenotifopt;n diff --git a/tests/php/Centreon/Domain/ConfigurationLoader/YamlConfigurationLoaderTest.php b/tests/php/Centreon/Domain/ConfigurationLoader/YamlConfigurationLoaderTest.php new file mode 100644 index 00000000000..50c2bbca95e --- /dev/null +++ b/tests/php/Centreon/Domain/ConfigurationLoader/YamlConfigurationLoaderTest.php @@ -0,0 +1,88 @@ +load(); + $this->assertArrayHasKey('name', $configuration); + $this->assertEquals($configuration['name'], 'text1'); + + $this->assertArrayHasKey('tab', $configuration); + $this->assertIsArray($configuration['tab']); + $this->assertArrayHasKey('key1', $configuration['tab']); + $this->assertEquals($configuration['tab']['key1'], 'value1'); + $this->assertArrayHasKey('key2', $configuration['tab']); + $this->assertEquals($configuration['tab']['key2'], 'value2'); + + $this->assertArrayHasKey('child', $configuration); + $this->assertIsArray($configuration['child']); + $this->assertArrayHasKey('child_key', $configuration['child']); + $this->assertEquals($configuration['child']['child_key'], 'value_child_key'); + $this->assertArrayHasKey('child_key2', $configuration['child']); + $this->assertIsArray($configuration['child']['child_key2']); + $this->assertArrayHasKey('loop', $configuration['child']['child_key2']); + $this->assertEquals($configuration['child']['child_key2']['loop'], 'no loop'); + + $this->assertArrayHasKey('extra', $configuration['child']['child_key2']); + $this->assertIsArray($configuration['child']['child_key2']['extra']); + $this->assertArrayHasKey(0, $configuration['child']['child_key2']['extra']); + $this->assertArrayHasKey(1, $configuration['child']['child_key2']['extra']); + } + + /** + * This test is designed to detect a loop in file calls. + * + * @throws \FileNotFoundException + */ + public function testLoadWithLoop() + { + $this->expectException(\Exception::class); + $this->expectExceptionMessageRegExp("/^Loop detected in file.*child5\.yaml$/"); + $gcl = new YamlConfigurationLoader(__DIR__ . '/root_file_with_loop.yaml'); + $configuration = $gcl->load(); + } + + /*** + * This test is designed to test the FileNotFound Exception + * + * @throws \FileNotFoundException + */ + public function testFileNotFound() + { + $this->expectException(\FileNotFoundException::class); + $this->expectExceptionMessageRegExp("/^The configuration file '.*no_file\.yaml' does not exists$/"); + $gcl = new YamlConfigurationLoader(__DIR__ . '/no_file.yaml'); + $configuration = $gcl->load(); + } +} diff --git a/tests/php/Centreon/Domain/ConfigurationLoader/child1.yaml b/tests/php/Centreon/Domain/ConfigurationLoader/child1.yaml new file mode 100644 index 00000000000..44c6ab0d67a --- /dev/null +++ b/tests/php/Centreon/Domain/ConfigurationLoader/child1.yaml @@ -0,0 +1,2 @@ +child_key: value_child_key +child_key2: !include conf.d/child2.yaml \ No newline at end of file diff --git a/tests/php/Centreon/Domain/ConfigurationLoader/child3.yaml b/tests/php/Centreon/Domain/ConfigurationLoader/child3.yaml new file mode 100644 index 00000000000..f1dc820219d --- /dev/null +++ b/tests/php/Centreon/Domain/ConfigurationLoader/child3.yaml @@ -0,0 +1,2 @@ +child_key: value_child_key +child_key2: !include conf.d/child5.yaml \ No newline at end of file diff --git a/tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child2.yaml b/tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child2.yaml new file mode 100644 index 00000000000..920d2feb69d --- /dev/null +++ b/tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child2.yaml @@ -0,0 +1,2 @@ +loop: no loop +extra: !include child3.yaml \ No newline at end of file diff --git a/tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child3.yaml b/tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child3.yaml new file mode 100644 index 00000000000..0d674677c05 --- /dev/null +++ b/tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child3.yaml @@ -0,0 +1,4 @@ +- name: extra1 + value: value1 +- name: extra2 + value: value2 \ No newline at end of file diff --git a/tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child5.yaml b/tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child5.yaml new file mode 100644 index 00000000000..e4455f45526 --- /dev/null +++ b/tests/php/Centreon/Domain/ConfigurationLoader/conf.d/child5.yaml @@ -0,0 +1 @@ +loop: !include ../child3.yaml \ No newline at end of file diff --git a/tests/php/Centreon/Domain/ConfigurationLoader/root_file.yaml b/tests/php/Centreon/Domain/ConfigurationLoader/root_file.yaml new file mode 100644 index 00000000000..b2c0cac62b0 --- /dev/null +++ b/tests/php/Centreon/Domain/ConfigurationLoader/root_file.yaml @@ -0,0 +1,6 @@ +name: text1 +description: text2 +tab: + key1: value1 + key2: value2 +child: !include child1.yaml \ No newline at end of file diff --git a/tests/php/Centreon/Domain/ConfigurationLoader/root_file_with_loop.yaml b/tests/php/Centreon/Domain/ConfigurationLoader/root_file_with_loop.yaml new file mode 100644 index 00000000000..446ba8ed097 --- /dev/null +++ b/tests/php/Centreon/Domain/ConfigurationLoader/root_file_with_loop.yaml @@ -0,0 +1,6 @@ +name: text1 +description: text2 +tab: + key1: value1 + key2: value2 +child: !include child3.yaml \ No newline at end of file diff --git a/tests/php/Centreon/Domain/Gorgone/CommandServiceTest.php b/tests/php/Centreon/Domain/Gorgone/CommandServiceTest.php new file mode 100644 index 00000000000..96355afd717 --- /dev/null +++ b/tests/php/Centreon/Domain/Gorgone/CommandServiceTest.php @@ -0,0 +1,82 @@ +getMockBuilder(CommandRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $commandRepository->expects(self::any()) + ->method('send') + ->willReturn($mockToken); // values returned for the all next tests + + $responseRepository = $this + ->getMockBuilder(ResponseRepositoryInterface::class) + ->disableOriginalConstructor() + ->getMock(); + + $responseRepository->expects($this->at(0)) + ->method('getResponse') + ->with($thumbprintCommand) + ->willReturn($firstGorgoneResponse); + + $responseRepository->expects($this->at(1)) + ->method('getResponse') + ->with($thumbprintCommand) + ->willReturn($secondGorgoneResponse); + + $service = new GorgoneService($responseRepository, $commandRepository); + Response::setRepository($responseRepository); + + /** + * @var $gorgoneResponse ResponseInterface + */ + $gorgoneResponse = $service->send($thumbprintCommand); + do { + $lastResponse = $gorgoneResponse->getLastActionLog(); + } while ($lastResponse == null || $lastResponse->getCode() === ResponseInterface::STATUS_BEGIN); + $this->assertEquals($lastResponse->getToken(), $mockToken); + $data = json_decode($lastResponse->getData(), true); + $this->assertEquals($data['data']['thumbprint'], $mockThumprint); + } +} diff --git a/tests/php/Centreon/Domain/Gorgone/first_gorgone_response.json b/tests/php/Centreon/Domain/Gorgone/first_gorgone_response.json new file mode 100644 index 00000000000..3de90acf815 --- /dev/null +++ b/tests/php/Centreon/Domain/Gorgone/first_gorgone_response.json @@ -0,0 +1,6 @@ +{ + "error": "no_log", + "message": "No log found for token", + "data": [], + "token": "86ca0747484d947" +} \ No newline at end of file diff --git a/tests/php/Centreon/Domain/Gorgone/second_gorgone_response.json b/tests/php/Centreon/Domain/Gorgone/second_gorgone_response.json new file mode 100644 index 00000000000..3eeb500caa5 --- /dev/null +++ b/tests/php/Centreon/Domain/Gorgone/second_gorgone_response.json @@ -0,0 +1,15 @@ +{ + "data": [ + { + "ctime": 1580111351, + "etime": 1580111330, + "id": "278503", + "instant": 0, + "data": "{\"action\":\"getthumbprint\",\"data\":{\"thumbprint\":\"6pX4rBssjlEV1YBHwLFRPyfRE_MvdwTKY5wsBq48cRw\"},\"message\":\"ok\"}", + "token": "86ca0747484d947", + "code": 2 + } + ], + "token": "86ca0747484d947", + "message": "Logs found" +} \ No newline at end of file diff --git a/tests/rest_api/rest_api.postman_collection.json b/tests/rest_api/rest_api.postman_collection.json index b69feedc7a8..b084709cac3 100644 --- a/tests/rest_api/rest_api.postman_collection.json +++ b/tests/rest_api/rest_api.postman_collection.json @@ -1,71151 +1,71132 @@ { - "info": { - "_postman_id": "977609fc-e339-4f33-bddc-7eec145a0f55", - "name": "Centreon Web Rest API", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "00-Configure_Poller", - "item": [ - { - "name": "Authenticate", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "postman.setEnvironmentVariable(\"token\",jsonData.authToken);" - ] - } - } - ], - "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": "Add Instance", - "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\": \"instance\",\n \"values\": \"test_instance;01.02.3.04;42;nagios\"\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 name", - "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\": \"instance\",\n \"values\": \"test_instance;name;{{instance_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 localhost", - "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\": \"instance\",\n \"values\": \"{{instance_name}};localhost;{{instance_localhost}}\"\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 ns_ip_address", - "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\": \"instance\",\n \"values\": \"{{instance_name}};ns_ip_address;{{instance_address}}\"\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 ns_activate", - "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\": \"instance\",\n \"values\": \"{{instance_name}};ns_activate;{{instance_activate}}\"\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 nagios_bin", - "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\": \"instance\",\n \"values\": \"{{instance_name}};nagios_bin;{{instance_nagios_bin}}\"\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 nagiostats_bin", - "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\": \"instance\",\n \"values\": \"{{instance_name}};nagiostats_bin;{{instance_nagiostats_bin}}\"\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 nagios_perfdata", - "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\": \"instance\",\n \"values\": \"{{instance_name}};nagios_perfdata;{{instance_nagios_perfdata}}\"\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 ssh_port", - "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\": \"instance\",\n \"values\": \"{{instance_name}};ssh_port;{{instance_ssh_port}}\"\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 centreonbroker_cfg_path", - "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\": \"instance\",\n \"values\": \"{{instance_name}};centreonbroker_cfg_path;{{instance_broker_cfg_path}}\"\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 centreonbroker_module_path", - "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\": \"instance\",\n \"values\": \"{{instance_name}};centreonbroker_module_path;{{instance_broker_module_path}}\"\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 instances", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var instanceData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of instances\"] = instanceData;", - " var i = 0;", - " while (i < instanceData.length) {", - " if (postman.getEnvironmentVariable(\"instance_name\") == instanceData[i].name) {", - " tests[\"Body contains added instance\"] = postman.getEnvironmentVariable(\"instance_name\") == instanceData[i].name;", - " tests[\"Body contains added instance_localhost\"] = postman.getEnvironmentVariable(\"instance_localhost\") == instanceData[i].localhost;", - " tests[\"Body contains added instance_address\"] = postman.getEnvironmentVariable(\"instance_address\") == instanceData[i]['ip address'];", - " tests[\"Body contains added instance_activate\"] = postman.getEnvironmentVariable(\"instance_activate\") == instanceData[i].activate;", - " tests[\"Body contains added instance_engine_start_command\"] = postman.getEnvironmentVariable(\"instance_engine_start_command\") == instanceData[i]['init script'];", - " tests[\"Body contains added instance_engine_stop_command\"] = postman.getEnvironmentVariable(\"instance_engine_stop_command\") == instanceData[i]['init script'];", - " tests[\"Body contains added instance_engine_restart_command\"] = postman.getEnvironmentVariable(\"instance_engine_restart_command\") == instanceData[i]['init script'];", - " tests[\"Body contains added instance_engine_reload_command\"] = postman.getEnvironmentVariable(\"instance_engine_reload_command\") == instanceData[i]['init script'];", - " tests[\"Body contains added instance_nagios_bin\"] = postman.getEnvironmentVariable(\"instance_nagios_bin\") == instanceData[i].bin;", - " tests[\"Body contains added instance_nagiostats_bin\"] = postman.getEnvironmentVariable(\"instance_nagiostats_bin\") == instanceData[i]['stats bin'];", - " tests[\"Body contains added instance_ssh_port\"] = postman.getEnvironmentVariable(\"instance_ssh_port\") == instanceData[i]['ssh port'];", - " break;", - " }", - " i++;", - " }", - " if (i == instanceData.length)", - " tests[\"instance_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"instance\"\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": "Create host2", - "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_name2}};0.0.0.0;;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": "Create Instance-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\": \"instance\",\n \"values\": \"{{instance_name2}};01.3.04.65;98;nagios\"\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": "Setinstance 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\": \"setinstance\",\n \"object\": \"host\",\n \"values\": \"{{host_name2}};{{instance_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": "Gethosts", - "event": [ - { - "listen": "test", - "script": { - "id": "e14c0905-a615-4b2a-8d10-d6e67a24d0b6", - "exec": [ - "tests[\"Status code is 200\"] = responseCode.code === 200;", - "", - "var contentType = postman.getResponseHeader(\"Content-Type\");", - "", - "tests[\"Content-Type is present\"] = contentType !== null;", - "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", - "", - "var jsonData = JSON.parse(responseBody);", - "var hostData = jsonData.result;", - "", - "tests[\"Body contains entries\"] = hostData.length > 0;", - "", - "var schema = 0;", - "if (hostData[0].id && hostData[0].name && hostData[0].address) {", - " schema = 1;", - "}", - "tests[\"Validate schema\"] = schema == 1;", - "", - "var pattern = /^_Module_/;", - "var hostMetaPresent = false;", - "var hostPresent = false;", - "", - "hostData.forEach(function(host) {", - " if (pattern.test(host.name) === true) {", - " hostMetaPresent = true;", - " }", - " ", - " if ((host.name == postman.getEnvironmentVariable(\"host_name2\")) && (host.address == \"0.0.0.0\")) {", - " hostPresent = true;", - " }", - "});", - "", - "tests[\"Configured host present\"] = hostPresent === true;", - "tests[\"No _Module host present\"] = hostMetaPresent === false;" - ], - "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\": \"gethosts\",\n \"object\": \"instance\",\n \"values\": \"{{instance_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": "01-Configure_Centreon_Engine", - "item": [ - { - "name": "Add resource CFG", - "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\": \"resourcecfg\",\n \"values\": \"test_resourcecfg;test_value;{{instance_name}};test_comment\"\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": "Get ressource id", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var resourceData = jsonData.result;", - "", - "try {", - " var i = 0;", - " while (i < resourceData.length) {", - " if (\"$test_resourcecfg$\" == resourceData[i].name) {", - " postman.setEnvironmentVariable(\"resourcecfg_id\",resourceData[i].id);", - " break;", - " }", - " i++;", - " }", - " if (i == resourceData.length)", - " tests[\"the resourcecfg was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"resourcecfg\"\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 name", - "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};name;{{rcfg_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 value", - "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};value;{{rcfg_value}}\"\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 activate", - "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};activate;{{rcfg_activate}}\"\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 comment", - "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};comment;{{rcfg_comment}}\"\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 instance", - "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};instance;{{rcfg_instance}}\"\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 resource CFG", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var rcfgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of resources CFG\"] = rcfgData;", - " var i = 0;", - " var rcfgname = \"$\"+ postman.getEnvironmentVariable(\"rcfg_name\") + \"$\";", - " while (i < rcfgData.length) {", - " if (rcfgname == rcfgData[i].name) {", - " tests[\"Body contains added resource CFG\"] = rcfgname == rcfgData[i].name;", - " tests[\"Body contains added rcfg_value\"] = postman.getEnvironmentVariable(\"rcfg_value\") == rcfgData[i].value;", - " tests[\"Body contains added rcfg_comment\"] = postman.getEnvironmentVariable(\"rcfg_comment\") == rcfgData[i].comment;", - " tests[\"Body contains added rcfg_activate\"] = postman.getEnvironmentVariable(\"rcfg_activate\") == rcfgData[i].activate;", - " tests[\"Body contains added rcfg_instance\"] = postman.getEnvironmentVariable(\"rcfg_instance\") == rcfgData[i].instance;", - " break;", - " }", - " i++;", - " }", - " if (i == rcfgData.length)", - " tests[\"rcfg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"resourcecfg\"\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": "02-Configure_Centreon_Broker", - "item": [ - { - "name": "Add broker", - "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\": \"centbrokercfg\",\n \"values\": \"broker_test;{{instance_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 name", - "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\": \"centbrokercfg\",\n \"values\": \"broker_test;name;{{broker_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": "List brokers", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var brokerData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of brokers\"] = brokerData;", - " var i = 0;", - " while (i < brokerData.length) {", - " if (postman.getEnvironmentVariable(\"broker_name\") == brokerData[i]['config name']) {", - " tests[\"Body contains added broker_name\"] = postman.getEnvironmentVariable(\"broker_name\") == brokerData[i]['config name'];", - " tests[\"Body contains added instance_name\"] = postman.getEnvironmentVariable(\"instance_name\") == brokerData[i].instance;", - " break;", - " }", - " i++;", - " }", - " if (i == brokerData.length)", - " tests[\"broker_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"centbrokercfg\"\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 filename", - "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};filename;{{broker_filename}}\"\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 instance", - "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};instance;{{instance_name2}}\"\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 event_queue_max_size", - "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};event_queue_max_size;{{broker_event_queue_max_size}}\"\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 cache_directory", - "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};cache_directory;{{broker_cache_directory}}\"\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 daemon", - "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};daemon;{{broker_daemon}}\"\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 stats_activate", - "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};stats_activate;{{broker_stats_activate}}\"\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": "Addinput ipv4", - "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\": \"addinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_name_ipv4}};ipv4;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": "Get input_key ipv4", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var inputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of inputs\"] = inputData;", - " var i = 0;", - " while (i < inputData.length) {", - " if (postman.getEnvironmentVariable(\"input_name_ipv4\") == inputData[i].name) {", - " postman.setEnvironmentVariable(\"input_ipv4_id\",inputData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == inputData.length){", - " tests[\"input_name_ipv4 was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setinput buffering_timeout", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};buffering_timeout;{{input_buffering_timeout}}\"\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": "Setinput compression", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};compression;{{input_compression}}\"\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": "Setinput compression_buffer", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};compression_buffer;{{input_compression_buffer}}\"\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": "Setinput compression_level", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};compression_level;{{input_compression_level}}\"\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": "Setinput retry_interval", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};retry_interval;{{input_retry_interval}}\"\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": "Setinput 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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};category;{{input_category}}\"\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": "Setinput ca_certificate", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};ca_certificate;{{input_ca_certificate}}\"\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": "Setinput 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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};host;{{input_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": "Setinput one_peer_retention_mode", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};one_peer_retention_mode;{{input_one_peer_retention_mode}}\"\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": "Setinput port", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};port;{{input_port}}\"\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": "Setinput private_key", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};private_key;{{input_private_key}}\"\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": "Setinput protocol", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};protocol;{{input_protocol}}\"\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": "Setinput public_cert", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};public_cert;{{input_public_cert}}\"\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": "Setinput tls", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};tls;{{input_tls}}\"\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": "Getinput ipv4", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var inputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of inputs\"] = inputData;", - " for (var i = 0; i < inputData.length; i++) {", - " switch (inputData[i]['parameter key'])", - " {", - " case \"buffering_timeout\":", - " tests[\"Body contains added input_buffering_timeout\"] = postman.getEnvironmentVariable(\"input_buffering_timeout\") == inputData[i]['parameter value'];", - " break;", - " case \"category\":", - " tests[\"Body contains added input_category\"] = postman.getEnvironmentVariable(\"input_category\") == inputData[i]['parameter value'];", - " break;", - " case \"ca_certificate\":", - " tests[\"Body contains added input_ca_certificate\"] = postman.getEnvironmentVariable(\"input_ca_certificate\") == inputData[i]['parameter value'];", - " break;", - " case \"compression\":", - " tests[\"Body contains added input_compression\"] = postman.getEnvironmentVariable(\"input_compression\") == inputData[i]['parameter value'];", - " break;", - " case \"compression_buffer\":", - " tests[\"Body contains added input_compression_buffer\"] = postman.getEnvironmentVariable(\"input_compression_buffer\") == inputData[i]['parameter value'];", - " break;", - " case \"compression_level\":", - " tests[\"Body contains added input_compression_level\"] = postman.getEnvironmentVariable(\"input_compression_level\") == inputData[i]['parameter value'];", - " break;", - " case \"host\":", - " tests[\"Body contains added input_host\"] = postman.getEnvironmentVariable(\"input_host\") == inputData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added input_name\"] = postman.getEnvironmentVariable(\"input_name_ipv4\") == inputData[i]['parameter value'];", - " break;", - " case \"one_peer_retention_mode\":", - " tests[\"Body contains added input_one_peer_retention_mode\"] = postman.getEnvironmentVariable(\"input_one_peer_retention_mode\") == inputData[i]['parameter value'];", - " break;", - " case \"port\":", - " tests[\"Body contains added port\"] = postman.getEnvironmentVariable(\"input_port\") == inputData[i]['parameter value'];", - " break;", - " case \"private_key\":", - " tests[\"Body contains added input_private_key\"] = postman.getEnvironmentVariable(\"input_private_key\") == inputData[i]['parameter value'];", - " break;", - " case \"protocol\":", - " tests[\"Body contains added input_protocol\"] = postman.getEnvironmentVariable(\"input_protocol\") == inputData[i]['parameter value'];", - " break;", - " case \"public_cert\":", - " tests[\"Body contains added input_public_cert\"] = postman.getEnvironmentVariable(\"input_public_cert\") == inputData[i]['parameter value'];", - " break;", - " case \"retry_interval\":", - " tests[\"Body contains added input_retry_interval\"] = postman.getEnvironmentVariable(\"input_retry_interval\") == inputData[i]['parameter value'];", - " break;", - " case \"tls\":", - " tests[\"Body contains added input_tls\"] = postman.getEnvironmentVariable(\"input_tls\") == intputData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body containts added input_type\"] = \"ipv4\" == inputData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_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": [] - }, - { - "name": "Addinput ipv6", - "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\": \"addinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_name_ipv6}};ipv6;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": "Get input_key ipv6", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var inputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of inputs\"] = inputData;", - " var i = 0;", - " while (i < inputData.length) {", - " if (postman.getEnvironmentVariable(\"input_name_ipv6\") == inputData[i].name) {", - " postman.setEnvironmentVariable(\"input_ipv6_id\",inputData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == inputData.length){", - " tests[\"input_name_ipv6 was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setinput buffering_timeout", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};buffering_timeout;{{input_buffering_timeout}}\"\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": "Setinput compression", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};compression;{{input_compression}}\"\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": "Setinput compression_buffer", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};compression_buffer;{{input_compression_buffer}}\"\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": "Setinput compression_level", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};compression_level;{{input_compression_level}}\"\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": "Setinput retry_interval", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};retry_interval;{{input_retry_interval}}\"\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": "Setinput 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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};category;{{input_category}}\"\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": "Setinput ca_certificate", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};ca_certificate;{{input_ca_certificate}}\"\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": "Setinput 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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};host;{{input_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": "Setinput one_peer_retention_mode", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};one_peer_retention_mode;{{input_one_peer_retention_mode}}\"\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": "Setinput port", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};port;{{input_port}}\"\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": "Setinput private_key", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};private_key;{{input_private_key}}\"\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": "Setinput protocol", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};protocol;{{input_protocol}}\"\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": "Setinput public_cert", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};public_cert;{{input_public_cert}}\"\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": "Setinput tls", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};tls;{{input_tls}}\"\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": "Getinput ipv6", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var inputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of inputs\"] = inputData;", - " for (var i = 0; i < inputData.length; i++) {", - " switch (inputData[i]['parameter key'])", - " {", - " case \"buffering_timeout\":", - " tests[\"Body contains added input_buffering_timeout\"] = postman.getEnvironmentVariable(\"input_buffering_timeout\") == inputData[i]['parameter value'];", - " break;", - " case \"category\":", - " tests[\"Body contains added input_category\"] = postman.getEnvironmentVariable(\"input_category\") == inputData[i]['parameter value'];", - " break;", - " case \"ca_certificate\":", - " tests[\"Body contains added input_ca_certificate\"] = postman.getEnvironmentVariable(\"input_ca_certificate\") == inputData[i]['parameter value'];", - " break;", - " case \"compression\":", - " tests[\"Body contains added input_compression\"] = postman.getEnvironmentVariable(\"input_compression\") == inputData[i]['parameter value'];", - " break;", - " case \"compression_buffer\":", - " tests[\"Body contains added input_compression_buffer\"] = postman.getEnvironmentVariable(\"input_compression_buffer\") == inputData[i]['parameter value'];", - " break;", - " case \"compression_level\":", - " tests[\"Body contains added input_compression_level\"] = postman.getEnvironmentVariable(\"input_compression_level\") == inputData[i]['parameter value'];", - " break;", - " case \"host\":", - " tests[\"Body contains added input_host\"] = postman.getEnvironmentVariable(\"input_host\") == inputData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added input_name\"] = postman.getEnvironmentVariable(\"input_name_ipv6\") == inputData[i]['parameter value'];", - " break;", - " case \"one_peer_retention_mode\":", - " tests[\"Body contains added input_one_peer_retention_mode\"] = postman.getEnvironmentVariable(\"input_one_peer_retention_mode\") == inputData[i]['parameter value'];", - " break;", - " case \"port\":", - " tests[\"Body contains added port\"] = postman.getEnvironmentVariable(\"input_port\") == inputData[i]['parameter value'];", - " break;", - " case \"private_key\":", - " tests[\"Body contains added input_private_key\"] = postman.getEnvironmentVariable(\"input_private_key\") == inputData[i]['parameter value'];", - " break;", - " case \"protocol\":", - " tests[\"Body contains added input_protocol\"] = postman.getEnvironmentVariable(\"input_protocol\") == inputData[i]['parameter value'];", - " break;", - " case \"public_cert\":", - " tests[\"Body contains added input_public_cert\"] = postman.getEnvironmentVariable(\"input_public_cert\") == inputData[i]['parameter value'];", - " break;", - " case \"retry_interval\":", - " tests[\"Body contains added input_retry_interval\"] = postman.getEnvironmentVariable(\"input_retry_interval\") == inputData[i]['parameter value'];", - " break;", - " case \"tls\":", - " tests[\"Body contains added input_tls\"] = postman.getEnvironmentVariable(\"input_tls\") == intputData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body containts added input_type\"] = \"ipv6\" == inputData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_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": [] - }, - { - "name": "Addinput file", - "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\": \"addinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_name_file}};file;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": "Get input_key file", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var inputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of inputs\"] = inputData;", - " var i = 0;", - " while (i < inputData.length) {", - " if (postman.getEnvironmentVariable(\"input_name_file\") == inputData[i].name) {", - " postman.setEnvironmentVariable(\"input_file_id\",inputData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == inputData.length){", - " tests[\"input_name_file was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setinput buffering_timeout", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};buffering_timeout;{{input_buffering_timeout}}\"\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": "Setinput compression", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};compression;{{input_compression}}\"\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": "Setinput compression_buffer", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};compression_buffer;{{input_compression_buffer}}\"\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": "Setinput compression_level", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};compression_level;{{input_compression_level}}\"\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": "Setinput retry_interval", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};retry_interval;{{input_retry_interval}}\"\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": "Setinput protocol", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};protocol;{{input_protocol}}\"\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": "Setinput max_size", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};max_size;{{input_max_size}}\"\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": "Setinput path", - "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};path;{{input_path}}\"\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": "Getinput file", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var inputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of inputs\"] = inputData;", - " for (var i = 0; i < inputData.length; i++) {", - " switch (inputData[i]['parameter key'])", - " {", - " case \"buffering_timeout\":", - " tests[\"Body contains added input_buffering_timeout\"] = postman.getEnvironmentVariable(\"input_buffering_timeout\") == inputData[i]['parameter value'];", - " break;", - " case \"compression\":", - " tests[\"Body contains added input_compression\"] = postman.getEnvironmentVariable(\"input_compression\") == inputData[i]['parameter value'];", - " break;", - " case \"compression_buffer\":", - " tests[\"Body contains added input_compression_buffer\"] = postman.getEnvironmentVariable(\"input_compression_buffer\") == inputData[i]['parameter value'];", - " break;", - " case \"compression_level\":", - " tests[\"Body contains added input_compression_level\"] = postman.getEnvironmentVariable(\"input_compression_level\") == inputData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added input_name\"] = postman.getEnvironmentVariable(\"input_name_file\") == inputData[i]['parameter value'];", - " break;", - " case \"protocol\":", - " tests[\"Body contains added input_protocol\"] = postman.getEnvironmentVariable(\"input_protocol\") == inputData[i]['parameter value'];", - " break;", - " case \"retry_interval\":", - " tests[\"Body contains added input_retry_interval\"] = postman.getEnvironmentVariable(\"input_retry_interval\") == inputData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added input_type\"] = \"file\" == inputData[i]['parameter value'];", - " break;", - " case \"max_size\":", - " tests[\"Body contains added input_max_size\"] = postman.getEnvironmentVariable(\"input_max_size\") == inputData[i]['parameter value'];", - " break;", - " case \"path\":", - " tests[\"Body contains added input_path\"] = postman.getEnvironmentVariable(\"input_path\") == inputData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_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": [] - }, - { - "name": "Addlogger file", - "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\": \"addlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};logger_file_test;file;2\"\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": "Get logger_key file", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var loggerData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of loggers\"] = loggerData;", - " var i = 0;", - " while (i < loggerData.length) {", - " if (\"logger_file_test\" == loggerData[i].name) {", - " postman.setEnvironmentVariable(\"logger_file_id\",loggerData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == loggerData.length){", - " tests[\"logger_file_test was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setlogger config", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};config;{{logger_config}}\"\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": "Setlogger debug", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};debug;{{logger_debug}}\"\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": "Setlogger error", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};error;{{logger_error}}\"\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": "Setlogger info", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};info;{{logger_info}}\"\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": "Setlogger level", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};level;{{logger_level}}\"\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": "Setlogger max_size", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};max_size;{{logger_max_size}}\"\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": "Setlogger name", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};name;{{logger_name_file}}\"\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": "Getlogger file", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var loggerData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of loggers\"] = loggerData;", - " for (var i = 0; i < loggerData.length; i++) {", - " switch (loggerData[i]['parameter key'])", - " {", - " case \"config\":", - " tests[\"Body contains added logger_config\"] = postman.getEnvironmentVariable(\"logger_config\") == loggerData[i]['parameter value'];", - " break;", - " case \"debug\":", - " tests[\"Body contains added logger_debug\"] = postman.getEnvironmentVariable(\"logger_debug\") == loggerData[i]['parameter value'];", - " break;", - " case \"error\":", - " tests[\"Body contains added logger_error\"] = postman.getEnvironmentVariable(\"logger_error\") == loggerData[i]['parameter value'];", - " break;", - " case \"info\":", - " tests[\"Body contains added logger_info\"] = postman.getEnvironmentVariable(\"logger_info\") == loggerData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added logger_name\"] = postman.getEnvironmentVariable(\"logger_name_file\") == loggerData[i]['parameter value'];", - " break;", - " case \"level\":", - " tests[\"Body contains added logger_level\"] = postman.getEnvironmentVariable(\"logger_level\") == loggerData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added logger_type\"] = \"file\" == loggerData[i]['parameter value'];", - " break;", - " case \"max_size\":", - " tests[\"Body contains added logger_max_size\"] = postman.getEnvironmentVariable(\"logger_max_size\") == loggerData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_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": [] - }, - { - "name": "Addlogger standard", - "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\": \"addlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};logger_standard_test;standard;2\"\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": "Get logger_key standard", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var loggerData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of loggers\"] = loggerData;", - " var i = 0;", - " while (i < loggerData.length) {", - " if (\"logger_standard_test\" == loggerData[i].name) {", - " postman.setEnvironmentVariable(\"logger_standard_id\",loggerData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == loggerData.length){", - " tests[\"logger_standard_test was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setlogger config", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};config;{{logger_config}}\"\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": "Setlogger debug", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};debug;{{logger_debug}}\"\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": "Setlogger error", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};error;{{logger_error}}\"\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": "Setlogger info", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};info;{{logger_info}}\"\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": "Setlogger level", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};level;{{logger_level}}\"\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": "Setlogger name", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};name;{{logger_name_standard}}\"\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": "Getlogger standard", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var loggerData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of loggers\"] = loggerData;", - " for (var i = 0; i < loggerData.length; i++) {", - " switch (loggerData[i]['parameter key'])", - " {", - " case \"config\":", - " tests[\"Body contains added logger_config\"] = postman.getEnvironmentVariable(\"logger_config\") == loggerData[i]['parameter value'];", - " break;", - " case \"debug\":", - " tests[\"Body contains added logger_debug\"] = postman.getEnvironmentVariable(\"logger_debug\") == loggerData[i]['parameter value'];", - " break;", - " case \"error\":", - " tests[\"Body contains added logger_error\"] = postman.getEnvironmentVariable(\"logger_error\") == loggerData[i]['parameter value'];", - " break;", - " case \"info\":", - " tests[\"Body contains added logger_info\"] = postman.getEnvironmentVariable(\"logger_info\") == loggerData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added logger_name\"] = postman.getEnvironmentVariable(\"logger_name_standard\") == loggerData[i]['parameter value'];", - " break;", - " case \"level\":", - " tests[\"Body contains added logger_level\"] = postman.getEnvironmentVariable(\"logger_level\") == loggerData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added logger_type\"] = \"standard\" == loggerData[i]['parameter value'];", - " break;", - " case \"max_size\":", - " tests[\"Body contains added logger_max_size\"] = postman.getEnvironmentVariable(\"logger_max_size\") == loggerData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_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": [] - }, - { - "name": "Addlogger syslog", - "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\": \"addlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_name_syslog}};syslog;2\"\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": "Get logger_key syslog", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var loggerData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of loggers\"] = loggerData;", - " var i = 0;", - " while (i < loggerData.length) {", - " if (postman.getEnvironmentVariable(\"logger_name_syslog\") == loggerData[i].name) {", - " postman.setEnvironmentVariable(\"logger_syslog_id\",loggerData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == loggerData.length){", - " tests[\"logger_name_syslog was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setlogger config", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};config;{{logger_config}}\"\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": "Setlogger debug", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};debug;{{logger_debug}}\"\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": "Setlogger error", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};error;{{logger_error}}\"\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": "Setlogger info", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};info;{{logger_info}}\"\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": "Setlogger level", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};level;{{logger_level}}\"\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": "Getlogger syslog", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var loggerData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of loggers\"] = loggerData;", - " for (var i = 0; i < loggerData.length; i++) {", - " switch (loggerData[i]['parameter key'])", - " {", - " case \"config\":", - " tests[\"Body contains added logger_config\"] = postman.getEnvironmentVariable(\"logger_config\") == loggerData[i]['parameter value'];", - " break;", - " case \"debug\":", - " tests[\"Body contains added logger_debug\"] = postman.getEnvironmentVariable(\"logger_debug\") == loggerData[i]['parameter value'];", - " break;", - " case \"error\":", - " tests[\"Body contains added logger_error\"] = postman.getEnvironmentVariable(\"logger_error\") == loggerData[i]['parameter value'];", - " break;", - " case \"info\":", - " tests[\"Body contains added logger_info\"] = postman.getEnvironmentVariable(\"logger_info\") == loggerData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added logger_name\"] = postman.getEnvironmentVariable(\"logger_name_syslog\") == loggerData[i]['parameter value'];", - " break;", - " case \"level\":", - " tests[\"Body contains added logger_level\"] = postman.getEnvironmentVariable(\"logger_level\") == loggerData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added logger_type\"] = \"syslog\" == loggerData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_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": [] - }, - { - "name": "Addlogger monitoring", - "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\": \"addlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};logger_monitoring_test;monitoring;2\"\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": "Get logger_key monitoring", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var loggerData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of loggers\"] = loggerData;", - " var i = 0;", - " while (i < loggerData.length) {", - " if (\"logger_monitoring_test\" == loggerData[i].name) {", - " postman.setEnvironmentVariable(\"logger_monitoring_id\",loggerData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == loggerData.length){", - " tests[\"logger_monitoring_test was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setlogger config", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};config;{{logger_config}}\"\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": "Setlogger debug", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};debug;{{logger_debug}}\"\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": "Setlogger error", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};error;{{logger_error}}\"\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": "Setlogger info", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};info;{{logger_info}}\"\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": "Setlogger level", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};level;{{logger_level}}\"\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": "Setlogger name", - "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};name;{{logger_name_monitoring}}\"\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": "Getlogger monitoring", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var loggerData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of loggers\"] = loggerData;", - " for (var i = 0; i < loggerData.length; i++) {", - " switch (loggerData[i]['parameter key'])", - " {", - " case \"config\":", - " tests[\"Body contains added logger_config\"] = postman.getEnvironmentVariable(\"logger_config\") == loggerData[i]['parameter value'];", - " break;", - " case \"debug\":", - " tests[\"Body contains added logger_debug\"] = postman.getEnvironmentVariable(\"logger_debug\") == loggerData[i]['parameter value'];", - " break;", - " case \"error\":", - " tests[\"Body contains added logger_error\"] = postman.getEnvironmentVariable(\"logger_error\") == loggerData[i]['parameter value'];", - " break;", - " case \"info\":", - " tests[\"Body contains added logger_info\"] = postman.getEnvironmentVariable(\"logger_info\") == loggerData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added logger_name\"] = postman.getEnvironmentVariable(\"logger_name_monitoring\") == loggerData[i]['parameter value'];", - " break;", - " case \"level\":", - " tests[\"Body contains added logger_level\"] = postman.getEnvironmentVariable(\"logger_level\") == loggerData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added logger_type\"] = \"monitoring\" == loggerData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_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": [] - }, - { - "name": "Addoutput ipv4", - "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_ipv4}};ipv4;4\"\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": "Get output_key ipv4", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " var i = 0;", - " while (i < outputData.length) {", - " if (postman.getEnvironmentVariable(\"output_name_ipv4\") == outputData[i].name) {", - " postman.setEnvironmentVariable(\"output_ipv4_id\",outputData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == outputData.length){", - " tests[\"output_name_ipv4 was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput compression", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};compression;{{output_compression}}\"\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": "Setoutput compression_buffer", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};compression_buffer;{{output_compression_buffer}}\"\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": "Setoutput compression_level", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};compression_level;{{output_compression_level}}\"\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": "Setoutput failover", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};category;{{output_category}}\"\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": "Setoutput ca_certificate", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};ca_certificate;{{output_ca_certificate}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};host;{{output_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": "Setoutput one_peer_retention_mode", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};one_peer_retention_mode;{{output_one_peer_retention_mode}}\"\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": "Setoutput port", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};port;{{output_port}}\"\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": "Setoutput private_key", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};private_key;{{output_private_key}}\"\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": "Setoutput protocol", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};protocol;{{output_protocol}}\"\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": "Setoutput public_cert", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};public_cert;{{output_public_cert}}\"\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": "Setoutput tls", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};tls;{{output_tls}}\"\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": "Getoutput ipv4", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " for (var i = 0; i < outputData.length; i++) {", - " switch (outputData[i]['parameter key'])", - " {", - " case \"buffering_timeout\":", - " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", - " break;", - " case \"category\":", - " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", - " break;", - " case \"ca_certificate\":", - " tests[\"Body contains added output_ca_certificate\"] = postman.getEnvironmentVariable(\"output_ca_certificate\") == outputData[i]['parameter value'];", - " break;", - " case \"compression\":", - " tests[\"Body contains added output_compression\"] = postman.getEnvironmentVariable(\"output_compression\") == outputData[i]['parameter value'];", - " break;", - " case \"compression_buffer\":", - " tests[\"Body contains added output_compression_buffer\"] = postman.getEnvironmentVariable(\"output_compression_buffer\") == outputData[i]['parameter value'];", - " break;", - " case \"compression_level\":", - " tests[\"Body contains added output_compression_level\"] = postman.getEnvironmentVariable(\"output_compression_level\") == outputData[i]['parameter value'];", - " break;", - " case \"failover\":", - " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", - " break;", - " case \"host\":", - " tests[\"Body contains added output_host\"] = postman.getEnvironmentVariable(\"output_host\") == outputData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_ipv4\") == outputData[i]['parameter value'];", - " break;", - " case \"one_peer_retention_mode\":", - " tests[\"Body contains added output_one_peer_retention\"] = postman.getEnvironmentVariable(\"output_one_peer_retention_mode\") == outputData[i]['parameter value'];", - " break;", - " case \"port\":", - " tests[\"Body contains added output_port\"] = postman.getEnvironmentVariable(\"output_port\") == outputData[i]['parameter value'];", - " break;", - " case \"private_key\":", - " tests[\"Body contains added output_private_key\"] = postman.getEnvironmentVariable(\"output_private_key\") == outputData[i]['parameter value'];", - " break;", - " case \"protocol\":", - " tests[\"Body contains added output_protocol\"] = postman.getEnvironmentVariable(\"output_protocol\") == outputData[i]['parameter value'];", - " break;", - " case \"public_cert\":", - " tests[\"Body contains added output_public_cert\"] = postman.getEnvironmentVariable(\"output_public_cert\") == outputData[i]['parameter value'];", - " break;", - " case \"retry_interval\":", - " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", - " break;", - " case \"tls\":", - " tests[\"Body contains added output_tls\"] = postman.getEnvironmentVariable(\"output_tls\") == outputData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added output_type\"] = \"ipv4\" == outputData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_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": [] - }, - { - "name": "Addoutput ipv6", - "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_ipv6}};ipv6;4\"\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": "Get output_key ipv6", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " var i = 0;", - " while (i < outputData.length) {", - " if (postman.getEnvironmentVariable(\"output_name_ipv6\") == outputData[i].name) {", - " postman.setEnvironmentVariable(\"output_ipv6_id\",outputData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == outputData.length){", - " tests[\"output_name_ipv6 was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput compression", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};compression;{{output_compression}}\"\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": "Setoutput compression_buffer", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};compression_buffer;{{output_compression_buffer}}\"\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": "Setoutput compression_level", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};compression_level;{{output_compression_level}}\"\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": "Setoutput failover", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};category;{{output_category}}\"\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": "Setoutput ca_certificate", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};ca_certificate;{{output_ca_certificate}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};host;{{output_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": "Setoutput one_peer_retention_mode", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};one_peer_retention_mode;{{output_one_peer_retention_mode}}\"\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": "Setoutput port", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};port;{{output_port}}\"\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": "Setoutput private_key", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};private_key;{{output_private_key}}\"\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": "Setoutput protocol", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};protocol;{{output_protocol}}\"\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": "Setoutput public_cert", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};public_cert;{{output_public_cert}}\"\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": "Setoutput tls", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};tls;{{output_tls}}\"\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": "Getoutput ipv6", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " for (var i = 0; i < outputData.length; i++) {", - " switch (outputData[i]['parameter key'])", - " {", - " case \"buffering_timeout\":", - " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", - " break;", - " case \"category\":", - " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", - " break;", - " case \"ca_certificate\":", - " tests[\"Body contains added output_ca_certificate\"] = postman.getEnvironmentVariable(\"output_ca_certificate\") == outputData[i]['parameter value'];", - " break;", - " case \"compression\":", - " tests[\"Body contains added output_compression\"] = postman.getEnvironmentVariable(\"output_compression\") == outputData[i]['parameter value'];", - " break;", - " case \"compression_buffer\":", - " tests[\"Body contains added output_compression_buffer\"] = postman.getEnvironmentVariable(\"output_compression_buffer\") == outputData[i]['parameter value'];", - " break;", - " case \"compression_level\":", - " tests[\"Body contains added output_compression_level\"] = postman.getEnvironmentVariable(\"output_compression_level\") == outputData[i]['parameter value'];", - " break;", - " case \"failover\":", - " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", - " break;", - " case \"host\":", - " tests[\"Body contains added output_host\"] = postman.getEnvironmentVariable(\"output_host\") == outputData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_ipv6\") == outputData[i]['parameter value'];", - " break;", - " case \"one_peer_retention_mode\":", - " tests[\"Body contains added output_one_peer_retention\"] = postman.getEnvironmentVariable(\"output_one_peer_retention_mode\") == outputData[i]['parameter value'];", - " break;", - " case \"port\":", - " tests[\"Body contains added output_port\"] = postman.getEnvironmentVariable(\"output_port\") == outputData[i]['parameter value'];", - " break;", - " case \"private_key\":", - " tests[\"Body contains added output_private_key\"] = postman.getEnvironmentVariable(\"output_private_key\") == outputData[i]['parameter value'];", - " break;", - " case \"protocol\":", - " tests[\"Body contains added output_protocol\"] = postman.getEnvironmentVariable(\"output_protocol\") == outputData[i]['parameter value'];", - " break;", - " case \"public_cert\":", - " tests[\"Body contains added output_public_cert\"] = postman.getEnvironmentVariable(\"output_public_cert\") == outputData[i]['parameter value'];", - " break;", - " case \"retry_interval\":", - " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", - " break;", - " case \"tls\":", - " tests[\"Body contains added output_tls\"] = postman.getEnvironmentVariable(\"output_tls\") == outputData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added output_type\"] = \"ipv6\" == outputData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_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": [] - }, - { - "name": "Addoutput file", - "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_file}};file;4\"\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": "Get output_key file", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " var i = 0;", - " while (i < outputData.length) {", - " if (postman.getEnvironmentVariable(\"output_name_file\") == outputData[i].name) {", - " postman.setEnvironmentVariable(\"output_file_id\",outputData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == outputData.length){", - " tests[\"output_name_file was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};category;{{output_category}}\"\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": "Setoutput compression", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};compression;{{output_compression}}\"\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": "Setoutput compression_buffer", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};compression_buffer;{{output_compression_buffer}}\"\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": "Setoutput compression_level", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};compression_level;{{output_compression_level}}\"\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": "Setoutput failover", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput protocol", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};protocol;{{output_protocol}}\"\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": "Setoutput max_size", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};max_size;{{output_max_size}}\"\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": "Setoutput path", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};path;{{output_path}}\"\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": "Getoutput file", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " for (var i = 0; i < outputData.length; i++) {", - " switch (outputData[i]['parameter key'])", - " {", - " case \"buffering_timeout\":", - " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", - " break;", - " case \"category\":", - " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", - " break;", - " case \"compression\":", - " tests[\"Body contains added output_compression\"] = postman.getEnvironmentVariable(\"output_compression\") == outputData[i]['parameter value'];", - " break;", - " case \"compression_buffer\":", - " tests[\"Body contains added output_compression_buffer\"] = postman.getEnvironmentVariable(\"output_compression_buffer\") == outputData[i]['parameter value'];", - " break;", - " case \"compression_level\":", - " tests[\"Body contains added output_compression_level\"] = postman.getEnvironmentVariable(\"output_compression_level\") == outputData[i]['parameter value'];", - " break;", - " case \"max_size\":", - " tests[\"Body contains added output_max_size\"] = postman.getEnvironmentVariable(\"output_max_size\") == outputData[i]['parameter value'];", - " break;", - " case \"failover\":", - " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_file\") == outputData[i]['parameter value'];", - " break;", - " case \"path\":", - " tests[\"Body contains added output_path\"] = postman.getEnvironmentVariable(\"output_path\") == outputData[i]['parameter value'];", - " break;", - " case \"protocol\":", - " tests[\"Body contains added output_protocol\"] = postman.getEnvironmentVariable(\"output_protocol\") == outputData[i]['parameter value'];", - " break;", - " case \"retry_interval\":", - " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added output_type\"] = \"file\" == outputData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_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": [] - }, - { - "name": "Addoutput rrd", - "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_rrd}};rrd;4\"\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": "Get output_key rrd", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " var i = 0;", - " while (i < outputData.length) {", - " if (postman.getEnvironmentVariable(\"output_name_rrd\") == outputData[i].name) {", - " postman.setEnvironmentVariable(\"output_rrd_id\",outputData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == outputData.length){", - " tests[\"output_name_rrd was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};category;{{output_category}}\"\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": "Setoutput failover", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput metrics_path", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};metrics_path;{{output_metrics_path}}\"\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": "Setoutput status_path", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};status_path;{{output_status_path}}\"\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": "Setoutput write_metrics", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};write_metrics;{{output_write_metrics}}\"\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": "Setoutput write_status", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};write_status;{{output_write_status}}\"\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": "Getoutput rrd", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " for (var i = 0; i < outputData.length; i++) {", - " switch (outputData[i]['parameter key'])", - " {", - " case \"buffering_timeout\":", - " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", - " break;", - " case \"category\":", - " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", - " break;", - " case \"failover\":", - " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", - " break;", - " case \"metrics_path\":", - " tests[\"Body contains added output_metrics_path\"] = postman.getEnvironmentVariable(\"output_metrics_path\") == outputData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_rrd\") == outputData[i]['parameter value'];", - " break;", - " case \"path\":", - " tests[\"Body contains added output_path\"] = postman.getEnvironmentVariable(\"output_path\") == outputData[i]['parameter value'];", - " break;", - " case \"port\":", - " tests[\"Body contains added output_port\"] = postman.getEnvironmentVariable(\"output_port\") == outputData[i]['parameter value'];", - " break;", - " case \"retry_interval\":", - " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", - " break;", - " case \"status_path\":", - " tests[\"Body contains added output_status_path\"] = postman.getEnvironmentVariable(\"output_status_path\") == outputData[i]['parameter value'];", - " break;", - " case \"store_in_data\":", - " tests[\"Body contains added output_store_in_data\"] = postman.getEnvironmentVariable(\"output_store_in_data_bin\") == outputData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added output_type\"] = \"rrd\" == outputData[i]['parameter value'];", - " break;", - " case \"write_metrics\":", - " tests[\"Body contains added output_write_metrics\"] = postman.getEnvironmentVariable(\"output_write_status\") == outputData[i]['parameter value'];", - " break;", - " case \"write_status\":", - " tests[\"Body contains added output_write_status\"] = postman.getEnvironmentVariable(\"output_write_status\") == outputData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_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": [] - }, - { - "name": "Addoutput storage", - "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_storage}};storage;4\"\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": "Get output_key storage", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " var i = 0;", - " while (i < outputData.length) {", - " if (postman.getEnvironmentVariable(\"output_name_storage\") == outputData[i].name) {", - " postman.setEnvironmentVariable(\"output_storage_id\",outputData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == outputData.length){", - " tests[\"output_name_storage was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};category;{{output_category}}\"\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": "Setoutput failover", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput check_replication", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};check_replication;{{output_check_replication}}\"\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": "Setoutput store_in_data_bin", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};store_in_data_bin;{{output_store_in_data_bin}}\"\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": "Setoutput db_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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_host;{{output_db_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": "Setoutput db_name", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_name;{{output_db_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": "Setoutput db_password", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_password;{{output_db_password}}\"\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": "Setoutput db_port", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_port;{{output_db_port}}\"\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": "Setoutput db_type", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_type;{{output_db_type}}\"\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": "Setoutput db_user", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_user;{{output_db_user}}\"\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": "Setoutput interval", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};interval;{{output_interval}}\"\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": "Setoutput length", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};length;{{output_length}}\"\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": "Setoutput queries_per_transaction", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};queries_per_transaction;{{output_queries_per_transaction}}\"\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": "Setoutput read_timeout", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};read_timeout;{{output_read_timeout}}\"\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": "Setoutput rebuild_check_interval", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};rebuild_check_interval;{{output_rebuild_check_interval}}\"\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": "Getoutput storage", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " for (var i = 0; i < outputData.length; i++) {", - " switch (outputData[i]['parameter key'])", - " {", - " case \"buffering_timeout\":", - " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", - " break;", - " case \"category\":", - " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", - " break;", - " case \"check_replication\":", - " tests[\"Body contains added output_check_replication\"] = postman.getEnvironmentVariable(\"output_check_replication\") == outputData[i]['parameter value'];", - " break;", - " case \"db_host\":", - " tests[\"Body contains added output_db_host\"] = postman.getEnvironmentVariable(\"output_db_host\") == outputData[i]['parameter value'];", - " break;", - " case \"db_name\":", - " tests[\"Body contains added output_db_name\"] = postman.getEnvironmentVariable(\"output_db_name\") == outputData[i]['parameter value'];", - " break;", - " case \"db_password\":", - " tests[\"Body contains added output_db_password\"] = postman.getEnvironmentVariable(\"output_db_password\") == outputData[i]['parameter value'];", - " break;", - " case \"db_port\":", - " tests[\"Body contains added output_db_port\"] = postman.getEnvironmentVariable(\"output_db_port\") == outputData[i]['parameter value'];", - " break;", - " case \"db_type\":", - " tests[\"Body contains added output_db_type\"] = postman.getEnvironmentVariable(\"output_db_type\") == outputData[i]['parameter value'];", - " break;", - " case \"db_user\":", - " tests[\"Body contains added output_db_user\"] = postman.getEnvironmentVariable(\"output_db_user\") == outputData[i]['parameter value'];", - " break;", - " case \"failover\":", - " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", - " break;", - " case \"interval\":", - " tests[\"Body contains added output_interval\"] = postman.getEnvironmentVariable(\"output_interval\") == outputData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_storage\") == outputData[i]['parameter value'];", - " break;", - " case \"queries_per_transaction\":", - " tests[\"Body contains added output_queries_per_transaction\"] =postman.getEnvironmentVariable(\"output_queries_per_transaction\") == outputData[i]['parameter value'];", - " break;", - " case \"read_timeout\":", - " tests[\"Body contains added output_read_timeout\"] = postman.getEnvironmentVariable(\"output_read_timeout\") == outputData[i]['parameter value'];", - " break;", - " case \"rebuild_check_interval\":", - " tests[\"Body contains added output_rebuild_check_interval\"] = postman.getEnvironmentVariable(\"output_rebuild_check_interval\") == outputData[i]['parameter value'];", - " break;", - " case \"retry_interval\":", - " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", - " break;", - " case \"store_in_data_bin\":", - " tests[\"Body contains added output_store_in_data_bin\"] = postman.getEnvironmentVariable(\"output_store_in_data_bin\") == outputData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added output_type\"] = \"storage\" == outputData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_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": [] - }, - { - "name": "Addoutput sql", - "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_sql}};sql;4\"\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": "Get output_key sql", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " var i = 0;", - " while (i < outputData.length) {", - " if (postman.getEnvironmentVariable(\"output_name_sql\") == outputData[i].name) {", - " postman.setEnvironmentVariable(\"output_sql_id\",outputData[i].id)", - " break;", - " }", - " i++;", - " }", - " if (i == outputData.length){", - " tests[\"output_name_sql was found\"] = false;", - " }", - "} catch (e) {}", - "", - "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};category;{{output_category}}\"\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": "Setoutput failover", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput check_replication", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};check_replication;{{output_check_replication}}\"\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": "Setoutput cleanup_check_interval", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};cleanup_check_interval;{{output_cleanup_check_interval}}\"\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": "Setoutput db_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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_host;{{output_db_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": "Setoutput db_name", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_name;{{output_db_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": "Setoutput db_password", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_password;{{output_db_password}}\"\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": "Setoutput db_port", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_port;{{output_db_port}}\"\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": "Setoutput db_type", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_type;{{output_db_type}}\"\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": "Setoutput db_user", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_user;{{output_db_user}}\"\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": "Setoutput instance_timeout", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};instance_timeout;{{output_instance_timeout}}\"\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": "Setoutput queries_per_transaction", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};queries_per_transaction;{{output_queries_per_transaction}}\"\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": "Setoutput read_timeout", - "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};read_timeout;{{output_read_timeout}}\"\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": "Getoutput sql", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var outputData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of outputs\"] = outputData;", - " for (var i = 0; i < outputData.length; i++) {", - " switch (outputData[i]['parameter key'])", - " {", - " case \"buffering_timeout\":", - " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", - " break;", - " case \"category\":", - " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", - " break;", - " case \"check_replication\":", - " tests[\"Body contains added output_check_replication\"] = postman.getEnvironmentVariable(\"output_check_replication\") == outputData[i]['parameter value'];", - " break;", - " case \"cleanup_check_interval\":", - " tests[\"Body contains added output_cleanup_check_interval\"] = postman.getEnvironmentVariable(\"output_cleanup_check_interval\") == outputData[i]['parameter value'];", - " break;", - " case \"db_host\":", - " tests[\"Body contains added output_db_host\"] = postman.getEnvironmentVariable(\"output_db_host\") == outputData[i]['parameter value'];", - " break;", - " case \"db_name\":", - " tests[\"Body contains added output_db_name\"] = postman.getEnvironmentVariable(\"output_db_name\") == outputData[i]['parameter value'];", - " break;", - " case \"db_password\":", - " tests[\"Body contains added output_db_password\"] = postman.getEnvironmentVariable(\"output_db_password\") == outputData[i]['parameter value'];", - " break;", - " case \"db_port\":", - " tests[\"Body contains added output_db_port\"] = postman.getEnvironmentVariable(\"output_db_port\") == outputData[i]['parameter value'];", - " break;", - " case \"db_type\":", - " tests[\"Body contains added output_db_type\"] = postman.getEnvironmentVariable(\"output_db_type\") == outputData[i]['parameter value'];", - " break;", - " case \"db_user\":", - " tests[\"Body contains added output_db_user\"] = postman.getEnvironmentVariable(\"output_db_user\") == outputData[i]['parameter value'];", - " break;", - " case \"failover\":", - " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", - " break;", - " case \"instance_timeout\":", - " tests[\"Body contains added output_instance_timeout\"] = postman.getEnvironmentVariable(\"output_instance_timeout\") == outputData[i]['parameter value'];", - " break;", - " case \"name\":", - " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_sql\") == outputData[i]['parameter value'];", - " break;", - " case \"queries_per_transaction\":", - " tests[\"Body contains added output_queries_per_transaction\"] =postman.getEnvironmentVariable(\"output_queries_per_transaction\") == outputData[i]['parameter value'];", - " break;", - " case \"read_timeout\":", - " tests[\"Body contains added output_read_timeout\"] = postman.getEnvironmentVariable(\"output_read_timeout\") == outputData[i]['parameter value'];", - " break;", - " case \"retry_interval\":", - " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", - " break;", - " case \"type\":", - " tests[\"Body contains added output_type\"] = \"sql\" == outputData[i]['parameter value'];", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_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": [] - }, - { - "name": "Gettypelist", - "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\": \"gettypelist\",\n \"object\": \"centbrokercfg\",\n \"values\": \"output\"\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": "Getfieldlist", - "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\": \"getfieldlist\",\n \"object\": \"centbrokercfg\",\n \"values\": \"ipv4\"\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": "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\": \"test_name;test_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 name", - "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\": \"test_name;name;{{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 alias", - "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}};alias;{{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": [] - }, - { - "name": "Setparam include", - "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}};include;{{tp_include}}\"\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 exclude", - "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}};exclude;{{tp_exclude}}\"\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 timeperiod", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var tpData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of time periods\"] = tpData;", - " var i = 0;", - " while (i < tpData.length) {", - " if (postman.getEnvironmentVariable(\"tp_name\") == tpData[i].name) {", - " tests[\"Body contains added name\"] = postman.getEnvironmentVariable(\"tp_name\") == tpData[i].name;", - " tests[\"Body contains added alias\"] = postman.getEnvironmentVariable(\"tp_alias\") == tpData[i].alias;", - " tests[\"Body contains added sunday\"] = postman.getEnvironmentVariable(\"tp_sunday\") == tpData[i].sunday;", - " tests[\"Body contains added monday\"] = postman.getEnvironmentVariable(\"tp_monday\") == tpData[i].monday;", - " tests[\"Body contains added tuesday\"] = postman.getEnvironmentVariable(\"tp_tuesday\") == tpData[i].tuesday;", - " tests[\"Body contains added wednesday\"] = postman.getEnvironmentVariable(\"tp_wednesday\") == tpData[i].wednesday;", - " tests[\"Body contains added thursday\"] = postman.getEnvironmentVariable(\"tp_thursday\") == tpData[i].thursday;", - " tests[\"Body contains added friday\"] = postman.getEnvironmentVariable(\"tp_friday\") == tpData[i].friday;", - " tests[\"Body contains added saturday\"] = postman.getEnvironmentVariable(\"tp_saturday\") == tpData[i].saturday;", - " break;", - " }", - " i++;", - " }", - " if (i == tpData.length)", - " tests[\"tp_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"tp\"\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 exception", - "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\": \"setexception\",\n \"object\": \"tp\",\n \"values\": \"{{tp_name}};{{exception_day}};{{exception_timerange}}\"\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": "Get exceptions", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var exceptionData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of exceptions\"] = exceptionData;", - " var i = 0;", - " while (i < exceptionData.length) {", - " if (postman.getEnvironmentVariable(\"exception_day\") == exceptionData[i].days) {", - " tests[\"Body contains added exception day\"] = postman.getEnvironmentVariable(\"exception_day\") == exceptionData[i].days;", - " tests[\"Body contains added exception timerange\"] = postman.getEnvironmentVariable(\"exception_timerange\") == exceptionData[i].timerange;", - " break;", - " }", - " i++;", - " }", - " if (i == tpData.length)", - " tests[\"tp_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getexception\",\n \"object\":\"tp\",\n \"values\": \"{{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": "Del exception", - "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\": \"delexception\",\n \"object\": \"tp\",\n \"values\": \"{{tp_name}};{{exception_day}}\"\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": "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\": \"cmd-test;misc;{{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 name", - "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\": \"cmd\",\n \"values\": \"cmd-test;name;{{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 line", - "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\": \"cmd\",\n \"values\": \"{{command_name}};line;{{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": [] - }, - { - "name": "Setparam type", - "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\": \"cmd\",\n \"values\": \"{{command_name}};type;{{command_type}}\"\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 graph", - "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\": \"cmd\",\n \"values\": \"{{command_name}};graph;{{command_graph}}\"\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 example", - "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\": \"cmd\",\n \"values\": \"{{command_name}};example;{{command_example}}\"\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 comment", - "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\": \"cmd\",\n \"values\": \"{{command_name}};comment;{{command_comment}}\"\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 argument", - "event": [ - { - "listen": "test", - "script": { - "id": "df114804-4a0c-4f9f-981b-d86f7f192dd3", - "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\": \"setargumentdescr\",\n \"object\": \"cmd\",\n \"values\": \"{{command_name}};ARG1:New First Arg\"\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 arguments", - "event": [ - { - "listen": "test", - "script": { - "id": "e33fe297-6eea-4cab-a6b8-4a5c96bcfc73", - "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\": {", - " \"name\": { \"type\": \"string\" },", - " \"description\": { \"type\": \"string\" }", - " },", - " \"additionalProperties\": false,", - " \"required \": [\"name\", \"description\"]", - " }", - "};", - "", - "tests[\"Validate schema\"] = tv4.validate(result, schema);" - ], - "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\": \"getargumentdesc\",\n \"object\": \"cmd\",\n \"values\": \"mycommand\"\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 commands", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var commandData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of commands\"] = commandData;", - " var i = 0;", - " while (i < commandData.length) {", - " if (postman.getEnvironmentVariable(\"command_name\") == commandData[i].name) {", - " tests[\"Body contains added command_name\"] = postman.getEnvironmentVariable(\"command_name\") == commandData[i].name;", - " tests[\"Body contains added command_type\"] = postman.getEnvironmentVariable(\"command_type\") == commandData[i].type;", - " tests[\"Body contains added command_line\"] = postman.getEnvironmentVariable(\"command_line\") == commandData[i].line;", - " break;", - " }", - " i++;", - " }", - " if (i == commandData.length)", - " tests[\"command_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"cmd\"\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." - }, - { - "name": "20-Contacts templates", - "item": [ - { - "name": "Add ctpl", - "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\": \"contacttpl\",\n \"values\": \"test_name;test_alias;test@localhost;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 name", - "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\": \"contacttpl\",\n \"values\": \"test_alias;name;{{ctpl_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 alias", - "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\": \"contacttpl\",\n \"values\": \"test_alias;alias;{{ctpl_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 comment", - "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};comment;{{ctpl_comment}}\"\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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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": [] - }, - { - "name": "Setparam address1", - "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address1;{{contact_address1}}\"\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 address2", - "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address2;{{contact_address2}}\"\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 address3", - "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address3;{{contact_address3}}\"\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 address4", - "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address4;{{contact_address4}}\"\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 address5", - "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address5;{{contact_address5}}\"\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 address6", - "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address6;{{contact_address6}}\"\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": "Create ctpl2", - "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\": \"contacttpl\",\n \"values\": \"{{ctpl_name2}};{{ctpl_alias2}};test@localhost;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 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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};template;{{ctpl_alias2}}\"\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": "Enable", - "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\": \"enable\",\n \"object\": \"contacttpl\",\n \"values\": \"{{ctpl_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": "Disable", - "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\": \"disable\",\n \"object\": \"contacttpl\",\n \"values\": \"{{ctpl_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." - }, - { - "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\": \"test_name;test_alias;test@localhost;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 name", - "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\": \"test_alias;name;{{contact_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 alias", - "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\": \"test_alias;alias;{{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": "Setparam comment", - "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}};comment;{{contact_comment}}\"\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 mail", - "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}};email;{{contact_mail}}\"\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 password", - "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}};password;{{contact_pwd}}\"\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 access", - "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}};access;{{contact_access}}\"\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 language", - "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}};language;{{contact_language}}\"\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 GUI access", - "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}};access;{{contact_GUI_access}}\"\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 admin", - "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}};admin;{{contact_admin}}\"\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 authtype", - "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}};authtype;{{contact_authentication}}\"\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": [] - }, - { - "name": "Setparam address1", - "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}};address1;{{contact_address1}}\"\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 address2", - "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}};address2;{{contact_address2}}\"\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 address3", - "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}};address3;{{contact_address3}}\"\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 address4", - "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}};address4;{{contact_address4}}\"\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 address5", - "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}};address5;{{contact_address5}}\"\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 address6", - "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}};address6;{{contact_address6}}\"\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 ldap_dn", - "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}};ldap_dn;{{contact_ldap_dn}}\"\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 autologin_key", - "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}};autologin_key;{{contact_autologin_key}}\"\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\": \"contact\",\n \"values\": \"{{contact_alias}};template;{{ctpl_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": "Enable", - "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\": \"enable\",\n \"object\": \"contact\",\n \"values\": \"{{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": "Disable", - "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\": \"disable\",\n \"object\": \"contact\",\n \"values\": \"{{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": "List contact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var contactData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contacts\"] = contactData;", - " var i = 0;", - " while (i < contactData.length) {", - " if (postman.getEnvironmentVariable(\"contact_name\") == contactData[i].name) {", - " tests[\"Body contains added contact_name\"] = postman.getEnvironmentVariable(\"contact_name\") == contactData[i].name;", - " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].alias;", - " tests[\"Body contains added contact_email\"] = postman.getEnvironmentVariable(\"contact_mail\") == contactData[i].email;", - " tests[\"Body contains added contact_GUI_access\"] = postman.getEnvironmentVariable(\"contact_GUI_access\") == contactData[i]['gui access'];", - " tests[\"Body contains added contact_admin\"] = postman.getEnvironmentVariable(\"contact_admin\") == contactData[i].admin;", - " break;", - " }", - " i++;", - " }", - " if (i == contactData.length)", - " tests[\"contact_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"contact\"\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 contact non admin", - "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}};admin;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": "Create contact-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\": \"contact\",\n \"values\": \"{{contact_name2}};{{contact_alias2}};test@localhost;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": "Set contact non admin", - "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}};admin;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": [] - } - ], - "description": "Tests all commands to manage contact." - }, - { - "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\": \"test_name;test_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 name", - "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\": \"cg\",\n \"values\": \"test_name;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": "Setparam alias", - "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\": \"cg\",\n \"values\": \"{{cg_name}};alias;{{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": "Enable", - "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\": \"enable\",\n \"object\": \"cg\",\n \"values\": \"{{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": "Disable", - "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\": \"disable\",\n \"object\": \"cg\",\n \"values\": \"{{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": "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": [] - }, - { - "name": "Delcontact", - "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\": \"delcontact\",\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": [] - }, - { - "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\": \"cg\",\n \"values\": \"{{cg_name}};{{contact_alias}}|{{contact_alias2}}\"\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": "Getcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var contactData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contacts\"] = contactData;", - " var i = 0;", - " while (i < contactData.length) {", - " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name)", - " {", - " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == contactData.length)", - " tests[\"contact_alias was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getcontact\",\n \"object\": \"cg\",\n \"values\": \"{{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": "List contact group", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var cgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contact groups\"] = cgData;", - " var i = 0;", - " while (i < cgData.length) {", - " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name)", - " {", - " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", - " tests[\"Body contains added cg_alias\"] = postman.getEnvironmentVariable(\"cg_alias\") == cgData[i].alias;", - " break;", - " }", - " i++;", - " }", - " if (i == cgData.length)", - " tests[\"cg_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"cg\"\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." - }, - { - "name": "30-Hosts_Templates", - "item": [ - { - "name": "Create host template2", - "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_name2}};{{htpl_name2}};0.0.0.0;;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 htpl", - "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\": \"test_host;test_host;0.0.0.0;{{htpl_name2}};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 name", - "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\": \"test_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": "Setparam 2d_coords", - "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}};2d_coords;{{host_2d_coords}}\"\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 3d_coords", - "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}};3d_coords;{{host_3d_coords}}\"\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 action_url", - "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}};action_url;{{host_action_url}}\"\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 activate", - "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}};activate;{{host_activate}}\"\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_checks_enabled", - "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}};active_checks_enabled;{{host_active_checks_enabled}}\"\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 address", - "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}};address;{{host_address}}\"\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 alias", - "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}};alias;{{host_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": "List hosts", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var hostData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of hosts\"] = hostData;", - " var i = 0;", - " while (i < hostData.length) {", - " if (postman.getEnvironmentVariable(\"htpl_name\") == hostData[i].name) {", - " tests[\"Body contains added host\"] = postman.getEnvironmentVariable(\"htpl_name\") == hostData[i].name;", - " tests[\"Body contains added host_alias\"] = postman.getEnvironmentVariable(\"host_alias\") == hostData[i].alias;", - " tests[\"Body contains added host_address\"] = postman.getEnvironmentVariable(\"host_address\") == hostData[i].address;", - " tests[\"Body contains added host_activate\"] = postman.getEnvironmentVariable(\"host_activate\") == hostData[i].activate;", - " break;", - " }", - " i++;", - " }", - " if (i == hostData.length)", - " tests[\"htpl_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"show\",\n \"object\":\"htpl\"\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_command_arguments", - "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_arguments;{{command_example}}\"\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_interval", - "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_interval;{{host_normal_interval}}\"\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_freshness", - "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_freshness;{{host_check_freshness}}\"\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 check_enabled", - "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}};checks_enabled;{{host_check_enabled}}\"\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 contact_additive_inheritance", - "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}};contact_additive_inheritance;{{host_contact_additive_inheritance}}\"\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 cg_additive_inheritance", - "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}};cg_additive_inheritance;{{host_cg_additive_inheritance}}\"\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 event_handler", - "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}};event_handler;{{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 event_handler_arg", - "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}};event_handler_arguments;{{command_example}}\"\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 event_handler_enabled", - "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}};event_handler_enabled;{{host_event_handler_enabled}}\"\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 first_notification_delay", - "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}};first_notification_delay;{{host_first_notif_delay}}\"\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 flap_detection_enabled", - "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}};flap_detection_enabled;{{host_flap_detect_enabled}}\"\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 host_low_flap_threshold", - "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}};host_low_flap_threshold;{{host_low_flap}}\"\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 host_high_flap_threshold", - "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}};host_high_flap_threshold;{{host_high_flap}}\"\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 flap_detection_options", - "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}};flap_detection_options;{{host_flap_detect_options}}\"\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 icon_image", - "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}};icon_image;{{host_icon_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": [] - }, - { - "name": "Setparam icon_image_alt", - "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}};icon_image_alt;{{host_icon_image_alt}}\"\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 notes", - "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}};notes;{{host_notes}}\"\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 notes_url", - "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}};notes_url;{{host_notes_url}}\"\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 notifications_enabled", - "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}};notifications_enabled;{{host_notif_enabled}}\"\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 notification_interval", - "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}};notification_interval;{{host_notif_interval}}\"\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 notification_options", - "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}};notification_options;{{host_notif_options}}\"\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 notification_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}};notification_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 recovery_notif_delay", - "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}};recovery_notification_delay;{{host_recovery_notif_delay}}\"\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 obsess_over_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\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};obsess_over_host;{{host_obsess_over_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": "Setparam passive_checks_enabled", - "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}};passive_checks_enabled;{{host_passive_checks_enabled}}\"\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 process_perf_data", - "event": [ - { - "listen": "test", - "script": { - "id": "042a5d7e-922d-438f-84d5-49a417ae9f5e", - "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\":\"htpl\",\n \"values\": \"{{htpl_name}};process_perf_data;2\"\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 retain_status_info", - "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}};retain_status_information;{{host_retain_status_info}}\"\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 retain_nonstatus_info", - "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}};retain_nonstatus_information;{{host_retain_nonstatus_info}}\"\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 retry_check_interval", - "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}};retry_check_interval;{{host_retry_check_interval}}\"\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": "Setparam stalking_options", - "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}};stalking_options;{{host_stalking_options}}\"\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 statusmap_image", - "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}};statusmap_image;{{host_statusmap_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": [] - }, - { - "name": "Setparam host_notif_options", - "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}};host_notification_options;{{host_notification_options}}\"\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 timezone", - "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}};timezone;{{host_timezone}}\"\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": "Setmacro", - "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\":\"setmacro\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};{{host_macro_name}};{{host_macro_value}};{{host_is_password}};{{host_macro_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": "Getmacro", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var macroData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of macros\"] = macroData;", - " var i = 0;", - " while (i < macroData.length) {", - " if (postman.getEnvironmentVariable(\"host_macro_name\") == macroData[i]['macro name']) {", - " tests[\"Body contains added macro\"] = postman.getEnvironmentVariable(\"host_macro_name\") == macroData[i]['macro name'];", - " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"host_macro_value\") == macroData[i]['macro value'];", - " tests[\"Body contains added macro_is_password\"] = postman.getEnvironmentVariable(\"host_is_password\") == macroData[i].is_password;", - " tests[\"Body contains added macro_description\"] = postman.getEnvironmentVariable(\"host_macro_description\") == macroData[i].description;", - " break;", - " }", - " i++;", - " }", - " if (i == macroData.length)", - " tests[\"host_macro_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getmacro\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "Delmacro", - "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\":\"delmacro\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};{{host_macro_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": "Create host template3", - "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_name3}};test_host;0.0.0.0;;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": "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\":\"htpl\",\n \"values\": \"{{htpl_name}};{{htpl_name3}}\"\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": "Deltemplate", - "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\":\"deltemplate\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};{{htpl_name3}}\"\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": "Settemplate", - "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\":\"settemplate\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};{{htpl_name3}}\"\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": "Gettemplate", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var templateData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of templates\"] = templateData;", - " var i = 0;", - " while (i < templateData.length) {", - " if (postman.getEnvironmentVariable(\"htpl_name3\") == templateData[i].name) {", - " tests[\"Body contains added htpl_name3\"] = postman.getEnvironmentVariable(\"htpl_name3\") == templateData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == templateData.length)", - " tests[\"htpl_name3 was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"gettemplate\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "Addparent", - "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\": \"addparent\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{host_name2}}\"\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": "Delparent", - "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\": \"delparent\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{host_name2}}\"\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": "Setparent", - "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\": \"setparent\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{host_name2}}\"\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": "Getparent", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var parentData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of parents\"] = parentData;", - " var i = 0;", - " while (i < parentData.length) {", - " if (postman.getEnvironmentVariable(\"host_name2\") == parentData[i].name) {", - " tests[\"Body contains added host_name2\"] = postman.getEnvironmentVariable(\"host_name2\") == parentData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == parentData.length)", - " tests[\"host_name2 was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getparent\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "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": "Delcontactgroup", - "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\": \"delcontactgroup\",\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": "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\": \"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": "Getcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var cgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contact groups\"] = cgData;", - " var i = 0;", - " while (i < cgData.length) {", - " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name) {", - " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == cgData.length)", - " tests[\"cg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getcontactgroup\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "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\": \"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": "Delcontact", - "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\": \"delcontact\",\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": "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}}|{{contact_alias2}}\"\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": "Getcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var contactData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contacts\"] = contactData;", - " var i = 0;", - " while (i < contactData.length) {", - " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name) {", - " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == contactData.length)", - " tests[\"contact_alias was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getcontact\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "Add host 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\": \"hg\",\n \"values\": \"test_name;test_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 name", - "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\": \"hg\",\n \"values\": \"test_name;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": "Addhostgroup", - "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\": \"addhostgroup\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_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": "Delhostgroup", - "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\": \"delhostgroup\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_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": "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\": \"htpl\",\n \"values\": \"{{htpl_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": "Gethostgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var hgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contacts\"] = hgData;", - " var i = 0;", - " while (i < hgData.length) {", - " if (postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name) {", - " tests[\"Body contains added hg_name\"] = postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == hgData.length)", - " tests[\"hg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"gethostgroup\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "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": [] - }, - { - "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": [] - }, - { - "name": "Unsetseverity", - "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\": \"unsetseverity\",\n \"object\": \"htpl\",\n \"values\": \"{{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": "Enable", - "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\": \"enable\",\n \"object\": \"htpl\",\n \"values\": \"{{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": "Disable", - "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\": \"disable\",\n \"object\": \"htpl\",\n \"values\": \"{{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": "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\": \"test_host;test_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 name", - "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\": \"test_host;name;{{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": "Setparam 2d_coords", - "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}};2d_coords;{{host_2d_coords}}\"\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 3d_coords", - "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}};3d_coords;{{host_3d_coords}}\"\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 action_url", - "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}};action_url;{{host_action_url}}\"\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 activate", - "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}};activate;{{host_activate}}\"\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_checks_enabled", - "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}};active_checks_enabled;{{host_active_checks_enabled}}\"\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 address", - "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}};address;{{host_address}}\"\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 alias", - "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}};alias;{{host_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": "List hosts", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var hostData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of hosts\"] = hostData;", - " var i = 0;", - " while (i < hostData.length) {", - " if (postman.getEnvironmentVariable(\"host_name\") == hostData[i].name) {", - " tests[\"Body contains added host\"] = postman.getEnvironmentVariable(\"host_name\") == hostData[i].name;", - " tests[\"Body contains added host_alias\"] = postman.getEnvironmentVariable(\"host_alias\") == hostData[i].alias;", - " tests[\"Body contains added host_address\"] = postman.getEnvironmentVariable(\"host_address\") == hostData[i].address;", - " tests[\"Body contains added host_activate\"] = postman.getEnvironmentVariable(\"host_activate\") == hostData[i].activate;", - " break;", - " }", - " i++;", - " }", - " if (i == hostData.length)", - " tests[\"host_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"show\",\n \"object\":\"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": "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": "Setparam check_command_arguments", - "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_arguments;{{command_example}}\"\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_interval", - "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_interval;{{host_normal_interval}}\"\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_freshness", - "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_freshness;{{host_check_freshness}}\"\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\":\"host\",\n \"values\": \"{{host_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 check_enabled", - "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}};checks_enabled;{{host_check_enabled}}\"\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 contact_additive_inheritance", - "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}};contact_additive_inheritance;{{host_contact_additive_inheritance}}\"\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 cg_additive_inheritance", - "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}};cg_additive_inheritance;{{host_cg_additive_inheritance}}\"\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 event_handler", - "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}};event_handler;{{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 event_handler_arg", - "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}};event_handler_arguments;{{command_example}}\"\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 event_handler_enabled", - "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}};event_handler_enabled;{{host_event_handler_enabled}}\"\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 first_notification_delay", - "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}};first_notification_delay;{{host_first_notif_delay}}\"\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 flap_detection_enabled", - "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}};flap_detection_enabled;{{host_flap_detect_enabled}}\"\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 host_low_flap_threshold", - "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}};host_low_flap_threshold;{{host_low_flap}}\"\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 host_high_flap_threshold", - "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}};host_high_flap_threshold;{{host_high_flap}}\"\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 flap_detection_options", - "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}};flap_detection_options;{{host_flap_detect_options}}\"\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 icon_image", - "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}};icon_image;{{host_icon_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": [] - }, - { - "name": "Setparam icon_image_alt", - "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}};icon_image_alt;{{host_icon_image_alt}}\"\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\":\"host\",\n \"values\": \"{{host_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 notes", - "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}};notes;{{host_notes}}\"\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 notes_url", - "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}};notes_url;{{host_notes_url}}\"\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 notifications_enabled", - "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}};notifications_enabled;{{host_notif_enabled}}\"\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 notification_interval", - "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}};notification_interval;{{host_notif_interval}}\"\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 notification_options", - "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}};notification_options;{{host_notif_options}}\"\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 notification_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\":\"host\",\n \"values\": \"{{host_name}};notification_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 recovery_notif_delay", - "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}};recovery_notification_delay;{{host_recovery_notif_delay}}\"\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 obsess_over_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\":\"setparam\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};obsess_over_host;{{host_obsess_over_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": "Setparam passive_checks_enabled", - "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}};passive_checks_enabled;{{host_passive_checks_enabled}}\"\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 process_perf_data", - "event": [ - { - "listen": "test", - "script": { - "id": "898cfe6e-beb3-4e4c-a970-f07be37745df", - "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\": \"{{host_name}};process_perf_data;2\"\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 retain_status_info", - "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}};retain_status_information;{{host_retain_status_info}}\"\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 retain_nonstatus_info", - "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}};retain_nonstatus_information;{{host_retain_nonstatus_info}}\"\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 retry_check_interval", - "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}};retry_check_interval;{{host_retry_check_interval}}\"\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\":\"host\",\n \"values\": \"{{host_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\":\"host\",\n \"values\": \"{{host_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": "Setparam stalking_options", - "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}};stalking_options;{{host_stalking_options}}\"\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 statusmap_image", - "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}};statusmap_image;{{host_statusmap_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": [] - }, - { - "name": "Setparam host_notif_options", - "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}};host_notification_options;{{host_notification_options}}\"\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 timezone", - "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}};timezone;{{host_timezone}}\"\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": "Setinstance", - "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\":\"setinstance\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};{{instance_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": "Showinstance", - "event": [ - { - "listen": "test", - "script": { - "id": "d98aa955-00be-475b-88cd-b6eb878571f3", - "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\" },", - " \"name\": { \"type\": \"string\" }", - " },", - " \"additionalProperties\": false,", - " \"required \": [\"id\", \"name\"]", - " }", - "};", - "", - "tests[\"Validate schema\"] = tv4.validate(result, schema);", - "" - ], - "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\":\"showinstance\",\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": "Setmacro", - "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\":\"setmacro\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};{{host_macro_name}};{{host_macro_value}};{{host_is_password}};{{host_macro_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": "Getmacro", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var macroData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of macros\"] = macroData;", - " var i = 0;", - " while (i < macroData.length) {", - " if (postman.getEnvironmentVariable(\"host_macro_name\") == macroData[i]['macro name']) {", - " tests[\"Body contains added macro\"] = postman.getEnvironmentVariable(\"host_macro_name\") == macroData[i]['macro name'];", - " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"host_macro_value\") == macroData[i]['macro value'];", - " tests[\"Body contains added macro_is_password\"] = postman.getEnvironmentVariable(\"host_is_password\") == macroData[i].is_password;", - " tests[\"Body contains added macro_description\"] = postman.getEnvironmentVariable(\"host_macro_description\") == macroData[i].description;", - " break;", - " }", - " i++;", - " }", - " if (i == macroData.length)", - " tests[\"host_macro_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getmacro\",\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": "Delmacro", - "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\":\"delmacro\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};{{host_macro_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": "Deltemplate", - "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\":\"deltemplate\",\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": "Settemplate", - "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\":\"settemplate\",\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": "Gettemplate", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var templateData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of templates\"] = templateData;", - " var i = 0;", - " while (i < templateData.length) {", - " if (postman.getEnvironmentVariable(\"htpl_name\") == templateData[i].name) {", - " tests[\"Body contains added htpl_name\"] = postman.getEnvironmentVariable(\"htpl_name\") == templateData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == templateData.length)", - " tests[\"host_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"gettemplate\",\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": "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": "Addparent", - "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\": \"addparent\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{host_name2}}\"\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": "Delparent", - "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\": \"delparent\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{host_name2}}\"\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": "Setparent", - "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\": \"setparent\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{host_name2}}\"\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": "Getparent", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var parentData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of parents\"] = parentData;", - " var i = 0;", - " while (i < parentData.length) {", - " if (postman.getEnvironmentVariable(\"host_name2\") == parentData[i].name) {", - " tests[\"Body contains added parent\"] = postman.getEnvironmentVariable(\"host_name2\") == parentData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == parentData.length)", - " tests[\"host_name2 was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getparent\",\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": "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\": \"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": "Delcontactgroup", - "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\": \"delcontactgroup\",\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": "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": "Getcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var cgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contact groups\"] = cgData;", - " var i = 0;", - " while (i < cgData.length) {", - " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name) {", - " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == cgData.length)", - " tests[\"cg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getcontactgroup\",\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": "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\": \"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": "Delcontact", - "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\": \"delcontact\",\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": "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": "Getcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var contactData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contacts\"] = contactData;", - " var i = 0;", - " while (i < contactData.length) {", - " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name) {", - " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == contactData.length)", - " tests[\"contact_alias was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getcontact\",\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": "Addhostgroup", - "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\": \"addhostgroup\",\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": "Delhostgroup", - "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\": \"delhostgroup\",\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": "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": "Gethostgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var hgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contacts\"] = hgData;", - " var i = 0;", - " while (i < hgData.length) {", - " if (postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name) {", - " tests[\"Body contains added hg_name\"] = postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == hgData.length)", - " tests[\"hg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"gethostgroup\",\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": "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": "Unsetseverity", - "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\": \"unsetseverity\",\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": "Enable", - "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\": \"enable\",\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": "Disable", - "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\": \"disable\",\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": [] - } - ], - "description": "Tests all commands to manage hosts" - }, - { - "name": "32-Hostgroups", - "item": [ - { - "name": "Setparam alias", - "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\": \"hg\",\n \"values\": \"{{hg_name}};alias;{{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": [] - }, - { - "name": "Setparam comment", - "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\": \"hg\",\n \"values\": \"{{hg_name}};comment;{{hg_comment}}\"\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 activate", - "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\": \"hg\",\n \"values\": \"{{hg_name}};activate;{{hg_activate}}\"\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 notes", - "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\": \"hg\",\n \"values\": \"{{hg_name}};notes;{{hg_notes}}\"\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 notes_url", - "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\": \"hg\",\n \"values\": \"{{hg_name}};notes_url;{{hg_notes_url}}\"\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 action_url", - "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\": \"hg\",\n \"values\": \"{{hg_name}};action_url;{{hg_action_url}}\"\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 icon_image", - "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\": \"hg\",\n \"values\": \"{{hg_name}};icon_image;{{hg_icon_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": [] - }, - { - "name": "Setparam map_icon_image", - "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\": \"hg\",\n \"values\": \"{{hg_name}};map_icon_image;{{hg_map_icon_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": [] - }, - { - "name": "List host groups", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var hgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of host categories\"] = hgData;", - " var i = 0;", - " while (i < hgData.length) {", - " if (postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name)", - " {", - " tests[\"Body contains added hg_name\"] = postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name;", - " tests[\"Body contains added hg_alias\"] = postman.getEnvironmentVariable(\"hg_alias\") == hgData[i].alias;", - " break;", - " }", - " i++;", - " }", - " if (i == hgData.length)", - " tests[\"hg_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"hg\"\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": "Addmember", - "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\": \"addmember\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name}};{{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": "Delmenber", - "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\": \"delmember\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name}};{{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": "Setmember", - "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\": \"setmember\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name}};{{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": "Getmember", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var hg_member_Data = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of host group members\"] = hg_member_Data;", - " var i = 0;", - " while (i < hg_member_Data.length) {", - " if (postman.getEnvironmentVariable(\"host_name\") == hg_member_Data[i].name)", - " {", - " tests[\"Body contains added host_name\"] = postman.getEnvironmentVariable(\"host_name\") == hg_member_Data[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == hg_member_Data.length)", - " tests[\"host_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getmember\",\n \"object\": \"hg\",\n \"values\": \"{{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": [] - } - ], - "description": "Tests all commands to manage host groups." - }, - { - "name": "33-Hosts_Categories", - "item": [ - { - "name": "Addmember", - "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\": \"addmember\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{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": "Delmember", - "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\": \"delmember\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{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": "Setmember", - "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\": \"setmember\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{host_name}}|{{host_name2}}\"\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": "Getmember", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var hc_member_Data = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of host category members\"] = hc_member_Data;", - " var i = 0;", - " while (i < hc_member_Data.length) {", - " if (postman.getEnvironmentVariable(\"host_name\") == hc_member_Data[i].name)", - " {", - " tests[\"Body contains added host_name\"] = postman.getEnvironmentVariable(\"host_name\") == hc_member_Data[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == hc_member_Data.length)", - " {", - " tests[\"host_name was found\"] = false;", - " }", - "}", - "catch (e) {}", - "", - "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\": \"getmember\",\n \"object\": \"hc\",\n \"values\": \"{{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": "Unsetseverity", - "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\": \"unsetseverity\",\n \"object\": \"hc\",\n \"values\": \"{{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": "List host categories", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var hcData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of host categories\"] = hcData;", - " var i = 0;", - " while (i < hcData.length) {", - " if (postman.getEnvironmentVariable(\"hc_name\") == hcData[i].name)", - " {", - " tests[\"Body contains added hc_name\"] = postman.getEnvironmentVariable(\"hc_name\") == hcData[i].name;", - " tests[\"Body contains added hc_alias\"] = postman.getEnvironmentVariable(\"hc_alias\") == hcData[i].alias;", - " break;", - " }", - " i++;", - " }", - " if (i == hcData.length)", - " tests[\"hc_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"hc\"\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." - }, - { - "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\": \"test_stpl;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 description", - "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\": \"test_stpl;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 activate", - "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}};activate;{{stpl_activate}}\"\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 alias", - "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}};alias;{{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": "Create service template-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\": \"stpl\",\n \"values\": \"{{stpl_description2}};test_alias;{{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\": \"stpl\",\n \"values\": \"{{stpl_description}};template;{{stpl_description2}}\"\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 is_volatile", - "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}};is_volatile;{{stpl_is_volatile}}\"\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 check_command_arguments", - "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_arguments;{{command_argument}}\"\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": "Setparam normal_check_interval", - "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}};normal_check_interval;{{stpl_normal_check_interval}}\"\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 retry_check_interval", - "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}};retry_check_interval;{{stpl_retry_check_interval}}\"\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_checks_enabled", - "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}};active_checks_enabled;{{stpl_active_check_enabled}}\"\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_checks_enabled", - "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}};passive_checks_enabled;{{stpl_passive_check_enabled}}\"\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 contact_additive_inheritance", - "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}};contact_additive_inheritance;{{stpl_contact_additive_inheritance}}\"\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 cg_additive_inheritance", - "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}};cg_additive_inheritance;{{stpl_cg_additive_inheritance}}\"\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 notification_interval", - "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}};notification_interval;{{stpl_notification_interval}}\"\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 notification_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}};notification_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 notification_options", - "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}};notification_options;{{stpl_notif_option}}\"\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 first_notification_delay", - "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}};first_notification_delay;{{stpl_first_notif_delay}}\"\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 parallelize_check", - "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}};parallelize_check;{{stpl_parallelize_checks}}\"\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 obsess_over_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\": \"setparam\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};obsess_over_service;{{stpl_obsess_over_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": [] - }, - { - "name": "Setparam check_freshness", - "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_freshness;{{stpl_check_freshness}}\"\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 freshness_threshold", - "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}};freshness_threshold;{{stpl_freshness_threshold}}\"\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 event_handler_enabled", - "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}};event_handler_enabled;{{stpl_event_handler_enabled}}\"\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 flap_detection_enabled", - "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}};flap_detection_enabled;{{stpl_flap_detection_enabled}}\"\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 process_perf_data", - "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}};process_perf_data;{{stpl_process_perf_data}}\"\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 retain_status_informations", - "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}};retain_status_information;{{stpl_retain_status_info}}\"\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 retain_nonstatus_informations", - "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}};retain_nonstatus_information;{{stpl_retain_nonstatus_info}}\"\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 stalking_options", - "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}};stalking_options;{{stpl_stalking_options}}\"\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 event_handler", - "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}};event_handler;{{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 event_handler_arguments", - "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}};event_handler_arguments;{{stpl_event_handler_arg}}\"\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 notes", - "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}};notes;{{stpl_notes}}\"\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 notes_url", - "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}};notes_url;{{stpl_notes_url}}\"\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 action_url", - "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}};action_url;{{stpl_action_url}}\"\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 icon_image", - "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}};icon_image;{{stpl_icon_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": [] - }, - { - "name": "Setparam icon_image_alt", - "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}};icon_image_alt;{{stpl_icon_image_alt}}\"\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 graphtemplate", - "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}};graphtemplate;{{stpl_graph_tpl}}\"\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 comment", - "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}};comment;{{stpl_comment}}\"\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 service_notif_options", - "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}};service_notification_options;{{stpl_notif_options}}\"\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 templates", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var stplData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of service templates\"] = stplData;", - " var i = 0;", - " while (i < stplData.length) {", - " if (postman.getEnvironmentVariable(\"stpl_description\") == stplData[i].description)", - " {", - " tests[\"Body contains added service template\"] = postman.getEnvironmentVariable(\"stpl_description\") == stplData[i].description;", - " tests[\"Body contains added alias\"] = postman.getEnvironmentVariable(\"stpl_alias\") == stplData[i].alias;", - " tests[\"Body contains added command_name\"] = postman.getEnvironmentVariable(\"command_name\") == stplData[i]['check command'];", - " tests[\"Body contains added comment argument\"] = postman.getEnvironmentVariable(\"command_argument\") == stplData[i]['check command arg'];", - " tests[\"Body contains added normal check interval\"] = postman.getEnvironmentVariable(\"stpl_normal_check_interval\") == stplData[i]['normal check interval'];", - " tests[\"Body contains added retry check interval\"] = postman.getEnvironmentVariable(\"stpl_retry_check_interval\") == stplData[i]['retry check interval'];", - " tests[\"Body contains added max check attempts\"] = postman.getEnvironmentVariable(\"stpl_max_check\") == stplData[i]['max check attempts'];", - " tests[\"Body contains added active checks enabled\"] = postman.getEnvironmentVariable(\"stpl_active_check_enabled\") == stplData[i]['active checks enabled'];", - " tests[\"Body contains added passive checks enabled\"] = postman.getEnvironmentVariable(\"stpl_passive_check_enabled\") == stplData[i]['passive checks enabled'];", - " break;", - " }", - " i++;", - " }", - " if (i == stplData.length)", - " tests[\"stpl_description was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"stpl\"\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": "Addhosttemplate", - "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\": \"addhosttemplate\",\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": "Delhosttemplate", - "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\": \"delhosttemplate\",\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": "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}}|{{htpl_name2}}\"\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": "Setmacro", - "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\": \"setmacro\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{stpl_macro_name}};{{stpl_macro_value}}\"\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": "Getmacro", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var macroData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of macros\"] = macroData;", - " var i = 0;", - " while (i < macroData.length) {", - " if (postman.getEnvironmentVariable(\"stpl_macro_value\") == macroData[i]['macro value']){", - " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"stpl_macro_value\") == macroData[i]['macro value'];", - " break;", - " }", - " i++;", - " }", - " if (i == macroData.length)", - " tests[\"stpl_macro_value was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getmacro\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "Delmacro", - "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\": \"delmacro\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{stpl_macro_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": "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\": \"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": "Delcontact", - "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\": \"delcontact\",\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": "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}}|{{contact_alias2}}\"\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": "Getcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var contactData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contacts\"] = contactData;", - " var i = 0;", - " while (i < contactData.length) {", - " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name){", - " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == contactData.length)", - " tests[\"contact_alias was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getcontact\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "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": [] - }, - { - "name": "Getcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var cgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contact groups\"] = cgData;", - " var i = 0;", - " while (i < cgData.length) {", - " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name){", - " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == cgData.length)", - " tests[\"cg_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getcontactgroup\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "Delcontactgroup", - "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\": \"delcontactgroup\",\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": [] - }, - { - "name": "Add trap", - "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\": \"trap\",\n \"values\": \"test_name;test_OID\"\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 name", - "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\": \"trap\",\n \"values\": \"test_name;name;{{trap_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": "Settrap", - "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\": \"settrap\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{trap_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": "Gettrap", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var trapData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of traps\"] = trapData;", - " var i = 0;", - " while (i < trapData.length) {", - " if (postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name){", - " tests[\"Body contains added trap_name\"] = postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == trapData.length)", - " tests[\"trap_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"gettrap\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "Deltrap", - "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\": \"deltrap\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{trap_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." - }, - { - "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_test;{{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 description", - "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_test;description;{{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": "Setparam activate", - "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}};activate;{{service_activate}}\"\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": "Setparam is_volatile", - "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}};is_volatile;{{service_is_volatile}}\"\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\": \"service\",\n \"values\": \"{{host_name}};{{service_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\": \"service\",\n \"values\": \"{{host_name}};{{service_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 check_command_arguments", - "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}};check_command_arguments;{{command_argument}}\"\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\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};max_check_attempts;{{service_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 normal_check_interval", - "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}};normal_check_interval;{{service_normal_check_interval}}\"\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 retry_check_interval", - "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}};retry_check_interval;{{service_retry_check_interval}}\"\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_checks_enabled", - "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}};active_checks_enabled;{{service_active_check_enabled}}\"\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_checks_enabled", - "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}};passive_checks_enabled;{{service_passive_check_enabled}}\"\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 contact_additive_inheritance", - "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}};contact_additive_inheritance;{{service_contact_additive_inheritance}}\"\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 cg_additive_inheritance", - "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}};cg_additive_inheritance;{{service_cg_additive_inheritance}}\"\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 notifications_enabled", - "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}};notifications_enabled;{{service_notifications_enabled}}\"\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 contact_additive_inheritance", - "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}};contact_additive_inheritance;{{service_contact_additive_inheritance}}\"\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 cg_additive_inheritance", - "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}};cg_additive_inheritance;{{service_cg_additive_inheritance}}\"\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 notification_interval", - "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}};notification_interval;{{service_notif_interval}}\"\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 notification_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\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};notification_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 notification_options", - "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}};notification_options;{{service_notif_option}}\"\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 first_notification_delay", - "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}};first_notification_delay;{{service_first_notif_delay}}\"\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 parallelize_check", - "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}};parallelize_check;{{service_parallelize_checks}}\"\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 obsess_over_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\": \"setparam\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};obsess_over_service;{{service_obsess_over_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": [] - }, - { - "name": "Setparam check_freshness", - "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}};check_freshness;{{service_check_freshness}}\"\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 freshness_threshold", - "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}};freshness_threshold;{{service_freshness_threshold}}\"\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 event_handler_enabled", - "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}};event_handler_enabled;{{service_event_handler_enabled}}\"\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 flap_detection_enabled", - "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}};flap_detection_enabled;{{service_flap_detection_enabled}}\"\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 service_low_flap_threshold", - "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}};service_low_flap_threshold;{{service_low_flap}}\"\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 service_high_flap_threshold", - "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}};service_high_flap_threshold;{{service_high_flap}}\"\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 process_perf_data", - "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}};process_perf_data;{{service_process_perf_data}}\"\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 retain_status_informations", - "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}};retain_status_information;{{service_retain_status_info}}\"\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 retain_nonstatus_informations", - "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}};retain_nonstatus_information;{{service_retain_nonstatus_info}}\"\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 event_handler", - "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}};event_handler;{{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 event_handler_arguments", - "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}};event_handler_arguments;{{service_event_handler_arg}}\"\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 notes", - "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}};notes;{{service_notes}}\"\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 notes_url", - "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}};notes_url;{{service_notes_url}}\"\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 action_url", - "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}};action_url;{{service_action_url}}\"\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 icon_image", - "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}};icon_image;{{service_icon_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": [] - }, - { - "name": "Setparam icon_image_alt", - "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}};icon_image_alt;{{service_icon_image_alt}}\"\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 comment", - "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}};comment;{{service_comment}}\"\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 service_notif_options", - "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}};service_notification_options;{{service_notif_option}}\"\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": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var serviceData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of services\"] = serviceData;", - " var i = 0;", - " while (i < serviceData.length) {", - " if (postman.getEnvironmentVariable(\"service_description\") == serviceData[i].description)", - " {", - " tests[\"Body contains added service\"] = postman.getEnvironmentVariable(\"service_description\") == serviceData[i].description;", - " tests[\"Body contains added host name\"] = postman.getEnvironmentVariable(\"host_name\") == serviceData[i]['host name'];", - " tests[\"Body contains added command_name\"] = postman.getEnvironmentVariable(\"command_name\") == serviceData[i]['check command'];", - " tests[\"Body contains added comment argument\"] = postman.getEnvironmentVariable(\"command_argument\") == serviceData[i]['check command arg'];", - " tests[\"Body contains added normal check interval\"] = postman.getEnvironmentVariable(\"service_normal_check_interval\") == serviceData[i]['normal check interval'];", - " tests[\"Body contains added retry check interval\"] = postman.getEnvironmentVariable(\"service_retry_check_interval\") == serviceData[i]['retry check interval'];", - " tests[\"Body contains added max check attempts\"] = postman.getEnvironmentVariable(\"service_max_check_attempts\") == serviceData[i]['max check attempts'];", - " tests[\"Body contains added active checks enabled\"] = postman.getEnvironmentVariable(\"service_active_check_enabled\") == serviceData[i]['active checks enabled'];", - " tests[\"Body contains added passive checks enabled\"] = postman.getEnvironmentVariable(\"service_passive_check_enabled\") == serviceData[i]['passive checks enabled'];", - " break;", - " }", - " i++;", - " }", - " if (i == serviceData.length)", - " tests[\"service_host was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"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": [] - }, - { - "name": "Addhost", - "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\": \"addhost\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{host_name2}}\"\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": "Delhost", - "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\": \"delhost\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{host_name2}}\"\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": "Sethost-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\": \"sethost\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{host_name2}}\"\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": "Sethost", - "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\": \"sethost\",\n \"object\": \"service\",\n \"values\": \"{{host_name2}};{{service_description}};{{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": "Setmacro", - "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\": \"setmacro\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{service_macro_name}};{{service_macro_value}}\"\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": "Getmacro", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var macroData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of macros\"] = macroData;", - " var i = 0;", - " while (i < macroData.length) {", - " if (postman.getEnvironmentVariable(\"service_macro_name\") == macroData[i]['macro name'])", - " {", - " tests[\"Body contains added macro_name\"] = postman.getEnvironmentVariable(\"service_macro_name\") == macroData[i]['macro name'];", - " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"service_macro_value\") == macroData[i]['macro value'];", - " break;", - " }", - " i++;", - " }", - " if (i == macroData.length)", - " tests[\"service_macro_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getmacro\",\n \"object\": \"service\",\n \"values\": \"{{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": "Delmacro", - "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\": \"delmacro\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{service_macro_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 service categories", - "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_test;description_test\"\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 name", - "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\": \"sc\",\n \"values\": \"sc_test;name;{{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": "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\": \"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": [] - }, - { - "name": "Unsetseverity", - "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\": \"unsetseverity\",\n \"object\": \"sc\",\n \"values\": \"{{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": "Resetseverity", - "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": [] - }, - { - "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": "Unsetseverity", - "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\": \"unsetseverity\",\n \"object\": \"service\",\n \"values\": \"{{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": "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\": \"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": "Delcontact", - "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\": \"delcontact\",\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": "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": "Getcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var contactData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of conctacts\"] = contactData;", - " var i = 0;", - " while (i < contactData.length) {", - " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name)", - " {", - " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == contactData.length)", - " tests[\"contact_alias was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getcontact\",\n \"object\": \"service\",\n \"values\": \"{{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": "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": "Getcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var cgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of conctact groups\"] = cgData;", - " var i = 0;", - " while (i < cgData.length) {", - " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name){", - " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == cgData.length)", - " tests[\"cg_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getcontactgroup\",\n \"object\": \"service\",\n \"values\": \"{{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": "Delcontactgroup", - "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\": \"delcontactgroup\",\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": "Addtrap", - "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\": \"addtrap\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{trap_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": "Deltrap", - "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\": \"deltrap\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{trap_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": "Settrap", - "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\": \"settrap\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{trap_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": "Gettrap", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var trapData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of traps\"] = trapData;", - " var i = 0;", - " while (i < trapData.length) {", - " if (postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name)", - " {", - " tests[\"Body contains added trap_name\"] = postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == trapData.length)", - " tests[\"trap_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"gettrap\",\n \"object\": \"service\",\n \"values\": \"{{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": [] - } - ], - "description": "Tests all commands to manage services." - }, - { - "name": "42-Service_by_Hostgroups", - "item": [ - { - "name": "Add hgservice", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};hgservice_test;{{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 description", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};hgservice_test;description;{{hgservice_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 activate", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};activate;{{hgservice_activate}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Setparam is_volatile", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};is_volatile;{{hgservice_is_volatile}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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 check_command_arguments", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};check_command_arguments;{{command_argument}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};max_check_attempts;{{hgservice_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 normal_check_interval", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};normal_check_interval;{{hgservice_normal_check_interval}}\"\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 retry_check_interval", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};retry_check_interval;{{hgservice_retry_check_interval}}\"\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_checks_enabled", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};active_checks_enabled;{{hgservice_active_check_enabled}}\"\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_checks_enabled", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};passive_checks_enabled;{{hgservice_passive_check_enabled}}\"\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 contact_additive_inheritance", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};contact_additive_inheritance;{{hgservice_contact_additive_inheritance}}\"\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 cg_additive_inheritance", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};cg_additive_inheritance;{{hgservice_cg_additive_inheritance}}\"\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 notifications_enabled", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notifications_enabled;{{hgservice_notifications_enabled}}\"\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 notification_interval", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notification_interval;{{hgservice_notif_interval}}\"\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 notification_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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notification_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 notification_options", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notification_options;{{hgservice_notif_option}}\"\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 first_notification_delay", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};first_notification_delay;{{hgservice_first_notif_delay}}\"\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 parallelize_check", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};parallelize_check;{{hgservice_parallelize_checks}}\"\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 obsess_over_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\": \"setparam\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};obsess_over_service;{{hgservice_obsess_over_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": [] - }, - { - "name": "Setparam check_freshness", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};check_freshness;{{hgservice_check_freshness}}\"\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 freshness_threshold", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};freshness_threshold;{{hgservice_freshness_threshold}}\"\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 event_handler_enabled", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};event_handler_enabled;{{hgservice_event_handler_enabled}}\"\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 flap_detection_enabled", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};flap_detection_enabled;{{hgservice_flap_detection_enabled}}\"\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 process_perf_data", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};process_perf_data;{{hgservice_process_perf_data}}\"\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 retain_status_informations", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};retain_status_information;{{hgservice_retain_status_info}}\"\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 retain_nonstatus_informations", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};retain_nonstatus_information;{{hgservice_retain_nonstatus_info}}\"\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 event_handler", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};event_handler;{{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 event_handler_arguments", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};event_handler_arguments;{{hgservice_event_handler_arg}}\"\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 notes", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notes;{{hgservice_notes}}\"\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 notes_url", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notes_url;{{hgservice_notes_url}}\"\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 action_url", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};action_url;{{hgservice_action_url}}\"\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 icon_image", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};icon_image;{{hgservice_icon_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": [] - }, - { - "name": "Setparam icon_image_alt", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};icon_image_alt;{{hgservice_icon_image_alt}}\"\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 comment", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};comment;{{hgservice_comment}}\"\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 service_notif_options", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};service_notification_options;{{hg_notif_option}}\"\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": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var serviceData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of host group services\"] = serviceData;", - " var i = 0;", - " while (i < serviceData.length) {", - " if (postman.getEnvironmentVariable(\"hgservice_description\") == serviceData[i].description)", - " {", - " tests[\"Body contains added hgservice\"] = postman.getEnvironmentVariable(\"hgservice_description\") == serviceData[i].description;", - " tests[\"Body contains added hgservice_hg\"] = postman.getEnvironmentVariable(\"hg_name\") == serviceData[i]['hg name'];", - " tests[\"Body contains added command_name\"] = postman.getEnvironmentVariable(\"command_name\") == serviceData[i]['check command'];", - " tests[\"Body contains added comment argument\"] = postman.getEnvironmentVariable(\"command_argument\") == serviceData[i]['check command arg'];", - " tests[\"Body contains added normal check interval\"] = postman.getEnvironmentVariable(\"hgservice_normal_check_interval\") == serviceData[i]['normal check interval'];", - " tests[\"Body contains added retry check interval\"] = postman.getEnvironmentVariable(\"hgservice_retry_check_interval\") == serviceData[i]['retry check interval'];", - " tests[\"Body contains added max check attempts\"] = postman.getEnvironmentVariable(\"hgservice_max_check_attempts\") == serviceData[i]['max check attempts'];", - " tests[\"Body contains added active checks enabled\"] = postman.getEnvironmentVariable(\"hgservice_active_check_enabled\") == serviceData[i]['active checks enabled'];", - " tests[\"Body contains added passive checks enabled\"] = postman.getEnvironmentVariable(\"hgservice_passive_check_enabled\") == serviceData[i]['passive checks enabled'];", - " break;", - " }", - " i++;", - " }", - " if (i == serviceData.length)", - " tests[\"hgservice_description was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"hgservice\"\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": "Create hg-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\": \"hg\",\n \"values\": \"{{hg_name2}};{{hg_name2}};0.0.0.0;;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": "Addhostgroup", - "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\": \"addhostgroup\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hg_name2}}\"\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": "Delhostgroup", - "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\": \"delhostgroup\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hg_name2}}\"\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-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\": \"sethostgroup\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hg_name2}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name2}};{{hgservice_description}};{{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": "Setmacro", - "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\": \"setmacro\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hgservice_macro_name}};{{hgservice_macro_value}}\"\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": "Getmacro", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var macroData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of macros\"] = macroData;", - " var i = 0;", - " var macro_name = \"$_SERVICE\" + postman.getEnvironmentVariable(\"hgservice_macro_name\") + \"$\";", - " while (i < macroData.length) {", - " if (macro_name == macroData[i]['macro name'])", - " {", - " tests[\"Body contains added macro_name\"] = macro_name == macroData[i]['macro name'];", - " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"hgservice_macro_value\") == macroData[i]['macro value'];", - " break;", - " }", - " i++;", - " }", - " if (i == macroData.length)", - " tests[\"hgservice_macro_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getmacro\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Delmacro", - "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\": \"delmacro\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hgservice_macro_name}};{{hgservice_macro_value}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Delcontact", - "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\": \"delcontact\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Getcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var contactData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of conctacts\"] = contactData;", - " var i = 0;", - " while (i < contactData.length) {", - " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name)", - " {", - " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == contactData.length)", - " tests[\"contact_alias was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getcontact\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Unsetseverity", - "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\": \"unsetseverity\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Delcontactgroup", - "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Getcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var cgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contact groups\"] = cgData;", - " var i = 0;", - " while (i < cgData.length) {", - " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name)", - " {", - " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == cgData.length)", - " tests[\"cg_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getcontactgroup\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": [] - } - ], - "description": "Tests all commands to manage services on host group." - }, - { - "name": "43-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_test;alias_test\"\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 name", - "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\": \"sg\",\n \"values\": \"sg_test;name;{{sg_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 activate", - "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\": \"sg\",\n \"values\": \"{{sg_name}};activate;{{sg_activate}}\"\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 alias", - "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\": \"sg\",\n \"values\": \"{{sg_name}};alias;{{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": [] - }, - { - "name": "Setparam comment", - "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\": \"sg\",\n \"values\": \"{{sg_name}};comment;{{sg_comment}}\"\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 group", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var sgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of service groups\"] = sgData;", - " var i = 0;", - " while (i < sgData.length) {", - " if (postman.getEnvironmentVariable(\"sg_name\") == sgData[i].name)", - " {", - " tests[\"Body contains added service group\"] = postman.getEnvironmentVariable(\"sg_name\") == sgData[i].name;", - " tests[\"Body contains added service alias\"] = postman.getEnvironmentVariable(\"sg_alias\") == sgData[i].alias;", - " break;", - " }", - " i++;", - " }", - " if (i == sgData.length)", - " tests[\"sg_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"sg\"\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": { - "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\": \"addservice\",\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": "Delservice", - "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\": \"delservice\",\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": "Setservice", - "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": "Getservice", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var serviceData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of services\"] = serviceData;", - " var i = 0;", - " while (i < serviceData.length) {", - " if (postman.getEnvironmentVariable(\"service_description\") == serviceData[i]['service description'])", - " {", - " tests[\"Body contains added host_name\"] = postman.getEnvironmentVariable(\"host_name\") == serviceData[i]['host name'];", - " tests[\"Body contains added service\"] = postman.getEnvironmentVariable(\"service_description\") == serviceData[i]['service description'];", - " break;", - " }", - " i++;", - " }", - " if (i == serviceData.length)", - " tests[\"service_description was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_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": "Addhostgroupservice", - "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\": \"addhostgroupservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{hg_name}},{{hgservice_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": "Delhostgroupservice", - "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\": \"delhostgroupservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{hg_name}},{{hgservice_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": "Sethostgroupservice", - "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\": \"sethostgroupservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{hg_name}},{{hgservice_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": "Gethostgroupservice", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var hgserviceData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of host group services\"] = hgserviceData;", - " var i = 0;", - " while (i < hgserviceData.length) {", - " if (postman.getEnvironmentVariable(\"hgservice_description\") == hgserviceData[i]['service description'])", - " {", - " tests[\"Body contains added hg_name\"] = postman.getEnvironmentVariable(\"hg_name\") == hgserviceData[i]['hostgroup name'];", - " tests[\"Body contains added host hgservice_description\"] = postman.getEnvironmentVariable(\"hgservice_description\") == hgserviceData[i]['service description'];", - " break;", - " }", - " i++;", - " }", - " if (i == hgserviceData.length)", - " tests[\"hg_service_description was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"gethostgroupservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_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 groups." - }, - { - "name": "44-Services_Categories", - "item": [ - { - "name": "Setparam description", - "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\": \"sc\",\n \"values\": \"{{sc_name}};description;{{sc_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": "List service category", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var scData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of service categories\"] = scData;", - " var i = 0;", - " while (i < scData.length) {", - " if (postman.getEnvironmentVariable(\"sc_name\") == scData[i].name)", - " {", - " tests[\"Body contains added service category\"] = postman.getEnvironmentVariable(\"sc_name\") == scData[i].name;", - " tests[\"Body contains added description\"] = postman.getEnvironmentVariable(\"sc_description\") == scData[i].description;", - " break;", - " }", - " i++;", - " }", - " if (i == scData.length)", - " tests[\"sc_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"sc\"\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": { - "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\": \"addservice\",\n \"object\": \"sc\",\n \"values\": \"{{sc_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": "Getservice", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var serviceData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of services\"] = serviceData;", - " var i = 0;", - " while (i < serviceData.length) {", - " if (postman.getEnvironmentVariable(\"service_description\") == serviceData[i]['service description'])", - " {", - " tests[\"Body contains added host_name\"] = postman.getEnvironmentVariable(\"host_name\") == serviceData[i]['host name'];", - " tests[\"Body contains added service_description\"] = postman.getEnvironmentVariable(\"service_description\") == serviceData[i]['service description'];", - " break;", - " }", - " i++;", - " }", - " if (i == serviceData.length)", - " tests[\"service_description was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getservice\",\n \"object\": \"sc\",\n \"values\": \"{{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": "Delservice", - "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\": \"delservice\",\n \"object\": \"sc\",\n \"values\": \"{{sc_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": "Setservice", - "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\": \"sc\",\n \"values\": \"{{sc_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": "Addservicetemplate", - "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\": \"addservicetemplate\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{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": "Getservicetemplate", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var stplData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of stpl_description\"] = stplData;", - " var i = 0;", - " while (i < stplData.length) {", - " if (postman.getEnvironmentVariable(\"stpl_description\") == hgserviceData[i]['service template description']){", - " tests[\"Body contains added stpl_description\"] = postman.getEnvironmentVariable(\"stpl_description\") == stplData[i]['service template description'];", - " break;", - " }", - " i++;", - " }", - " if (i == serviceData.length)", - " tests[\"stpl_description was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"getservicetemplate\",\n \"object\": \"sc\",\n \"values\": \"{{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": "Delservicetemplate", - "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\": \"delservicetemplate\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{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": "Setservicetemplate", - "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\": \"setservicetemplate\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{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": [] - } - ], - "description": "Tests all commands to manage service categories." - }, - { - "name": "50-Traps_Vendors", - "item": [ - { - "name": "Add vendor", - "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\": \"vendor\",\n \"values\": \"test_vendor;test_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 name", - "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\": \"vendor\",\n \"values\": \"test_vendor;name;{{vendor_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 alias", - "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\": \"vendor\",\n \"values\": \"{{vendor_name}};alias;{{vendor_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 description", - "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\": \"vendor\",\n \"values\": \"{{vendor_name}};description;{{vendor_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": "List vendors", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var vendorData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of vendors\"] = vendorData;", - " var i = 0;", - " while (i < vendorData.length) {", - " if (postman.getEnvironmentVariable(\"vendor_name\") == vendorData[i].name) {", - " tests[\"Body contains added vendor\"] = postman.getEnvironmentVariable(\"vendor_name\") == vendorData[i].name;", - " tests[\"Body contains added vendor_alias\"] = postman.getEnvironmentVariable(\"vendor_alias\") == vendorData[i].alias;", - " break;", - " }", - " i++;", - " }", - " if (i == vendorData.length)", - " tests[\"vendor_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"show\",\n \"object\":\"vendor\"\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": "Generatetraps", - "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\": \"generatetraps\",\n \"object\": \"vendor\",\n \"values\": \"{{vendor_name}};{{mib_path}}\"\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 vendors." - }, - { - "name": "51-Traps_SNMP", - "item": [ - { - "name": "Setparam comment", - "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\": \"trap\",\n \"values\": \"{{trap_name}};comments;{{trap_comment}}\"\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 output", - "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\": \"trap\",\n \"values\": \"{{trap_name}};output;{{trap_output}}\"\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 oid", - "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\": \"trap\",\n \"values\": \"{{trap_name}};oid;{{trap_oid}}\"\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 status", - "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\": \"trap\",\n \"values\": \"{{trap_name}};status;{{trap_status}}\"\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 vendor", - "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\": \"trap\",\n \"values\": \"{{trap_name}};vendor;{{trap_vendor}}\"\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 matching_mode", - "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\": \"trap\",\n \"values\": \"{{trap_name}};matching_mode;{{trap_matching_mode}}\"\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 reschedule_svc_enable", - "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\": \"trap\",\n \"values\": \"{{trap_name}};reschedule_svc_enable;{{trap_reschedule_svc_enable}}\"\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 execution_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\": \"trap\",\n \"values\": \"{{trap_name}};execution_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 exec_command_enable", - "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\": \"trap\",\n \"values\": \"{{trap_name}};execution_command_enable;{{trap_exec_command_enable}}\"\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 submit_result_enable", - "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\": \"trap\",\n \"values\": \"{{trap_name}};submit_result_enable;{{trap_submit_result_enable}}\"\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 traps", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var trapData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of matchings\"] = trapData;", - " var i = 0;", - " while (i < trapData.length) {", - " if (postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name) {", - " tests[\"Body contains added trap\"] = postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name;", - " tests[\"Body contains added trap oid\"] = postman.getEnvironmentVariable(\"trap_oid\") == trapData[i].oid;", - " break;", - " }", - " i++;", - " }", - " if (i == trapData.length)", - " tests[\"trap_name was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"show\",\n \"object\":\"trap\"\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": "Addmatching", - "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\": \"addmatching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_name}};test_string;test_reg_exp;ok\"\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": "Get matching id", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var matchingData = jsonData.result;", - "", - "try {", - " var i = 0;", - " while (i < matchingData.length) {", - " if (\"test_string\" == matchingData[i].string) {", - " postman.setEnvironmentVariable(\"trap_matching_token\",matchingData[i].id);", - " break;", - " }", - " i++;", - " }", - "} catch (e) {}", - "", - "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\":\"getmatching\",\n \"object\":\"trap\",\n \"values\": \"{{trap_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": "Updatematching name", - "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\": \"updatematching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}};string;{{trap_string}}\"\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": "Updatematching order", - "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\": \"updatematching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}};order;{{trap_matching_order}}\"\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": "Updatematching status", - "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\": \"updatematching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}};status;{{trap_status_string}}\"\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": "Updatematching regexp", - "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\": \"updatematching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}};regexp;{{trap_reg_exp}}\"\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": "Getmatching", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var matchingData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of matchings\"] = matchingData;", - " var i = 0;", - " while (i < matchingData.length) {", - " if (postman.getEnvironmentVariable(\"trap_string\") == matchingData[i].string) {", - " tests[\"Body contains added string\"] = postman.getEnvironmentVariable(\"trap_string\") == matchingData[i].string;", - " tests[\"Body contains added regular expression\"] = postman.getEnvironmentVariable(\"trap_reg_exp\") == matchingData[i].regexp;", - " tests[\"Body contains added matching status\"] = postman.getEnvironmentVariable(\"trap_status_string\") == matchingData[i].status;", - " tests[\"Body contains added matching order\"] = postman.getEnvironmentVariable(\"trap_matching_order\") == matchingData[i].order;", - " break;", - " }", - " i++;", - " }", - " if (i == matchingData.length)", - " tests[\"trap_string was found\"] = false;", - "} catch (e) {}", - "", - "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\":\"getmatching\",\n \"object\":\"trap\",\n \"values\": \"{{trap_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": "Delmatching", - "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\": \"delmatching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}}\"\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 traps." - }, - { - "name": "60-Downtimes", - "item": [ - { - "name": "Add downtime", - "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\": \"downtime\",\n \"values\": \"downtime_test;descritpion_test\"\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 name", - "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\": \"downtime\",\n \"values\": \"downtime_test;name;{{downtime_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 description", - "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\": \"downtime\",\n \"values\": \"{{downtime_name}};description;{{downtime_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": "List downtimes", - "event": [ - { - "listen": "test", - "script": { - "id": "9dd93e49-984a-4bd8-9235-438e0335fea4", - "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\" },", - " \"name\": { \"type\": \"string\" },", - " \"description\": { \"type\": \"string\" },", - " \"activate\": { \"type\": \"string\" }", - " },", - " \"additionalProperties\": false,", - " \"required \": [\"id \", \"name \", \"description\", \"activate\"]", - " }", - "};", - "", - "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\": \"downtime\"\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 downtimes resources", - "event": [ - { - "listen": "test", - "script": { - "id": "1e5db65d-8018-4b73-a2ec-f20ce4c66eca", - "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\" },", - " \"name\": { \"type\": \"string\" },", - " \"description\": { \"type\": \"string\" },", - " \"activate\": { \"type\": \"string\" },", - " \"hosts\": {},", - " \"host groups\": {},", - " \"services\": {},", - " \"service groups\": {}", - " },", - " \"additionalProperties\": false,", - " \"required \": [\"id \", \"name \", \"description\", \"activate\", \"hosts\", \"host groups\", \"services\", \"service groups\"]", - " }", - "};", - "", - "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\": \"downtime\",\n \"values\" : \"{{downtime_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": "List downtimes resource", - "event": [ - { - "listen": "test", - "script": { - "id": "e1be0a8f-3d90-4111-bbfd-b90bc0be15ee", - "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\" },", - " \"name\": { \"type\": \"string\" },", - " \"description\": { \"type\": \"string\" },", - " \"activate\": { \"type\": \"string\" },", - " \"hosts\": {}", - " },", - " \"additionalProperties\": false,", - " \"required \": [\"id \", \"name \", \"description\", \"activate\", \"hosts\", \"host groups\", \"services\", \"service groups\"]", - " }", - "};", - "", - "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\": \"downtime\",\n \"values\" : \"{{downtime_name}};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": "Addweeklyperiod", - "event": [ - { - "listen": "test", - "script": { - "id": "c5920d29-dd72-42c2-ba6d-fadf7ab06da2", - "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\" },", - " \"name\": { \"type\": \"string\" },", - " \"description\": { \"type\": \"string\" },", - " \"activate\": { \"type\": \"string\" },", - " \"hosts\": {},", - " \"host groups\": {},", - " \"services\": {},", - " \"service groups\": {}", - " },", - " \"additionalProperties\": false,", - " \"required \": [\"id \", \"name \", \"description\", \"activate\", \"hosts\", \"host groups\", \"services\", \"service groups\"]", - " }", - "};", - "", - "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\": \"downtime\",\n \"values\" : \"{{downtime_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": "List downtimes resource", - "event": [ - { - "listen": "test", - "script": { - "id": "1a562f54-f44d-40c5-945a-40f082a82c32", - "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\" },", - " \"name\": { \"type\": \"string\" },", - " \"description\": { \"type\": \"string\" },", - " \"activate\": { \"type\": \"string\" },", - " \"hosts\": {}", - " },", - " \"additionalProperties\": false,", - " \"required \": [\"id \", \"name \", \"description\", \"activate\", \"hosts\", \"host groups\", \"services\", \"service groups\"]", - " }", - "};", - "", - "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\": \"downtime\",\n \"values\" : \"{{downtime_name}};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": "Addweeklyperiod", - "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\": \"addweeklyperiod\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{weekly_start_time}};{{weekly_end_time}};{{weekly_fixed}};{{weekly_duration}};{{weekly_day_of_week}}\"\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": "Addmonthlyperiod", - "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\": \"addmonthlyperiod\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{monthly_start_time}};{{monthly_end_time}};{{monthly_fixed}};{{monthly_duration}};{{monthly_day_of_month}}\"\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": "Addspecificperiod", - "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\": \"addspecificperiod\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{specific_start}};{{specific_end}};{{specific_fixed}};{{specific_duration}};{{specific_day_of_week}};{{specific_month_cycle}}\"\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 periods", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var downtimeData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of downtimes\"] = downtimeData;", - " var test_start_w = postman.getEnvironmentVariable(\"weekly_start_time\") + ':00';", - " var test_start_m = postman.getEnvironmentVariable(\"monthly_start_time\") + ':00';", - " var test_start_s = postman.getEnvironmentVariable(\"specific_start\") + ':00';", - " for (var i = 0; i < downtimeData.length; i++) {", - " if (test_start_w == downtimeData[i]['start time'])", - " {", - " tests[\"Body contains added weekly_start_time\"] = test_start_w == downtimeData[i]['start time'];", - " var test_end = postman.getEnvironmentVariable(\"weekly_end_time\") + ':00';", - " tests[\"Body contains added weekly_end_time\"] = test_end == downtimeData[i]['end time'];", - " tests[\"Body contains added weekly_fixed\"] = postman.getEnvironmentVariable(\"weekly_fixed\") == downtimeData[i].fixed;", - " if (downtimeData[i].fixed == \"0\")", - " tests[\"Body contains added weekly_duration\"] = postman.getEnvironmentVariable(\"weekly_duration\") == downtimeData[i].duration;", - " tests[\"Body contains added weekly_day_of_week\"] = postman.getEnvironmentVariable(\"weekly_number_days_of_week\") == downtimeData[i]['day of week'];", - " }", - " if (test_start_m == downtimeData[i]['start time'])", - " {", - " tests[\"Body contains added monthly_start_time\"] = test_start_m == downtimeData[1]['start time'];", - " var test_end = postman.getEnvironmentVariable(\"monthly_end_time\") + ':00';", - " tests[\"Body contains added monthly_end_time\"] = test_end == downtimeData[i]['end time'];", - " tests[\"Body contains added monthly_fixed\"] = postman.getEnvironmentVariable(\"monthly_fixed\") == downtimeData[i].fixed;", - " if (downtimeData[i].fixed == \"0\")", - " tests[\"Body contains added monthly_duration\"] = postman.getEnvironmentVariable(\"monthly_duration\") == downtimeData[i].duration;", - " tests[\"Body contains added monthly_day_of_month\"] = postman.getEnvironmentVariable(\"monthly_day_of_month\") == downtimeData[i]['day of month'];", - " }", - " if (test_start_s == downtimeData[i]['start time'])", - " {", - " tests[\"Body contains added specific_start_time\"] = test_start_s == downtimeData[i]['start time'];", - " var test_end = postman.getEnvironmentVariable(\"specific_end\") + ':00';", - " tests[\"Body contains added specific_end_time\"] = test_end == downtimeData[i]['end time'];", - " tests[\"Body contains added specific_fixed\"] = postman.getEnvironmentVariable(\"specific_fixed\") == downtimeData[i].fixed;", - " if (downtimeData[i].fixed == \"0\")", - " tests[\"Body contains added specific_duration\"] = postman.getEnvironmentVariable(\"specific_duration\") == downtimeData[i].duration;", - " tests[\"Body contains added specific_day_of_week\"] = postman.getEnvironmentVariable(\"specific_number_day_of_week\") == downtimeData[i]['day of week'];", - " }", - " }", - "}", - "catch (e) {}", - "", - "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\": \"listperiods\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Addhost", - "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\": \"addhost\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{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": "Delhost", - "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\": \"delhost\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{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": "Sethost", - "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\": \"sethost\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{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": "Addhostgroup", - "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\": \"addhostgroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Delhostgroup", - "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\": \"delhostgroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "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\": \"downtime\",\n \"values\": \"{{downtime_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": "Addservice", - "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\": \"addservice\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Delservice", - "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\": \"delservice\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Setservice", - "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\": \"downtime\",\n \"values\": \"{{downtime_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": "Addservicegroup", - "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\": \"addservicegroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{sg_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": "Delservicegroup", - "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\": \"delservicegroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{sg_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": "Setservicegroup", - "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\": \"setservicegroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{sg_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 downtimes." - }, - { - "name": "61-Dependencies", - "item": [ - { - "name": "Add dependency", - "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\": \"dep\",\n \"values\": \"dep_test;test_description;{{dep_type}};{{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": "Setparam name", - "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\": \"dep\",\n \"values\": \"dep_test;name;{{dep_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 description", - "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\": \"dep\",\n \"values\": \"{{dep_name}};description;{{dep_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 comment", - "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\": \"dep\",\n \"values\": \"{{dep_name}};comment;{{dep_comment}}\"\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 inherits_parent", - "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\": \"dep\",\n \"values\": \"{{dep_name}};inherits_parent;{{dep_inherits_parent}}\"\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 exec_fail_criteria", - "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\": \"dep\",\n \"values\": \"{{dep_name}};execution_failure_criteria;{{dep_exec_fail_crit}}\"\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 notif_fail_criteria", - "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\": \"dep\",\n \"values\": \"{{dep_name}};notification_failure_criteria;{{dep_notif_fail_crit}}\"\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 dependencies", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var depData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of dependencies\"] = depData;", - " var i = 0;", - " while (i < depData.length) {", - " if (postman.getEnvironmentVariable(\"dep_name\") == depData[i].name)", - " {", - " tests[\"Body contains added dep_name\"] = postman.getEnvironmentVariable(\"dep_name\") == depData[i].name;", - " tests[\"Body contains added dep_description\"] = postman.getEnvironmentVariable(\"dep_description\") == depData[i].description;", - " tests[\"Body contains added dep_inherits_parents\"] = postman.getEnvironmentVariable(\"dep_inherits_parent\") == depData[i].inherits_parent;", - " tests[\"Body contains added dep_execution_failure_criteria\"] = postman.getEnvironmentVariable(\"dep_exec_fail_crit\") == depData[i].execution_failure_criteria;", - " tests[\"Body contains added dep_notification_failure_criteria\"] = postman.getEnvironmentVariable(\"dep_notif_fail_crit\") == depData[i].notification_failure_criteria;", - " break;", - " }", - " i++;", - " }", - " if (i == depData.length)", - " tests[\"dep_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"dep\"\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": "Addparent", - "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\": \"addparent\",\n \"object\": \"dep\",\n \"values\": \"{{dep_name}};{{host_name2}}\"\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": "Create host3", - "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_name3}};{{host_name3}};0.0.0.0;;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": "Addchild", - "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\": \"addchild\",\n \"object\": \"dep\",\n \"values\": \"{{dep_name}};{{host_name3}}\"\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": "Delparent", - "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\": \"delparent\",\n \"object\": \"dep\",\n \"values\": \"{{dep_name}};{{host_name2}}\"\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": "Listdep", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var depData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of dependencies\"] = depData;", - " var i = 0;", - " var nb_find = 0", - " while (i < depData.length) {", - " if (postman.getEnvironmentVariable(\"host_name\") == depData[i].parents)", - " {", - " tests[\"Body contains added a parent\"] = postman.getEnvironmentVariable(\"host_name\") == depData[i].parents;", - " nb_find += 1;", - " }", - " if (postman.getEnvironmentVariable(\"host_name3\") == depData[i].children)", - " {", - " tests[\"Body contains added a child\"] = postman.getEnvironmentVariable(\"host_name3\") == depData[i].children;", - " nb_find += 1;", - " }", - " if (nb_find == 2)", - " break;", - " i++;", - " }", - " if (i == depData.length)", - " tests[\"the child and the parent were found\"] = i < depData.length;", - "}", - "catch (e) {}", - "", - "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\": \"listdep\",\n \"object\": \"dep\",\n \"values\": \"{{dep_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": "Delchild", - "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\": \"delchild\",\n \"object\": \"dep\",\n \"values\": \"{{dep_name}};{{host_name3}}\"\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 dependencies." - }, - { - "name": "70-ACL_Groups", - "item": [ - { - "name": "Add ACL 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\": \"aclgroup\",\n \"values\": \"test_aclg;aclg_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 name", - "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\": \"aclgroup\",\n \"values\": \"test_aclg;name;{{aclg_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 alias", - "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\": \"aclgroup\",\n \"values\": \"{{aclg_name}};alias;{{aclg_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 activate", - "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\": \"aclgroup\",\n \"values\": \"{{aclg_name}};activate;{{aclg_activate}}\"\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 ACL groups", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var aclgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL groups\"] = aclgData;", - " var i = 0;", - " while (i < aclgData.length) {", - " if (postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name) {", - " tests[\"Body contains added ACL resource\"] = postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name;", - " tests[\"Body contains added aclg_alias\"] = postman.getEnvironmentVariable(\"aclg_alias\") == aclgData[i].alias;", - " tests[\"Body contains added aclg_activate\"] = postman.getEnvironmentVariable(\"aclg_activate\") == aclgData[i].activate;", - " break;", - " }", - " i++;", - " }", - " if (i == aclgData.length)", - " tests[\"aclg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"aclgroup\"\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 resource ACL", - "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\": \"aclresource\",\n \"values\": \"test_resourceacl;test_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 name", - "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\": \"aclresource\",\n \"values\": \"test_resourceacl;name;{{racl_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": "Addresource", - "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\": \"addresource\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{racl_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": "Delresource", - "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\": \"delresource\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{racl_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": "Setresource", - "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\": \"setresource\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{racl_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": "Getresource", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var raclData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL resources\"] = raclData;", - " var i = 0;", - " while (i < raclData.length) {", - " if (postman.getEnvironmentVariable(\"racl_name\") == raclData[i].name) {", - " tests[\"Body contains added ACL resource\"] = postman.getEnvironmentVariable(\"racl_name\") == raclData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == raclData.length)", - " tests[\"racl_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"getresource\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "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\": \"aclgroup\",\n \"values\": \"{{aclg_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": "Delcontact", - "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\": \"delcontact\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "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\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{contact_alias}}|{{contact_alias2}}\"\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": "Getcontact", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var contactData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contacts\"] = contactData;", - " var i = 0;", - " while (i < contactData.length) {", - " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name) {", - " tests[\"Body contains added contact\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == contactData.length)", - " tests[\"aclg_contact_alias was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"getcontact\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "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\": \"aclgroup\",\n \"values\": \"{{aclg_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": "Delcontactgroup", - "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\": \"delcontactgroup\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "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\": \"aclgroup\",\n \"values\": \"{{aclg_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": "Getcontactgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var cgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of contact groups\"] = cgData;", - " var i = 0;", - " while (i < cgData.length) {", - " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name) {", - " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == cgData.length)", - " tests[\"cg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"getcontactgroup\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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 ACL Menu", - "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\": \"aclmenu\",\n \"values\": \"test_aclmenu;test_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 name", - "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\": \"aclmenu\",\n \"values\": \"test_aclmenu;name;{{aclmenu_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": "Addmenu", - "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\": \"addmenu\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{aclmenu_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": "Delmenu", - "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\": \"delmenu\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{aclmenu_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": "Setmenu", - "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\": \"setmenu\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{aclmenu_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": "Getmenu", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var aclmenuData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL menus\"] = aclmenuData;", - " var i = 0;", - " while (i < aclmenuData.length) {", - " if (postman.getEnvironmentVariable(\"aclmenu_name\") == aclmenuData[i].name) {", - " tests[\"Body contains added ACL menu\"] = postman.getEnvironmentVariable(\"aclmenu_name\") == aclmenuData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == aclmenuData.length)", - " tests[\"menu_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"getmenu\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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 ACL action", - "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\": \"aclaction\",\n \"values\": \"test_acla;acla_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 name", - "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\": \"aclaction\",\n \"values\": \"test_acla;name;{{acla_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": "Addaction", - "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\": \"addaction\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{acla_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": "Delaction", - "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\": \"delaction\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{acla_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": "Setaction", - "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\": \"setaction\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{acla_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": "Getaction", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var aclaData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL actions\"] = aclaData;", - " var i = 0;", - " while (i < aclaData.length) {", - " if (postman.getEnvironmentVariable(\"acla_name\") == aclaData[i].name) {", - " tests[\"Body contains added ACL action\"] = postman.getEnvironmentVariable(\"acla_name\") == aclaData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == aclaData.length)", - " tests[\"acla_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"getaction\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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 ACL groups." - }, - { - "name": "71-ACL_Menus", - "item": [ - { - "name": "Setparam alias", - "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\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};alias;{{aclmenu_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 activate", - "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\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};activate;{{aclmenu_activate}}\"\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 comment", - "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\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};comment;{{aclmenu_comment}}\"\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 ACL menu", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var aclmenuData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL Menu\"] = aclmenuData;", - " var i = 0;", - " while (i < aclmenuData.length) {", - " if (postman.getEnvironmentVariable(\"aclmenu_name\") == aclmenuData[i].name) {", - " tests[\"Body contains added ACL menu\"] = postman.getEnvironmentVariable(\"aclmenu_name\") == aclmenuData[i].name;", - " tests[\"Body contains added aclmenu_alias\"] = postman.getEnvironmentVariable(\"aclmenu_alias\") == aclmenuData[i].alias;", - " tests[\"Body contains added aclmenu_comment\"] = postman.getEnvironmentVariable(\"aclmenu_comment\") == aclmenuData[i].comment;", - " tests[\"Body contains added aclmenu_activate\"] = postman.getEnvironmentVariable(\"aclmenu_activate\") == aclmenuData[i].activate;", - " break;", - " }", - " i++;", - " }", - " if (i == aclmenuData.length)", - " tests[\"aclmenu_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"aclmenu\"\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": "Get ACL Groups", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var aclgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL Menu\"] = aclgData;", - " var i = 0;", - " while (i < aclgData.length) {", - " if (postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name) {", - " tests[\"Body contains ACL menu\"] = postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i > aclgData.length)", - " tests[\"aclg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"getaclgroup\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_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": "Grantrw Home", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home\"\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": "Revoke Home", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home\"\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": "Grantrw Custom Views", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views\"\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": "Revoke Custom Views", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views\"\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": "Grantrw Edit View", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;Edit View\"\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": "Revoke Edit View", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;Edit View\"\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": "Grantrw Share View", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;Share View\"\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": "Revoke Share View", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;Share View\"\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": "Grantrw Widget Parameters", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;Widget Parameters\"\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": "Revoke Widget Parameters", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;Widget Parameters\"\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": "Grantrw Add Widget", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;add Widget\"\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": "Revoke Add Widget", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;add Widget\"\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": "Grantrw rotation", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;rotation\"\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": "Revoke rotation", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;rotation\"\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": "Grantrw delete view", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;delete view\"\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": "Revoke delete view", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;delete view\"\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": "Grantrw add view", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;add view\"\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": "Revoke add view", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;add view\"\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": "Grantrw set default", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;set default\"\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": "Revoke set default", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;set default\"\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": "Grantrw monitoring", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring\"\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": "Revoke monitoring", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring\"\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": "Grantrw status details", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details\"\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": "Revoke status details", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details\"\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": "Grantrw services (monitoring)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;services\"\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": "Revoke services (monitoring)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;services\"\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": "Grantrw hosts (monitoring)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;hosts\"\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": "Revoke hosts (monitoring)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;hosts\"\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": "Grantrw services grid", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;services grid\"\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": "Revoke services grid", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;services grid\"\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": "Grantrw services by 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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;services by hostgroup\"\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": "Revoke services by 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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;services by hostgroup\"\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": "Grantrw services by 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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;services by servicegroup\"\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": "Revoke services by 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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;services by servicegroup\"\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": "Grantrw hostgroups summary", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;hostgroups summary\"\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": "Revoke hostgroups summary", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;hostgroups summary\"\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": "Grantrw performances", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances\"\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": "Revoke performances", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances\"\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": "Grantrw graphs", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;graphs\"\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": "Revoke graphs", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;graphs\"\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": "Grantrw chart split", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;graphs;chart split\"\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": "Revoke chart split", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;graphs;chart split\"\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": "Grantrw chart periods", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;graphs;chart periods\"\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": "Revoke chart periods", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;graphs;chart periods\"\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": "Grantrw templates (perf)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;templates\"\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": "Revoke templates (perf)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;templates\"\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": "Grantrw curves", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;curves\"\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": "Revoke curves", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;curves\"\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": "Grantrw metrics", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;virtual metrics\"\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": "Revoke metrics", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;virtual metrics\"\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": "Grantrw event logs", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;event logs\"\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": "Revoke event logs", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;event logs\"\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": "Grantrw event logs (advanced)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;event logs;event logs\"\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": "Revoke event logs (advanced)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;event logs;event logs\"\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": "Grantrw system logs", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;event logs;system logs\"\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": "Revoke system logs", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;event logs;system logs\"\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": "Grantrw downtimes", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes\"\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": "Revoke downtimes", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;downtimes\"\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": "Grantrw downtimes (main menu)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes;downtimes\"\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": "Revoke downtimes (main menu)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;downtimes;downtimes\"\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": "Grantrw recurrent downtimes", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes;recurrent downtimes\"\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": "Grantro recurrent downtimes", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes;recurrent downtimes\"\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": "Revoke recurrent downtimes", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;downtimes;recurrent downtimes\"\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": "Grantrw comments", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes;comments\"\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": "Revoke comments", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;downtimes;comments\"\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": "Grantrw reporting", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting\"\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": "Revoke reporting", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting\"\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": "Grantrw dashboard", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard\"\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": "Revoke dashboard", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard\"\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": "Grantrw hosts (dashboard)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard;hosts\"\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": "Revoke hosts (dashboard)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard;hosts\"\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": "Grantrw services (dashboard)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard;services\"\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": "Revoke services (dashboard)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard;services\"\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": "Grantrw host groups (dashboard)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard;host groups\"\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": "Revoke host groups (dashboard)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard;host groups\"\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": "Grantrw service groups (dashboard)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard;service groups\"\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": "Revoke service groups (dashboard)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard;service groups\"\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": "Grantrw configuration", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration\"\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": "Revoke configuration", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration\"\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": "Grant hostsrw (config)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts\"\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": "Revoke hosts (config)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts\"\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": "Grant hostsrw (config/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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;hosts\"\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": "Grant hostsro (config/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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;hosts\"\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": "Revoke hosts (config/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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts;hosts\"\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": "Grantrw host groups (config/hosts)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;host groups\"\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": "Grantro host groups (config/hosts)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;host groups\"\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": "Revoke host groups (config/hosts)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts;host groups\"\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": "Grantrw templates (config/hosts)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;templates\"\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": "Grantro templates (config/hosts)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;templates\"\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": "Revoke templates (config/hosts)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts;templates\"\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": "Grantrw categories (config/hosts)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;categories\"\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": "Grantro categories (config/hosts)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;categories\"\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": "Revoke categories (config/hosts)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts;categories\"\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": "Grantrw services (config)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services\"\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": "Revoke services (config)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services\"\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": "Grantrw services by host (config/services)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;services by 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": "Grantro services by host (config/services)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;services by 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": "Revoke services by host (config/services)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;services by 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": "Grantrw services by host group (config/services)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;services by host group\"\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": "Grantro services by host group (config/services)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;services by host group\"\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": "Revoke services by host group (config/services)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;services by host group\"\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": "Grantrw service groups (config/services)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;service groups\"\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": "Grantro service groups (config/services)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;service groups\"\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": "Revoke service groups (config/services)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;service groups\"\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": "Grantrw templates (config/services)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;templates\"\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": "Grantro templates (config/services)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;templates\"\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": "Revoke templates (config/services)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;templates\"\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": "Grantrw categories (config/services)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;categories\"\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": "Grantro categories (config/services)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;categories\"\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": "Revoke categories (config/services)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;categories\"\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": "Grantrw meta services(config/services)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;meta services\"\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": "Revoke meta services(config/services)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;meta services\"\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": "Grantrw users", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users\"\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": "Revoke users", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users\"\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": "Grantrw Contacts / Users", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contacts / users\"\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": "Grantro Contacts / Users", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contacts / users\"\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": "Revoke Contacts / Users", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users;contacts / users\"\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": "Grantrw contact templates", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contact templates\"\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": "Grantro contact templates", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contact templates\"\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": "Revoke contact templates", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users;contact templates\"\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": "Grantrw contact groups", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contact groups\"\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": "Grantro contact groups", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contact groups\"\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": "Revoke contact groups", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users;contact groups\"\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": "Grantrw time periods", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;time periods\"\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": "Grantro time periods", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;time periods\"\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": "Revoke time periods", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users;time periods\"\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": "Grantrw commands", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands\"\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": "Revoke commands", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands\"\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": "Grantrw checks", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;checks\"\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": "Grantro checks", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;checks\"\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": "Revoke checks", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;checks\"\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": "Grantrw notifications", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;notifications\"\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": "Grantro notifications", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;notifications\"\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": "Revoke notifications", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;notifications\"\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": "Grantrw discovery", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;discovery\"\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": "Grantro discovery", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;discovery\"\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": "Revoke discovery", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;discovery\"\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": "Grantrw miscellaneous", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;miscellaneous\"\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": "Grantro miscellaneous", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;miscellaneous\"\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": "Revoke miscellaneous", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;miscellaneous\"\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": "Grantrw connectors", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;connectors\"\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": "Grantro connectors", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;connectors\"\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": "Revoke connectors", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;connectors\"\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": "Grantrw notifications", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications\"\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": "Revoke notifications", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications\"\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": "Grantrw escalations", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;escalations\"\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": "Grantro escalations", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;escalations\"\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": "Revoke escalations", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;escalations\"\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": "Grantrw hosts (dependencies)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;hosts\"\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": "Grantro hosts (dependencies)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;hosts\"\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": "Revoke hosts (dependencies)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;hosts\"\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": "Grantrw host groups (dependencies)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;host groups\"\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": "Grantro host groups (dependencies)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;host groups\"\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": "Revoke host groups (dependencies)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;host groups\"\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": "Grantrw services(dependencies)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;services\"\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": "Grantro services(dependencies)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;services\"\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": "Revoke services(dependencies)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;services\"\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": "Grantrw service groups(dependencies)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;service groups\"\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": "Grantro service groups(dependencies)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;service groups\"\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": "Revoke service groups(dependencies)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;service groups\"\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": "Grantrw meta services (dependencies)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;meta services\"\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": "Grantro meta services (dependencies)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;meta services\"\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": "Revoke meta services (dependencies)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;meta services\"\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": "Grantrw SNMP traps (config)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps\"\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": "Revoke SNMP traps (config)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps\"\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": "Grantrw SNMP traps (SNMP)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;snmp traps\"\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": "Revoke SNMP traps (SNMP)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;snmp traps\"\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": "Grantrw manufacturer", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;manufacturer\"\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": "Revoke manufacturer", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;manufacturer\"\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": "Grantrw group (SNMP)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;group\"\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": "Revoke group (SNMP)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;group\"\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": "Grantrw mibs", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;mibs\"\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": "Revoke mibs", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;mibs\"\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": "Grantrw generate", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;generate\"\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": "Revoke generate", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;generate\"\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": "Grantrw knowledge base", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base\"\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": "Revoke knowledge base", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base\"\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": "Grantrw hosts (knowledge)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base;hosts\"\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": "Revoke hosts (knowledge)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base;hosts\"\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": "Grantrw services (knowledge)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base;services\"\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": "Revoke services (knowledge)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base;services\"\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": "Grantrw host templates (knowledge)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base;host templates\"\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": "Revoke host templates (knowledge)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base;host templates\"\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": "Grantrw service templates (knowledge)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base;service templates\"\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": "Revoke service templates (knowledge)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base;service templates\"\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": "Grantrw pollers (config)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers\"\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": "Revoke pollers (config)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers\"\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": "Grantrw export configuration", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;export configuration\"\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": "Revoke export configuration", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;export configuration\"\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": "Grantrw pollers (pollers)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;pollers\"\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": "Grantro pollers (pollers)", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;pollers\"\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": "Revoke pollers (pollers)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;pollers\"\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": "Grantrw engine configuration", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;engine configuration\"\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": "Grantro engine configuration", - "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;engine configuration\"\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": "Revoke engine configuration", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;engine configuration\"\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": "Grantrw broker configuration", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;broker configuration\"\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": "Revoke broker configuration", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;broker configuration\"\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": "Grantrw wizard", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;broker configuration;wizard\"\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": "Revoke wizard", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;broker configuration;wizard\"\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": "Grantrw wizardajax", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;broker configuration;wizardajax\"\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": "Revoke wizardajax", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;broker configuration;wizardajax\"\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": "Grantrw resources", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;resources\"\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": "Revoke resources", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;resources\"\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": "Grantrw administration", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration\"\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": "Revoke administration", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration\"\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": "Grantrw parameters", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters\"\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": "Revoke parameters", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters\"\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": "Grantrw centreon UI", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;centreon UI\"\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": "Revoke centreon UI", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;centreon UI\"\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": "Grantrw monitoring (parameters)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;monitoring\"\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": "Revoke monitoring (parameters)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;monitoring\"\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": "Grantrw centcore", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;centcore\"\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": "Revoke centcore", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;centcore\"\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": "Grantrw my account", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;my account\"\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": "Revoke my account", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;my account\"\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": "Grantrw LDAP", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;LDAP\"\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": "Revoke LDAP", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;LDAP\"\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": "Grantrw RRDtool", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;RRDtool\"\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": "Revoke RRDtool", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;RRDtool\"\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": "Grantrw debug", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;debug\"\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": "Revoke debug", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;debug\"\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": "Grantrw knowledge base (parameters)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;knowledge base\"\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": "Revoke knowledge base (parameters)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;knowledge base\"\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": "Grantrw backup", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;backup\"\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": "Revoke backup", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;backup\"\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": "Grantrw options", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;options\"\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": "Revoke options", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;options\"\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": "Grantrw data", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;data\"\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": "Revoke data", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;data\"\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": "Grantrw images", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;images\"\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": "Revoke images", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;images\"\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": "Grantrw extensions", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;extensions\"\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": "Revoke extensions", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;extensions\"\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": "Grantrw manager", - "event": [ - { - "listen": "test", - "script": { - "id": "81a0aa8e-4490-4a4e-8233-f9c16a06fd9d", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;extensions;manager\"\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": "Revoke manager", - "event": [ - { - "listen": "test", - "script": { - "id": "d8323be9-72b3-424d-b7ea-2838ac284089", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;extensions;manager\"\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": "Grantrw ACL", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL\"\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": "Revoke ACL", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL\"\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": "Grantrw access groups", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;access groups\"\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": "Revoke access groups", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;access groups\"\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": "Grantrw menus access", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;menus access\"\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": "Revoke menus access", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;menus access\"\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": "Grantrw resources access", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;resources access\"\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": "Revoke resources access", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;resources access\"\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": "Grantrw actions access", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;actions access\"\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": "Revoke actions access", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;actions access\"\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": "Grantrw reload ACL", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;reload ACL\"\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": "Revoke reload ACL", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;reload ACL\"\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": "Grantrw logs", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;logs\"\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": "Revoke logs", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;logs\"\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": "Grantrw sessions", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;sessions\"\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": "Revoke sessions", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;sessions\"\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": "Grantrw platform status", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;platform status\"\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": "Revoke platform status", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;platform status\"\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": "Grantrw broker statistics", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;platform status;broker statistics\"\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": "Revoke broker statistics", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;platform status;broker statistics\"\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": "Grantrw engine statistics", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;platform status;engine statistics\"\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": "Revoke engine statistics", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;platform status;engine statistics\"\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": "Grantrw databases", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;platform status;databases\"\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": "Revoke databases", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;platform status;databases\"\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": "Grantrw about (admin)", - "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;about\"\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": "Revoke about (admin)", - "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;about\"\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 ACL menu." - }, - { - "name": "72-ACL_Resources", - "item": [ - { - "name": "Setparam alias", - "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\": \"aclresource\",\n \"values\": \"{{racl_name}};alias;{{racl_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 activate", - "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\": \"aclresource\",\n \"values\": \"{{racl_name}};activate;{{racl_activate}}\"\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 resource ACL", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var raclData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL resource\"] = raclData;", - " var i = 0;", - " while (i < raclData.length) {", - " if (postman.getEnvironmentVariable(\"racl_name\") == raclData[i].name) {", - " tests[\"Body contains added ACL resource\"] = postman.getEnvironmentVariable(\"racl_name\") == raclData[i].name;", - " tests[\"Body contains added racl_alias\"] = postman.getEnvironmentVariable(\"racl_alias\") == raclData[i].alias;", - " tests[\"Body contains added racl_activate\"] = postman.getEnvironmentVariable(\"racl_activate\") == raclData[i].activate;", - " break;", - " }", - " i++;", - " }", - " if (i == raclData.length)", - " tests[\"racl_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"aclresource\"\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": "Getaclgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var aclgData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL groups\"] = aclgData;", - " var i = 0;", - " while (i < aclgData.length) {", - " if (postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name) {", - " tests[\"Body contains added ACL resource\"] = postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == aclgData.length)", - " tests[\"aclg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"getaclgroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "Grant_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\": \"grant_host\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "Revoke_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\": \"revoke_host\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "Grant_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\": \"grant_hostgroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "Revoke_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\": \"revoke_hostgroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "Grant_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\": \"grant_servicegroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{sg_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": "Revoke_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\": \"revoke_servicegroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{sg_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": "addhostexclusion", - "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\": \"addhostexclusion\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "delhostexclusion", - "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\": \"delhostexclusion\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "addfilter_instance", - "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\": \"addfilter_instance\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{instance_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": "delfilter_instance", - "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\": \"delfilter_instance\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{instance_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": "addfilter_hostcategory", - "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\": \"addfilter_hostcategory\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "delfilter_hostcategory", - "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\": \"delfilter_hostcategory\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "addfilter_servicecategory", - "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\": \"addfilter_servicecategory\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "delfilter_servicecategory", - "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\": \"delfilter_servicecategory\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": [] - } - ], - "description": "Tests all commands to manage Resource ACL." - }, - { - "name": "74-ACL_Actions", - "item": [ - { - "name": "Setparam description", - "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\": \"aclaction\",\n \"values\": \"{{acla_name}};description;{{acla_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 activate", - "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\": \"aclaction\",\n \"values\": \"{{acla_name}};activate;{{acla_activate}}\"\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 ACL actions", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var aclaData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL actions\"] = aclaData;", - " var i = 0;", - " while (i < aclaData.length) {", - " if (postman.getEnvironmentVariable(\"acla_name\") == aclaData[i].name) {", - " tests[\"Body contains added ACL action\"] = postman.getEnvironmentVariable(\"acla_name\") == aclaData[i].name;", - " tests[\"Body contains added acla_description\"] = postman.getEnvironmentVariable(\"acla_description\") == aclaData[i].description;", - " tests[\"Body contains added acla_activate\"] = postman.getEnvironmentVariable(\"acla_activate\") == aclaData[i].activate;", - " break;", - " }", - " i++;", - " }", - " if (i == aclaData.length)", - " tests[\"acla_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"aclaction\"\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": "Getaclgroup", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var aclaData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ACL actions\"] = aclaData;", - " var i = 0;", - " while (i < aclaData.length) {", - " if (postman.getEnvironmentVariable(\"aclg_name\") == aclaData[i].name) {", - " tests[\"Body contains added ACL action\"] = postman.getEnvironmentVariable(\"aclg_name\") == aclaData[i].name;", - " break;", - " }", - " i++;", - " }", - " if (i == aclaData.length)", - " tests[\"aclg_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"getaclgroup\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_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": "Grant global_event_handler", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_event_handler\"\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": "Revoke global_event_handler", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_event_handler\"\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": "Grant global_flap_detection", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_flap_detection\"\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": "Revoke global_flap_detection", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_flap_detection\"\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": "Grant global_host_checks", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_checks\"\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": "Revoke global_host_checks", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_checks\"\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": "Grant global_host_obsess", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_obsess\"\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": "Revoke global_host_obsess", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_obsess\"\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": "Grant global_host_passive_checks", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_passive_checks\"\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": "Revoke global_host_passive_checks", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_passive_checks\"\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": "Grant global_notifications", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_notifications\"\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": "Revoke global_notifications", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_notifications\"\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": "Grant global_perf_data", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_perf_data\"\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": "Revoke global_perf_data", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_perf_data\"\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": "Grant global_restart", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_restart\"\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": "Revoke global_restart", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_restart\"\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": "Grant global_service_checks", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_checks\"\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": "Revoke global_service_checks", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_checks\"\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": "Grant global_service_obsess", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_obsess\"\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": "Revoke global_service_obsess", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_obsess\"\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": "Grant global_service_passive_checks", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_passive_checks\"\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": "Revoke global_service_passive_checks", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_passive_checks\"\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": "Grant global_shutdown", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_shutdown\"\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": "Revoke global_shutdown", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_shutdown\"\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": "Grant host_acknowledgement", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_acknowledgement\"\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": "Revoke host_acknowledgement", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_acknowledgement\"\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": "Grant host_checks", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_checks\"\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": "Revoke host_checks", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_checks\"\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": "Grant host_checks_for_services", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_checks_for_services\"\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": "Revoke host_checks_for_services", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_checks_for_services\"\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": "Grant host_comment", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_comment\"\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": "Revoke host_comment", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_comment\"\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": "Grant host_event_handler", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_event_handler\"\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": "Revoke host_event_handler", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_event_handler\"\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": "Grant host_flap_detection", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_flap_detection\"\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": "Revoke host_flap_detection", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_flap_detection\"\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": "Grant host_notifications", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_notifications\"\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": "Revoke host_notifications", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_notifications\"\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": "Grant host_notifications_for_services", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_notifications_for_services\"\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": "Revoke host_notigications_for_services", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_notifications_for_services\"\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": "Grant host_schedule_check", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_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": "Revoke host_schedule_check", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_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": "Grant host_schedule_downtime", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_forced_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": "Revoke host_schedule_downtime", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_downtime\"\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": "Grant host_schedule_forced_check", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_forced_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": "Revoke host_schedule_forced_check", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_forced_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": "Grant host_submit_result", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_submit_result\"\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": "Revoke host_submit_result", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_submit_result\"\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": "Grant poller_listing", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};poller_listing\"\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": "Revoke poller_listing", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};poller_listing\"\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": "Grant poller_stats", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};poller_stats\"\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": "Revoke poller_stats", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};poller_stats\"\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": "Grant service_acknowledgement", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_acknowledgement\"\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": "Revoke service_acknowledgement", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_acknowledgement\"\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": "Grant service_checks", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_checks\"\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": "Revoke service_checks", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_checks\"\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": "Grant service_comment", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_comment\"\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": "Revoke service_comment", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_comment\"\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": "Grant service_event_handler", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_event_handler\"\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": "Revoke service_event_handler", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_event_handler\"\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": "Grant service_flap_detection", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_flap_detection\"\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": "Revoke service_flap_detection", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_flap_detection\"\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": "Grant service_notifications", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_notifications\"\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": "Revoke service_notifications", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_notifications\"\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": "Grant service_passive_checks", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_passive_checks\"\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": "Revoke service_passive_checks", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_passive_checks\"\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": "Grant service_schedule_check", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_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": "Revoke service_schedule_check", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_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": "Grant service_schedule_downtime", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_downtime\"\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": "Revoke service_schedule_downtime", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_downtime\"\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": "Grant service_schedule_forced_check", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_forced_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": "Revoke service_schedule_forced_check", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_forced_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": "Grant service_submit_result", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_submit_result\"\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": "Revoke service_submit_result", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_submit_result\"\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": "Grant top_counter", - "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};top_counter\"\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": "Revoke top_counter", - "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};top_counter\"\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 ACL action." - }, - { - "name": "75-ACL_Reload", - "item": [ - { - "name": "Reload", - "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\": \"reload\",\n \"object\": \"acl\"\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": "Lastreload", - "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\": \"lastreload\",\n \"object\": \"acl\"\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": "Lastreload input time", - "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\": \"lastreload\",\n \"object\": \"acl\",\n \"values\": \"lastreload_time\"\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 ACL." - }, - { - "name": "80-Administration_General_Settings", - "item": [ - { - "name": "Setparam broker", - "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\": \"settings\",\n \"values\": \"broker;{{broker_value}}\"\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 centstorage", - "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\": \"settings\",\n \"values\": \"centstorage;{{centstorage_value}}\"\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 debug_auth", - "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\": \"settings\",\n \"values\": \"debug_auth;{{enable_debug_auth}}\"\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 debug_ldap_import", - "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\": \"settings\",\n \"values\": \"debug_ldap_import;{{enable_ldap_debug}}\"\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 debug_nagios_import", - "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\": \"settings\",\n \"values\": \"debug_nagios_import;{{enable_nagios_debug}}\"\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 debug_path", - "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\": \"settings\",\n \"values\": \"debug_path;{{debug_path}}\"\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 debug_rrdtool", - "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\": \"settings\",\n \"values\": \"debug_rrdtool;{{enable_debug_rrdtool}}\"\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 enable_autologin", - "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\": \"settings\",\n \"values\": \"enable_autologin;{{enable_autologin}}\"\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 enable_gmt", - "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\": \"settings\",\n \"values\": \"enable_gmt;{{enable_gmt}}\"\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 enable_logs_sync", - "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\": \"settings\",\n \"values\": \"enable_logs_sync;{{enable_logs_sync}}\"\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 enable_perfdata_sync", - "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\": \"settings\",\n \"values\": \"enable_perfdata_sync;{{enable_perfdata_sync}}\"\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 gmt", - "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\": \"settings\",\n \"values\": \"gmt;{{gmt_value}}\"\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 interval_length", - "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\": \"settings\",\n \"values\": \"interval_length;{{interval_length}}\"\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 mailer_path_bin", - "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\": \"settings\",\n \"values\": \"mailer_path_bin;{{mailer_path_bin}}\"\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 nagios_path_img", - "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\": \"settings\",\n \"values\": \"nagios_path_img;{{nagios_path_img}}\"\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 perl_library_path", - "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\": \"settings\",\n \"values\": \"perl_library_path;{{perl_library_path}}\"\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 rrdtool_path_bin", - "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\": \"settings\",\n \"values\": \"rrdtool_path_bin;{{rrdtool_path_bin}}\"\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 snmpttconvertmib_path_bin", - "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\": \"settings\",\n \"values\": \"snmpttconvertmib_path_bin;{{snmpttconvertmib_path_bin}}\"\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 snmptt_unknowntrap_log_file", - "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\": \"settings\",\n \"values\": \"snmptt_unknowntrap_log_file;{{snmptt_unknowntrap_log_file}}\"\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 settings", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var exceptionData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of exceptions\"] = exceptionData;", - " for (var i = 0; i < exceptionData.length; i++) {", - " switch (exceptionDate[i].parameter)", - " {", - " case \"broker\":", - " tests[\"Body contains the correct setting broker\"] = postman.getEnvironmentVariable(\"broker_value\") == exceptionData[i].value;", - " break;", - " case \"debug_auth\":", - " tests[\"Body contains the correct setting debug_auth\"] = postman.getEnvironmentVariable(\"enable_debug_auth\") == exceptionData[i].value;", - " break;", - " case \"debug_ldap_import\":", - " tests[\"Body contains the correct setting debug_ldap_import\"] = postman.getEnvironmentVariable(\"enable_ldap_debug\") == exceptionData[i].value;", - " break;", - " case \"debug_nagios_import\":", - " tests[\"Body contains the correct setting debug_nagios_ldap\"] = postman.getEnvironmentVariable(\"enable_nagios_debug\") == exceptionData[i].value;", - " break;", - " case \"debug_path\":", - " tests[\"Body contains the correct setting debug_path\"] = postman.getEnvironmentVariable(\"debug_path\") == exceptionData[i].value;", - " break;", - " case \"debug_rrdtool\":", - " tests[\"Body contains the correct setting debug_rrdtool\"] = postman.getEnvironmentVariable(\"enable_debug_rrdtool\") == exceptionData[i].value;", - " break;", - " case \"enable_autologin\":", - " tests[\"Body contains the correct setting enable_authologin\"] = postman.getEnvironmentVariable(\"enable_autologin\") == exceptionData[i].value;", - " break;", - " case \"enable_logs_sync\":", - " tests[\"Body contains the correct setting enable_logs_sync\"] = postman.getEnvironmentVariable(\"enable_logs_sync\") == exceptionData[i].value;", - " break;", - " case \"enable_perfdata_sync\":", - " tests[\"Body contains the correct setting enable_logs_sync\"] = postman.getEnvironmentVariable(\"enable_logs_sync\") == exceptionData[i].value;", - " break;", - " case \"enable_perfdata_sync\":", - " tests[\"Body contains the correct setting enable_perfdata_sync\"] = postman.getEnvironmentVariable(\"enable_perfdata_sync\") == exceptionData[i].value;", - " break;", - " case \"gmt\":", - " tests[\"Body contains the correct setting gmt\"] = postman.getEnvironmentVariable(\"gmt_value\") == exceptionData[i].value;", - " break;", - " case \"interval_length\":", - " tests[\"Body contains the correct setting interval_length\"] = postman.getEnvironmentVariable(\"interval_length\") == exceptionData[i].value;", - " break;", - " case \"mailer_path_bin\":", - " tests[\"Body contains the correct setting mailer_path_bin\"] = postman.getEnvironmentVariable(\"mailer_path_bin\") == exceptionData[i].value;", - " break;", - " case \"nagios_path_img\":", - " tests[\"Body contains the correct setting nagios_path_img\"] = postman.getEnvironmentVariable(\"nagios_path_img\") == exceptionData[i].value;", - " break;", - " case \"perl_library_path\":", - " tests[\"Body contains the correct setting perl_library_path\"] = postman.getEnvironmentVariable(\"perl_library_path\") == exceptionData[i].value;", - " break;", - " case \"rrdtool_path_bin\":", - " tests[\"Body contains the correct setting rrdtool_path_bin\"] = postman.getEnvironmentVariable(\"rrdtool_path_bin\") == exceptionData[i].value;", - " break;", - " case \"snmpttconvertmib_path_bin\":", - " tests[\"Body contains the correct setting snmpttconvertmib_path_bin\"] = postman.getEnvironmentVariable(\"snmpttconvertmib_path_bin\") == exceptionData[i].value;", - " break;", - " case \"snmptt_unknowntrap_log_file\":", - " tests[\"Body contains the correct setting snmptt_unknowntrap_log_file\"] = postman.getEnvironmentVariable(\"snmptt_unknowntrap_log_file\") == exceptionData[i].value;", - " break;", - " }", - " }", - "} catch (e) {}", - "", - "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\":\"show\",\n \"object\":\"settings\"\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 settings." - }, - { - "name": "81-Administration_LDAP_Settings", - "item": [ - { - "name": "Add LDAP", - "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\": \"ldap\",\n \"values\": \"test_ldap;test_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 name", - "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\": \"ldap\",\n \"values\": \"test_ldap;name;{{ldap_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 description", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};description;{{ldap_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 enable", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};enable;{{ldap_enable}}\"\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 alias", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};alias;{{ldap_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 bind_dn", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};bind_dn;{{ldap_bind_dn}}\"\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 bind_pass", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};bind_pass;{{ldap_bind_pass}}\"\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 group_base_search", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};group_base_search;{{ldap_group_base_search}}\"\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 group_filter", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};group_filter;{{ldap_group_filter}}\"\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 group_member", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};group_member;{{ldap_group_member}}\"\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 group_name", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};group_name;{{ldap_group_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 ldap_auto_import", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_auto_import;{{ldap_auto_import}}\"\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 ldap_contact_tmpl", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_contact_tmpl;{{ctpl_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 ldap_dns_use_domain", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_dns_use_domain;{{ldap_dns_use_domain}}\"\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 ldap_search_limit", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_search_limit;{{ldap_search_limit}}\"\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 ldap_search_timeout", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_search_timeout;{{ldap_search_timeout}}\"\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 ldap_srv_dns", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_srv_dns;{{ldap_srv_dns}}\"\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 ldap_store_password", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_store_password;{{ldap_store_pwd}}\"\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 ldap_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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_template;{{ldap_tpl}}\"\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 protocol_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\": \"ldap\",\n \"values\": \"{{ldap_name}};protocol_version;{{ldap_protocol_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": "Setparam user_base_search", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_base_search;{{ldap_user_base_search}}\"\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 user_email", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_email;{{ldap_user_email}}\"\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 user_filter", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_filter;{{ldap_user_filter}}\"\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 user_firstname", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_firstname;{{ldap_user_firstname}}\"\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 user_lastname", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_lastname;{{ldap_user_lastname}}\"\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 user_name", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_name;{{ldap_user_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 user_pager", - "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_pager;{{ldap_user_pager}}\"\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 user_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\": \"setparam\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_name}};user_group;{{ldap_user_group}}\"\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 LDAP", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var ldapData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of ldap configurations\"] = ldapData;", - " var i = 0;", - " while (i < ldapData.length) {", - " if (postman.getEnvironmentVariable(\"ldap_name\") == ldapData[i].name) {", - " tests[\"Body contains added ldap_name\"] = postman.getEnvironmentVariable(\"ldap_name\") == ldapData[i].name;", - " tests[\"Body contains added ldap_description\"] = postman.getEnvironmentVariable(\"ldap_description\") == ldapData[i].description;", - " tests[\"Body contains added ldap_enable\"] = postman.getEnvironmentVariable(\"ldap_enable\") == ldapData[i].status;", - " break;", - " }", - " i++;", - " }", - " if (i == ldapData.length)", - " tests[\"ldap_name was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"ldap\"\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": "Addserver", - "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\": \"addserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_name}};{{ldap_server_address}};{{ldap_server_port}};{{ldap_use_ssl}};{{ldap_use_tls}}\"\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": "Get server id", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var serverData = jsonData.result;", - "", - "try {", - " var i = 0;", - " while (i < serverData.length) {", - " if (postman.getEnvironmentVariable(\"ldap_server_address\") == serverData[i].address) {", - " postman.setEnvironmentVariable(\"ldap_server_id\",serverData[i].id);", - " break;", - " }", - " i++;", - " }", - " if (i == serverData.length)", - " tests[\"ldap_server_adress was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"showserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_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": "Setparamserver host_address", - "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};host_address;{{ldap_host_address}}\"\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": "Setparamserver host_port", - "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};host_port;{{ldap_host_port}}\"\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": "Setparamserver host_order", - "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};host_order;{{ldap_host_order}}\"\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": "Setparamserver use_ssl", - "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};use_ssl;{{ldap_use_ssl_changed}}\"\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": "Setparamserver use_tls", - "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};use_tls;{{ldap_use_tls_changed}}\"\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": "Showserver", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var serverData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of servers\"] = serverData;", - " var i = 0;", - " while (i < serverData.length) {", - " if (postman.getEnvironmentVariable(\"ldap_host_address\") == serverData[i].address) {", - " tests[\"Body contains added server\"] = postman.getEnvironmentVariable(\"ldap_host_address\") == serverData[i].address;", - " tests[\"Body contains added server_port\"] = postman.getEnvironmentVariable(\"ldap_host_port\") == serverData[i].port;", - " tests[\"Body contains added server_use_ssl\"] = postman.getEnvironmentVariable(\"ldap_use_ssl_changed\") == serverData[i].ssl;", - " tests[\"Body contains added server_use_tls\"] = postman.getEnvironmentVariable(\"ldap_use_tls_changed\") == serverData[i].tls;", - " tests[\"Body contains added server_use_tls\"] = postman.getEnvironmentVariable(\"ldap_host_order\") == serverData[i].order;", - " break;", - " }", - " i++;", - " }", - " if (i == serverData.length)", - " tests[\"ldap_server_address was found\"] = false;", - "} catch (e) {}", - "", - "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\": \"showserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_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": "Delserver", - "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\": \"delserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_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": [] - } - ], - "description": "Tests all commands to manage LDAP." - }, - { - "name": "90-Engine_CFG", - "item": [ - { - "name": "Add engine_CFG", - "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\": \"enginecfg\",\n \"values\": \"{{engine_nagios_config}};{{instance_name}};{{engine_comment}}\"\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 name", - "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\": \"enginecfg\",\n \"values\": \"{{engine_nagios_config}};nagios_name;{{engine_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 instance", - "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\": \"enginecfg\",\n \"values\": \"{{engine_name}};instance;{{instance_name2}}\"\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 broker_module", - "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\": \"enginecfg\",\n \"values\": \"{{engine_name}};broker_module;{{instance_broker_module}}\"\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 activate", - "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\": \"enginecfg\",\n \"values\": \"{{engine_name}};nagios_activate;{{instance_activate}}\"\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 engine_CFG", - "event": [ - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "var jsonData = JSON.parse(responseBody);", - "var engineData = jsonData.result;", - "", - "try {", - " tests[\"Body contains list of downtimes\"] = engineData;", - " var i = 0;", - " while (i < engineData.length) {", - " if (postman.getEnvironmentVariable(\"engine_name\") == engineData[i]['nagios name']){", - " tests[\"Body contains added engine_name\"] = postman.getEnvironmentVariable(\"engine_name\") == engineData[i]['nagios name'];", - " tests[\"Body contains added instance_name2\"] = postman.getEnvironmentVariable(\"instance_name2\") == engineData[i].instance;", - " tests[\"Body contains added engine_comment\"] = postman.getEnvironmentVariable(\"engine_comment\") == engineData[i]['nagios comment'];", - " break;", - " }", - " i++;", - " }", - " if (i == engineData.length)", - " tests[\"engine_name was found\"] = false;", - "}", - "catch (e) {}", - "", - "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\": \"show\",\n \"object\": \"enginecfg\"\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": "Addbrokermodule", - "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\": \"addbrokermodule\",\n \"object\": \"enginecfg\",\n \"values\": \"{{engine_name}};{{instance_broker_module2}}\"\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 ACL." - }, - { - "name": "99-Delete", - "item": [ - { - "name": "Del ACL action", - "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\": \"del\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_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": "Del ACL 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\": \"del\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "Del ACL Menu", - "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\": \"del\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_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": "Del resource ACL", - "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\": \"del\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "Del 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\": \"del\",\n \"object\": \"cmd\",\n \"values\": \"{{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": "Del 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\": \"del\",\n \"object\": \"cg\",\n \"values\": \"{{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": "Del ctpl", - "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\": \"del\",\n \"object\": \"contacttpl\",\n \"values\": \"{{ctpl_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": "Del ctpl2", - "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\": \"del\",\n \"object\": \"contacttpl\",\n \"values\": \"{{ctpl_alias2}}\"\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": "Del 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\": \"del\",\n \"object\": \"contact\",\n \"values\": \"{{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": "Del contact2", - "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\": \"del\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias2}}\"\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": "Del dependencies", - "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\": \"del\",\n \"object\": \"dep\",\n \"values\": \"{{dep_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": "Del downtime", - "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\": \"del\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Del engine_CFG", - "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\": \"del\",\n \"object\": \"enginecfg\",\n \"values\": \"{{engine_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": "Del 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\": \"del\",\n \"object\": \"hc\",\n \"values\": \"{{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": "Del hgservice", - "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\": \"del\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Del host 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\": \"del\",\n \"object\": \"hg\",\n \"values\": \"{{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": "Del host group2", - "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\": \"del\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name2}}\"\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": "Del resource CFG", - "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\": \"del\",\n \"object\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_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": [] - }, - { - "name": "Del Instance", - "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\": \"del\",\n \"object\": \"instance\",\n \"values\": \"{{instance_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": "Del Instance2", - "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\": \"del\",\n \"object\": \"instance\",\n \"values\": \"{{instance_name2}}\"\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": "Del 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\": \"del\",\n \"object\": \"service\",\n \"values\": \"{{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": "Del host3", - "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\": \"del\",\n \"object\": \"host\",\n \"values\": \"{{host_name3}}\"\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": "Del htpl2", - "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\": \"del\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name2}}\"\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": "Del htpl3", - "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\": \"del\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name3}}\"\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": "Del LDAP", - "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\": \"del\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_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": "Del 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\": \"del\",\n \"object\": \"sg\",\n \"values\": \"{{sg_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": "Del 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\": \"del\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "Del service template2", - "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\": \"del\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description2}}\"\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": "Del 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\": \"del\",\n \"object\": \"sc\",\n \"values\": \"{{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": "Del 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\": \"del\",\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": "Del htpl", - "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\": \"del\",\n \"object\": \"htpl\",\n \"values\": \"{{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": "Del 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\": \"del\",\n \"object\": \"tp\",\n \"values\": \"{{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": "Del trap", - "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\": \"del\",\n \"object\": \"trap\",\n \"values\": \"{{trap_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": "Del vendor", - "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\": \"del\",\n \"object\": \"vendor\",\n \"values\": \"{{vendor_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": "Delinput ipv4", - "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\": \"delinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_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": [] - }, - { - "name": "Delinput ipv6", - "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\": \"delinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_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": [] - }, - { - "name": "Delinput file", - "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\": \"delinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_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": [] - }, - { - "name": "Dellogger file", - "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\": \"dellogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_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": [] - }, - { - "name": "Dellogger standard", - "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\": \"dellogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_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": [] - }, - { - "name": "Dellogger syslog", - "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\": \"dellogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_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": [] - }, - { - "name": "Dellogger monitoring", - "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\": \"dellogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_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": [] - }, - { - "name": "Deloutput ipv4", - "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_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": [] - }, - { - "name": "Deloutput ipv6", - "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_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": [] - }, - { - "name": "Deloutput file", - "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_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": [] - }, - { - "name": "Deloutput rrd", - "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_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": [] - }, - { - "name": "Deloutput storage", - "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_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": [] - }, - { - "name": "Deloutput sql", - "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_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": [] - }, - { - "name": "Del broker", - "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\": \"del\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Del host2", - "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\": \"del\",\n \"object\": \"host\",\n \"values\": \"{{host_name2}}\"\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": [] - } - ] - } - ] + "info": { + "_postman_id": "068826d3-0ea0-41e1-8adb-fbe98e22f81e", + "name": "Centreon Web Rest API", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "00-Configure_Poller", + "item": [ + { + "name": "Authenticate", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "postman.setEnvironmentVariable(\"token\",jsonData.authToken);" + ] + } + } + ], + "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": "Add Instance", + "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\": \"instance\",\n \"values\": \"test_instance;01.02.3.04;ZMQ;42;nagios\"\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 name", + "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\": \"instance\",\n \"values\": \"test_instance;name;{{instance_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 localhost", + "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\": \"instance\",\n \"values\": \"{{instance_name}};localhost;{{instance_localhost}}\"\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 ns_ip_address", + "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\": \"instance\",\n \"values\": \"{{instance_name}};ns_ip_address;{{instance_address}}\"\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 ns_activate", + "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\": \"instance\",\n \"values\": \"{{instance_name}};ns_activate;{{instance_activate}}\"\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 nagios_bin", + "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\": \"instance\",\n \"values\": \"{{instance_name}};nagios_bin;{{instance_nagios_bin}}\"\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 nagiostats_bin", + "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\": \"instance\",\n \"values\": \"{{instance_name}};nagiostats_bin;{{instance_nagiostats_bin}}\"\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 nagios_perfdata", + "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\": \"instance\",\n \"values\": \"{{instance_name}};nagios_perfdata;{{instance_nagios_perfdata}}\"\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 gorgone_communication_type", + "event": [ + { + "listen": "test", + "script": { + "id": "41227555-c39b-4de9-86ca-b035ac49fcde", + "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\": \"instance\",\n \"values\": \"{{instance_name}};gorgone_communication_type;SSH\"\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 gorgone_port", + "event": [ + { + "listen": "test", + "script": { + "id": "19d7769e-2968-4812-9b19-ffe20f567ad8", + "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\": \"instance\",\n \"values\": \"{{instance_name}};gorgone_port;{{instance_gorgone_port}}\"\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 centreonbroker_cfg_path", + "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\": \"instance\",\n \"values\": \"{{instance_name}};centreonbroker_cfg_path;{{instance_broker_cfg_path}}\"\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 centreonbroker_module_path", + "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\": \"instance\",\n \"values\": \"{{instance_name}};centreonbroker_module_path;{{instance_broker_module_path}}\"\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 instances", + "event": [ + { + "listen": "test", + "script": { + "id": "d0d2de22-cc56-427d-ba3e-6fb46dcb5832", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var instanceData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of instances\"] = instanceData;", + " var i = 0;", + " while (i < instanceData.length) {", + " if (postman.getEnvironmentVariable(\"instance_name\") == instanceData[i].name) {", + " tests[\"Body contains added instance\"] = postman.getEnvironmentVariable(\"instance_name\") == instanceData[i].name;", + " tests[\"Body contains added instance_localhost\"] = postman.getEnvironmentVariable(\"instance_localhost\") == instanceData[i].localhost;", + " tests[\"Body contains added instance_address\"] = postman.getEnvironmentVariable(\"instance_address\") == instanceData[i]['ip address'];", + " tests[\"Body contains added instance_activate\"] = postman.getEnvironmentVariable(\"instance_activate\") == instanceData[i].activate;", + " tests[\"Body contains added instance_engine_start_command\"] = postman.getEnvironmentVariable(\"instance_engine_start_command\") == instanceData[i]['init script'];", + " tests[\"Body contains added instance_engine_stop_command\"] = postman.getEnvironmentVariable(\"instance_engine_stop_command\") == instanceData[i]['init script'];", + " tests[\"Body contains added instance_engine_restart_command\"] = postman.getEnvironmentVariable(\"instance_engine_restart_command\") == instanceData[i]['init script'];", + " tests[\"Body contains added instance_engine_reload_command\"] = postman.getEnvironmentVariable(\"instance_engine_reload_command\") == instanceData[i]['init script'];", + " tests[\"Body contains added instance_nagios_bin\"] = postman.getEnvironmentVariable(\"instance_nagios_bin\") == instanceData[i].bin;", + " tests[\"Body contains added instance_nagiostats_bin\"] = postman.getEnvironmentVariable(\"instance_nagiostats_bin\") == instanceData[i]['stats bin'];", + " tests[\"Body contains added instance_gorgone_port\"] = postman.getEnvironmentVariable(\"instance_gorgone_port\") == instanceData[i]['gorgone port'];", + " break;", + " }", + " i++;", + " }", + " if (i == instanceData.length)", + " tests[\"instance_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"instance\"\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": "Create host2", + "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_name2}};0.0.0.0;;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": "Create Instance-2", + "event": [ + { + "listen": "test", + "script": { + "id": "100ddbfb-962a-4473-b7cc-2b1343946dfa", + "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\": \"instance\",\n \"values\": \"{{instance_name2}};01.3.04.65;SSH;98;nagios\"\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": "Setinstance 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\": \"setinstance\",\n \"object\": \"host\",\n \"values\": \"{{host_name2}};{{instance_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": "Gethosts", + "event": [ + { + "listen": "test", + "script": { + "id": "e14c0905-a615-4b2a-8d10-d6e67a24d0b6", + "exec": [ + "tests[\"Status code is 200\"] = responseCode.code === 200;", + "", + "var contentType = postman.getResponseHeader(\"Content-Type\");", + "", + "tests[\"Content-Type is present\"] = contentType !== null;", + "tests[\"Content-Type is application/json\"] = contentType === \"application/json;charset=utf-8\";", + "", + "var jsonData = JSON.parse(responseBody);", + "var hostData = jsonData.result;", + "", + "tests[\"Body contains entries\"] = hostData.length > 0;", + "", + "var schema = 0;", + "if (hostData[0].id && hostData[0].name && hostData[0].address) {", + " schema = 1;", + "}", + "tests[\"Validate schema\"] = schema == 1;", + "", + "var pattern = /^_Module_/;", + "var hostMetaPresent = false;", + "var hostPresent = false;", + "", + "hostData.forEach(function(host) {", + " if (pattern.test(host.name) === true) {", + " hostMetaPresent = true;", + " }", + " ", + " if ((host.name == postman.getEnvironmentVariable(\"host_name2\")) && (host.address == \"0.0.0.0\")) {", + " hostPresent = true;", + " }", + "});", + "", + "tests[\"Configured host present\"] = hostPresent === true;", + "tests[\"No _Module host present\"] = hostMetaPresent === false;" + ], + "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\": \"gethosts\",\n \"object\": \"instance\",\n \"values\": \"{{instance_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": [] + } + ], + "protocolProfileBehavior": {} + }, + { + "name": "01-Configure_Centreon_Engine", + "item": [ + { + "name": "Add resource CFG", + "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\": \"resourcecfg\",\n \"values\": \"test_resourcecfg;test_value;{{instance_name}};test_comment\"\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": "Get ressource id", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var resourceData = jsonData.result;", + "", + "try {", + " var i = 0;", + " while (i < resourceData.length) {", + " if (\"$test_resourcecfg$\" == resourceData[i].name) {", + " postman.setEnvironmentVariable(\"resourcecfg_id\",resourceData[i].id);", + " break;", + " }", + " i++;", + " }", + " if (i == resourceData.length)", + " tests[\"the resourcecfg was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"resourcecfg\"\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 name", + "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};name;{{rcfg_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 value", + "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};value;{{rcfg_value}}\"\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 activate", + "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};activate;{{rcfg_activate}}\"\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 comment", + "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};comment;{{rcfg_comment}}\"\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 instance", + "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\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_id}};instance;{{rcfg_instance}}\"\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 resource CFG", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var rcfgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of resources CFG\"] = rcfgData;", + " var i = 0;", + " var rcfgname = \"$\"+ postman.getEnvironmentVariable(\"rcfg_name\") + \"$\";", + " while (i < rcfgData.length) {", + " if (rcfgname == rcfgData[i].name) {", + " tests[\"Body contains added resource CFG\"] = rcfgname == rcfgData[i].name;", + " tests[\"Body contains added rcfg_value\"] = postman.getEnvironmentVariable(\"rcfg_value\") == rcfgData[i].value;", + " tests[\"Body contains added rcfg_comment\"] = postman.getEnvironmentVariable(\"rcfg_comment\") == rcfgData[i].comment;", + " tests[\"Body contains added rcfg_activate\"] = postman.getEnvironmentVariable(\"rcfg_activate\") == rcfgData[i].activate;", + " tests[\"Body contains added rcfg_instance\"] = postman.getEnvironmentVariable(\"rcfg_instance\") == rcfgData[i].instance;", + " break;", + " }", + " i++;", + " }", + " if (i == rcfgData.length)", + " tests[\"rcfg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"resourcecfg\"\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": [] + } + ], + "protocolProfileBehavior": {} + }, + { + "name": "02-Configure_Centreon_Broker", + "item": [ + { + "name": "Add broker", + "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\": \"centbrokercfg\",\n \"values\": \"broker_test;{{instance_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 name", + "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\": \"centbrokercfg\",\n \"values\": \"broker_test;name;{{broker_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": "List brokers", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var brokerData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of brokers\"] = brokerData;", + " var i = 0;", + " while (i < brokerData.length) {", + " if (postman.getEnvironmentVariable(\"broker_name\") == brokerData[i]['config name']) {", + " tests[\"Body contains added broker_name\"] = postman.getEnvironmentVariable(\"broker_name\") == brokerData[i]['config name'];", + " tests[\"Body contains added instance_name\"] = postman.getEnvironmentVariable(\"instance_name\") == brokerData[i].instance;", + " break;", + " }", + " i++;", + " }", + " if (i == brokerData.length)", + " tests[\"broker_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"centbrokercfg\"\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 filename", + "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};filename;{{broker_filename}}\"\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 instance", + "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};instance;{{instance_name2}}\"\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 event_queue_max_size", + "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};event_queue_max_size;{{broker_event_queue_max_size}}\"\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 cache_directory", + "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};cache_directory;{{broker_cache_directory}}\"\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 daemon", + "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};daemon;{{broker_daemon}}\"\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 stats_activate", + "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\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};stats_activate;{{broker_stats_activate}}\"\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": "Addinput ipv4", + "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\": \"addinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_name_ipv4}};ipv4;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": "Get input_key ipv4", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var inputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of inputs\"] = inputData;", + " var i = 0;", + " while (i < inputData.length) {", + " if (postman.getEnvironmentVariable(\"input_name_ipv4\") == inputData[i].name) {", + " postman.setEnvironmentVariable(\"input_ipv4_id\",inputData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == inputData.length){", + " tests[\"input_name_ipv4 was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setinput buffering_timeout", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};buffering_timeout;{{input_buffering_timeout}}\"\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": "Setinput compression", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};compression;{{input_compression}}\"\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": "Setinput compression_buffer", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};compression_buffer;{{input_compression_buffer}}\"\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": "Setinput compression_level", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};compression_level;{{input_compression_level}}\"\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": "Setinput retry_interval", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};retry_interval;{{input_retry_interval}}\"\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": "Setinput 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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};category;{{input_category}}\"\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": "Setinput ca_certificate", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};ca_certificate;{{input_ca_certificate}}\"\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": "Setinput 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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};host;{{input_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": "Setinput one_peer_retention_mode", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};one_peer_retention_mode;{{input_one_peer_retention_mode}}\"\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": "Setinput port", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};port;{{input_port}}\"\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": "Setinput private_key", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};private_key;{{input_private_key}}\"\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": "Setinput protocol", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};protocol;{{input_protocol}}\"\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": "Setinput public_cert", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};public_cert;{{input_public_cert}}\"\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": "Setinput tls", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_id}};tls;{{input_tls}}\"\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": "Getinput ipv4", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var inputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of inputs\"] = inputData;", + " for (var i = 0; i < inputData.length; i++) {", + " switch (inputData[i]['parameter key'])", + " {", + " case \"buffering_timeout\":", + " tests[\"Body contains added input_buffering_timeout\"] = postman.getEnvironmentVariable(\"input_buffering_timeout\") == inputData[i]['parameter value'];", + " break;", + " case \"category\":", + " tests[\"Body contains added input_category\"] = postman.getEnvironmentVariable(\"input_category\") == inputData[i]['parameter value'];", + " break;", + " case \"ca_certificate\":", + " tests[\"Body contains added input_ca_certificate\"] = postman.getEnvironmentVariable(\"input_ca_certificate\") == inputData[i]['parameter value'];", + " break;", + " case \"compression\":", + " tests[\"Body contains added input_compression\"] = postman.getEnvironmentVariable(\"input_compression\") == inputData[i]['parameter value'];", + " break;", + " case \"compression_buffer\":", + " tests[\"Body contains added input_compression_buffer\"] = postman.getEnvironmentVariable(\"input_compression_buffer\") == inputData[i]['parameter value'];", + " break;", + " case \"compression_level\":", + " tests[\"Body contains added input_compression_level\"] = postman.getEnvironmentVariable(\"input_compression_level\") == inputData[i]['parameter value'];", + " break;", + " case \"host\":", + " tests[\"Body contains added input_host\"] = postman.getEnvironmentVariable(\"input_host\") == inputData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added input_name\"] = postman.getEnvironmentVariable(\"input_name_ipv4\") == inputData[i]['parameter value'];", + " break;", + " case \"one_peer_retention_mode\":", + " tests[\"Body contains added input_one_peer_retention_mode\"] = postman.getEnvironmentVariable(\"input_one_peer_retention_mode\") == inputData[i]['parameter value'];", + " break;", + " case \"port\":", + " tests[\"Body contains added port\"] = postman.getEnvironmentVariable(\"input_port\") == inputData[i]['parameter value'];", + " break;", + " case \"private_key\":", + " tests[\"Body contains added input_private_key\"] = postman.getEnvironmentVariable(\"input_private_key\") == inputData[i]['parameter value'];", + " break;", + " case \"protocol\":", + " tests[\"Body contains added input_protocol\"] = postman.getEnvironmentVariable(\"input_protocol\") == inputData[i]['parameter value'];", + " break;", + " case \"public_cert\":", + " tests[\"Body contains added input_public_cert\"] = postman.getEnvironmentVariable(\"input_public_cert\") == inputData[i]['parameter value'];", + " break;", + " case \"retry_interval\":", + " tests[\"Body contains added input_retry_interval\"] = postman.getEnvironmentVariable(\"input_retry_interval\") == inputData[i]['parameter value'];", + " break;", + " case \"tls\":", + " tests[\"Body contains added input_tls\"] = postman.getEnvironmentVariable(\"input_tls\") == intputData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body containts added input_type\"] = \"ipv4\" == inputData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_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": [] + }, + { + "name": "Addinput ipv6", + "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\": \"addinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_name_ipv6}};ipv6;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": "Get input_key ipv6", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var inputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of inputs\"] = inputData;", + " var i = 0;", + " while (i < inputData.length) {", + " if (postman.getEnvironmentVariable(\"input_name_ipv6\") == inputData[i].name) {", + " postman.setEnvironmentVariable(\"input_ipv6_id\",inputData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == inputData.length){", + " tests[\"input_name_ipv6 was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setinput buffering_timeout", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};buffering_timeout;{{input_buffering_timeout}}\"\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": "Setinput compression", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};compression;{{input_compression}}\"\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": "Setinput compression_buffer", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};compression_buffer;{{input_compression_buffer}}\"\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": "Setinput compression_level", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};compression_level;{{input_compression_level}}\"\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": "Setinput retry_interval", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};retry_interval;{{input_retry_interval}}\"\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": "Setinput 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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};category;{{input_category}}\"\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": "Setinput ca_certificate", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};ca_certificate;{{input_ca_certificate}}\"\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": "Setinput 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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};host;{{input_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": "Setinput one_peer_retention_mode", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};one_peer_retention_mode;{{input_one_peer_retention_mode}}\"\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": "Setinput port", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};port;{{input_port}}\"\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": "Setinput private_key", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};private_key;{{input_private_key}}\"\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": "Setinput protocol", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};protocol;{{input_protocol}}\"\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": "Setinput public_cert", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};public_cert;{{input_public_cert}}\"\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": "Setinput tls", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_id}};tls;{{input_tls}}\"\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": "Getinput ipv6", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var inputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of inputs\"] = inputData;", + " for (var i = 0; i < inputData.length; i++) {", + " switch (inputData[i]['parameter key'])", + " {", + " case \"buffering_timeout\":", + " tests[\"Body contains added input_buffering_timeout\"] = postman.getEnvironmentVariable(\"input_buffering_timeout\") == inputData[i]['parameter value'];", + " break;", + " case \"category\":", + " tests[\"Body contains added input_category\"] = postman.getEnvironmentVariable(\"input_category\") == inputData[i]['parameter value'];", + " break;", + " case \"ca_certificate\":", + " tests[\"Body contains added input_ca_certificate\"] = postman.getEnvironmentVariable(\"input_ca_certificate\") == inputData[i]['parameter value'];", + " break;", + " case \"compression\":", + " tests[\"Body contains added input_compression\"] = postman.getEnvironmentVariable(\"input_compression\") == inputData[i]['parameter value'];", + " break;", + " case \"compression_buffer\":", + " tests[\"Body contains added input_compression_buffer\"] = postman.getEnvironmentVariable(\"input_compression_buffer\") == inputData[i]['parameter value'];", + " break;", + " case \"compression_level\":", + " tests[\"Body contains added input_compression_level\"] = postman.getEnvironmentVariable(\"input_compression_level\") == inputData[i]['parameter value'];", + " break;", + " case \"host\":", + " tests[\"Body contains added input_host\"] = postman.getEnvironmentVariable(\"input_host\") == inputData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added input_name\"] = postman.getEnvironmentVariable(\"input_name_ipv6\") == inputData[i]['parameter value'];", + " break;", + " case \"one_peer_retention_mode\":", + " tests[\"Body contains added input_one_peer_retention_mode\"] = postman.getEnvironmentVariable(\"input_one_peer_retention_mode\") == inputData[i]['parameter value'];", + " break;", + " case \"port\":", + " tests[\"Body contains added port\"] = postman.getEnvironmentVariable(\"input_port\") == inputData[i]['parameter value'];", + " break;", + " case \"private_key\":", + " tests[\"Body contains added input_private_key\"] = postman.getEnvironmentVariable(\"input_private_key\") == inputData[i]['parameter value'];", + " break;", + " case \"protocol\":", + " tests[\"Body contains added input_protocol\"] = postman.getEnvironmentVariable(\"input_protocol\") == inputData[i]['parameter value'];", + " break;", + " case \"public_cert\":", + " tests[\"Body contains added input_public_cert\"] = postman.getEnvironmentVariable(\"input_public_cert\") == inputData[i]['parameter value'];", + " break;", + " case \"retry_interval\":", + " tests[\"Body contains added input_retry_interval\"] = postman.getEnvironmentVariable(\"input_retry_interval\") == inputData[i]['parameter value'];", + " break;", + " case \"tls\":", + " tests[\"Body contains added input_tls\"] = postman.getEnvironmentVariable(\"input_tls\") == intputData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body containts added input_type\"] = \"ipv6\" == inputData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_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": [] + }, + { + "name": "Addinput file", + "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\": \"addinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_name_file}};file;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": "Get input_key file", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var inputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of inputs\"] = inputData;", + " var i = 0;", + " while (i < inputData.length) {", + " if (postman.getEnvironmentVariable(\"input_name_file\") == inputData[i].name) {", + " postman.setEnvironmentVariable(\"input_file_id\",inputData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == inputData.length){", + " tests[\"input_name_file was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setinput buffering_timeout", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};buffering_timeout;{{input_buffering_timeout}}\"\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": "Setinput compression", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};compression;{{input_compression}}\"\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": "Setinput compression_buffer", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};compression_buffer;{{input_compression_buffer}}\"\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": "Setinput compression_level", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};compression_level;{{input_compression_level}}\"\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": "Setinput retry_interval", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};retry_interval;{{input_retry_interval}}\"\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": "Setinput protocol", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};protocol;{{input_protocol}}\"\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": "Setinput max_size", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};max_size;{{input_max_size}}\"\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": "Setinput path", + "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\": \"setinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_id}};path;{{input_path}}\"\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": "Getinput file", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var inputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of inputs\"] = inputData;", + " for (var i = 0; i < inputData.length; i++) {", + " switch (inputData[i]['parameter key'])", + " {", + " case \"buffering_timeout\":", + " tests[\"Body contains added input_buffering_timeout\"] = postman.getEnvironmentVariable(\"input_buffering_timeout\") == inputData[i]['parameter value'];", + " break;", + " case \"compression\":", + " tests[\"Body contains added input_compression\"] = postman.getEnvironmentVariable(\"input_compression\") == inputData[i]['parameter value'];", + " break;", + " case \"compression_buffer\":", + " tests[\"Body contains added input_compression_buffer\"] = postman.getEnvironmentVariable(\"input_compression_buffer\") == inputData[i]['parameter value'];", + " break;", + " case \"compression_level\":", + " tests[\"Body contains added input_compression_level\"] = postman.getEnvironmentVariable(\"input_compression_level\") == inputData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added input_name\"] = postman.getEnvironmentVariable(\"input_name_file\") == inputData[i]['parameter value'];", + " break;", + " case \"protocol\":", + " tests[\"Body contains added input_protocol\"] = postman.getEnvironmentVariable(\"input_protocol\") == inputData[i]['parameter value'];", + " break;", + " case \"retry_interval\":", + " tests[\"Body contains added input_retry_interval\"] = postman.getEnvironmentVariable(\"input_retry_interval\") == inputData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added input_type\"] = \"file\" == inputData[i]['parameter value'];", + " break;", + " case \"max_size\":", + " tests[\"Body contains added input_max_size\"] = postman.getEnvironmentVariable(\"input_max_size\") == inputData[i]['parameter value'];", + " break;", + " case \"path\":", + " tests[\"Body contains added input_path\"] = postman.getEnvironmentVariable(\"input_path\") == inputData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_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": [] + }, + { + "name": "Addlogger file", + "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\": \"addlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};logger_file_test;file;2\"\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": "Get logger_key file", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var loggerData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of loggers\"] = loggerData;", + " var i = 0;", + " while (i < loggerData.length) {", + " if (\"logger_file_test\" == loggerData[i].name) {", + " postman.setEnvironmentVariable(\"logger_file_id\",loggerData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == loggerData.length){", + " tests[\"logger_file_test was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setlogger config", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};config;{{logger_config}}\"\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": "Setlogger debug", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};debug;{{logger_debug}}\"\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": "Setlogger error", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};error;{{logger_error}}\"\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": "Setlogger info", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};info;{{logger_info}}\"\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": "Setlogger level", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};level;{{logger_level}}\"\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": "Setlogger max_size", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};max_size;{{logger_max_size}}\"\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": "Setlogger name", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_id}};name;{{logger_name_file}}\"\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": "Getlogger file", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var loggerData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of loggers\"] = loggerData;", + " for (var i = 0; i < loggerData.length; i++) {", + " switch (loggerData[i]['parameter key'])", + " {", + " case \"config\":", + " tests[\"Body contains added logger_config\"] = postman.getEnvironmentVariable(\"logger_config\") == loggerData[i]['parameter value'];", + " break;", + " case \"debug\":", + " tests[\"Body contains added logger_debug\"] = postman.getEnvironmentVariable(\"logger_debug\") == loggerData[i]['parameter value'];", + " break;", + " case \"error\":", + " tests[\"Body contains added logger_error\"] = postman.getEnvironmentVariable(\"logger_error\") == loggerData[i]['parameter value'];", + " break;", + " case \"info\":", + " tests[\"Body contains added logger_info\"] = postman.getEnvironmentVariable(\"logger_info\") == loggerData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added logger_name\"] = postman.getEnvironmentVariable(\"logger_name_file\") == loggerData[i]['parameter value'];", + " break;", + " case \"level\":", + " tests[\"Body contains added logger_level\"] = postman.getEnvironmentVariable(\"logger_level\") == loggerData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added logger_type\"] = \"file\" == loggerData[i]['parameter value'];", + " break;", + " case \"max_size\":", + " tests[\"Body contains added logger_max_size\"] = postman.getEnvironmentVariable(\"logger_max_size\") == loggerData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_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": [] + }, + { + "name": "Addlogger standard", + "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\": \"addlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};logger_standard_test;standard;2\"\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": "Get logger_key standard", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var loggerData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of loggers\"] = loggerData;", + " var i = 0;", + " while (i < loggerData.length) {", + " if (\"logger_standard_test\" == loggerData[i].name) {", + " postman.setEnvironmentVariable(\"logger_standard_id\",loggerData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == loggerData.length){", + " tests[\"logger_standard_test was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setlogger config", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};config;{{logger_config}}\"\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": "Setlogger debug", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};debug;{{logger_debug}}\"\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": "Setlogger error", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};error;{{logger_error}}\"\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": "Setlogger info", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};info;{{logger_info}}\"\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": "Setlogger level", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};level;{{logger_level}}\"\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": "Setlogger name", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_id}};name;{{logger_name_standard}}\"\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": "Getlogger standard", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var loggerData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of loggers\"] = loggerData;", + " for (var i = 0; i < loggerData.length; i++) {", + " switch (loggerData[i]['parameter key'])", + " {", + " case \"config\":", + " tests[\"Body contains added logger_config\"] = postman.getEnvironmentVariable(\"logger_config\") == loggerData[i]['parameter value'];", + " break;", + " case \"debug\":", + " tests[\"Body contains added logger_debug\"] = postman.getEnvironmentVariable(\"logger_debug\") == loggerData[i]['parameter value'];", + " break;", + " case \"error\":", + " tests[\"Body contains added logger_error\"] = postman.getEnvironmentVariable(\"logger_error\") == loggerData[i]['parameter value'];", + " break;", + " case \"info\":", + " tests[\"Body contains added logger_info\"] = postman.getEnvironmentVariable(\"logger_info\") == loggerData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added logger_name\"] = postman.getEnvironmentVariable(\"logger_name_standard\") == loggerData[i]['parameter value'];", + " break;", + " case \"level\":", + " tests[\"Body contains added logger_level\"] = postman.getEnvironmentVariable(\"logger_level\") == loggerData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added logger_type\"] = \"standard\" == loggerData[i]['parameter value'];", + " break;", + " case \"max_size\":", + " tests[\"Body contains added logger_max_size\"] = postman.getEnvironmentVariable(\"logger_max_size\") == loggerData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_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": [] + }, + { + "name": "Addlogger syslog", + "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\": \"addlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_name_syslog}};syslog;2\"\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": "Get logger_key syslog", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var loggerData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of loggers\"] = loggerData;", + " var i = 0;", + " while (i < loggerData.length) {", + " if (postman.getEnvironmentVariable(\"logger_name_syslog\") == loggerData[i].name) {", + " postman.setEnvironmentVariable(\"logger_syslog_id\",loggerData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == loggerData.length){", + " tests[\"logger_name_syslog was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setlogger config", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};config;{{logger_config}}\"\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": "Setlogger debug", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};debug;{{logger_debug}}\"\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": "Setlogger error", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};error;{{logger_error}}\"\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": "Setlogger info", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};info;{{logger_info}}\"\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": "Setlogger level", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_id}};level;{{logger_level}}\"\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": "Getlogger syslog", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var loggerData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of loggers\"] = loggerData;", + " for (var i = 0; i < loggerData.length; i++) {", + " switch (loggerData[i]['parameter key'])", + " {", + " case \"config\":", + " tests[\"Body contains added logger_config\"] = postman.getEnvironmentVariable(\"logger_config\") == loggerData[i]['parameter value'];", + " break;", + " case \"debug\":", + " tests[\"Body contains added logger_debug\"] = postman.getEnvironmentVariable(\"logger_debug\") == loggerData[i]['parameter value'];", + " break;", + " case \"error\":", + " tests[\"Body contains added logger_error\"] = postman.getEnvironmentVariable(\"logger_error\") == loggerData[i]['parameter value'];", + " break;", + " case \"info\":", + " tests[\"Body contains added logger_info\"] = postman.getEnvironmentVariable(\"logger_info\") == loggerData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added logger_name\"] = postman.getEnvironmentVariable(\"logger_name_syslog\") == loggerData[i]['parameter value'];", + " break;", + " case \"level\":", + " tests[\"Body contains added logger_level\"] = postman.getEnvironmentVariable(\"logger_level\") == loggerData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added logger_type\"] = \"syslog\" == loggerData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_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": [] + }, + { + "name": "Addlogger monitoring", + "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\": \"addlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};logger_monitoring_test;monitoring;2\"\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": "Get logger_key monitoring", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var loggerData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of loggers\"] = loggerData;", + " var i = 0;", + " while (i < loggerData.length) {", + " if (\"logger_monitoring_test\" == loggerData[i].name) {", + " postman.setEnvironmentVariable(\"logger_monitoring_id\",loggerData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == loggerData.length){", + " tests[\"logger_monitoring_test was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setlogger config", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};config;{{logger_config}}\"\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": "Setlogger debug", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};debug;{{logger_debug}}\"\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": "Setlogger error", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};error;{{logger_error}}\"\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": "Setlogger info", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};info;{{logger_info}}\"\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": "Setlogger level", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};level;{{logger_level}}\"\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": "Setlogger name", + "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\": \"setlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_id}};name;{{logger_name_monitoring}}\"\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": "Getlogger monitoring", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var loggerData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of loggers\"] = loggerData;", + " for (var i = 0; i < loggerData.length; i++) {", + " switch (loggerData[i]['parameter key'])", + " {", + " case \"config\":", + " tests[\"Body contains added logger_config\"] = postman.getEnvironmentVariable(\"logger_config\") == loggerData[i]['parameter value'];", + " break;", + " case \"debug\":", + " tests[\"Body contains added logger_debug\"] = postman.getEnvironmentVariable(\"logger_debug\") == loggerData[i]['parameter value'];", + " break;", + " case \"error\":", + " tests[\"Body contains added logger_error\"] = postman.getEnvironmentVariable(\"logger_error\") == loggerData[i]['parameter value'];", + " break;", + " case \"info\":", + " tests[\"Body contains added logger_info\"] = postman.getEnvironmentVariable(\"logger_info\") == loggerData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added logger_name\"] = postman.getEnvironmentVariable(\"logger_name_monitoring\") == loggerData[i]['parameter value'];", + " break;", + " case \"level\":", + " tests[\"Body contains added logger_level\"] = postman.getEnvironmentVariable(\"logger_level\") == loggerData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added logger_type\"] = \"monitoring\" == loggerData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getlogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_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": [] + }, + { + "name": "Addoutput ipv4", + "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_ipv4}};ipv4;4\"\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": "Get output_key ipv4", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " var i = 0;", + " while (i < outputData.length) {", + " if (postman.getEnvironmentVariable(\"output_name_ipv4\") == outputData[i].name) {", + " postman.setEnvironmentVariable(\"output_ipv4_id\",outputData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == outputData.length){", + " tests[\"output_name_ipv4 was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput compression", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};compression;{{output_compression}}\"\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": "Setoutput compression_buffer", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};compression_buffer;{{output_compression_buffer}}\"\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": "Setoutput compression_level", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};compression_level;{{output_compression_level}}\"\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": "Setoutput failover", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};category;{{output_category}}\"\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": "Setoutput ca_certificate", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};ca_certificate;{{output_ca_certificate}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};host;{{output_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": "Setoutput one_peer_retention_mode", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};one_peer_retention_mode;{{output_one_peer_retention_mode}}\"\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": "Setoutput port", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};port;{{output_port}}\"\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": "Setoutput private_key", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};private_key;{{output_private_key}}\"\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": "Setoutput protocol", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};protocol;{{output_protocol}}\"\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": "Setoutput public_cert", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};public_cert;{{output_public_cert}}\"\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": "Setoutput tls", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_id}};tls;{{output_tls}}\"\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": "Getoutput ipv4", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " for (var i = 0; i < outputData.length; i++) {", + " switch (outputData[i]['parameter key'])", + " {", + " case \"buffering_timeout\":", + " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", + " break;", + " case \"category\":", + " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", + " break;", + " case \"ca_certificate\":", + " tests[\"Body contains added output_ca_certificate\"] = postman.getEnvironmentVariable(\"output_ca_certificate\") == outputData[i]['parameter value'];", + " break;", + " case \"compression\":", + " tests[\"Body contains added output_compression\"] = postman.getEnvironmentVariable(\"output_compression\") == outputData[i]['parameter value'];", + " break;", + " case \"compression_buffer\":", + " tests[\"Body contains added output_compression_buffer\"] = postman.getEnvironmentVariable(\"output_compression_buffer\") == outputData[i]['parameter value'];", + " break;", + " case \"compression_level\":", + " tests[\"Body contains added output_compression_level\"] = postman.getEnvironmentVariable(\"output_compression_level\") == outputData[i]['parameter value'];", + " break;", + " case \"failover\":", + " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", + " break;", + " case \"host\":", + " tests[\"Body contains added output_host\"] = postman.getEnvironmentVariable(\"output_host\") == outputData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_ipv4\") == outputData[i]['parameter value'];", + " break;", + " case \"one_peer_retention_mode\":", + " tests[\"Body contains added output_one_peer_retention\"] = postman.getEnvironmentVariable(\"output_one_peer_retention_mode\") == outputData[i]['parameter value'];", + " break;", + " case \"port\":", + " tests[\"Body contains added output_port\"] = postman.getEnvironmentVariable(\"output_port\") == outputData[i]['parameter value'];", + " break;", + " case \"private_key\":", + " tests[\"Body contains added output_private_key\"] = postman.getEnvironmentVariable(\"output_private_key\") == outputData[i]['parameter value'];", + " break;", + " case \"protocol\":", + " tests[\"Body contains added output_protocol\"] = postman.getEnvironmentVariable(\"output_protocol\") == outputData[i]['parameter value'];", + " break;", + " case \"public_cert\":", + " tests[\"Body contains added output_public_cert\"] = postman.getEnvironmentVariable(\"output_public_cert\") == outputData[i]['parameter value'];", + " break;", + " case \"retry_interval\":", + " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", + " break;", + " case \"tls\":", + " tests[\"Body contains added output_tls\"] = postman.getEnvironmentVariable(\"output_tls\") == outputData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added output_type\"] = \"ipv4\" == outputData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_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": [] + }, + { + "name": "Addoutput ipv6", + "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_ipv6}};ipv6;4\"\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": "Get output_key ipv6", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " var i = 0;", + " while (i < outputData.length) {", + " if (postman.getEnvironmentVariable(\"output_name_ipv6\") == outputData[i].name) {", + " postman.setEnvironmentVariable(\"output_ipv6_id\",outputData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == outputData.length){", + " tests[\"output_name_ipv6 was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput compression", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};compression;{{output_compression}}\"\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": "Setoutput compression_buffer", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};compression_buffer;{{output_compression_buffer}}\"\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": "Setoutput compression_level", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};compression_level;{{output_compression_level}}\"\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": "Setoutput failover", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};category;{{output_category}}\"\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": "Setoutput ca_certificate", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};ca_certificate;{{output_ca_certificate}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};host;{{output_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": "Setoutput one_peer_retention_mode", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};one_peer_retention_mode;{{output_one_peer_retention_mode}}\"\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": "Setoutput port", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};port;{{output_port}}\"\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": "Setoutput private_key", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};private_key;{{output_private_key}}\"\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": "Setoutput protocol", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};protocol;{{output_protocol}}\"\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": "Setoutput public_cert", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};public_cert;{{output_public_cert}}\"\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": "Setoutput tls", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_id}};tls;{{output_tls}}\"\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": "Getoutput ipv6", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " for (var i = 0; i < outputData.length; i++) {", + " switch (outputData[i]['parameter key'])", + " {", + " case \"buffering_timeout\":", + " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", + " break;", + " case \"category\":", + " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", + " break;", + " case \"ca_certificate\":", + " tests[\"Body contains added output_ca_certificate\"] = postman.getEnvironmentVariable(\"output_ca_certificate\") == outputData[i]['parameter value'];", + " break;", + " case \"compression\":", + " tests[\"Body contains added output_compression\"] = postman.getEnvironmentVariable(\"output_compression\") == outputData[i]['parameter value'];", + " break;", + " case \"compression_buffer\":", + " tests[\"Body contains added output_compression_buffer\"] = postman.getEnvironmentVariable(\"output_compression_buffer\") == outputData[i]['parameter value'];", + " break;", + " case \"compression_level\":", + " tests[\"Body contains added output_compression_level\"] = postman.getEnvironmentVariable(\"output_compression_level\") == outputData[i]['parameter value'];", + " break;", + " case \"failover\":", + " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", + " break;", + " case \"host\":", + " tests[\"Body contains added output_host\"] = postman.getEnvironmentVariable(\"output_host\") == outputData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_ipv6\") == outputData[i]['parameter value'];", + " break;", + " case \"one_peer_retention_mode\":", + " tests[\"Body contains added output_one_peer_retention\"] = postman.getEnvironmentVariable(\"output_one_peer_retention_mode\") == outputData[i]['parameter value'];", + " break;", + " case \"port\":", + " tests[\"Body contains added output_port\"] = postman.getEnvironmentVariable(\"output_port\") == outputData[i]['parameter value'];", + " break;", + " case \"private_key\":", + " tests[\"Body contains added output_private_key\"] = postman.getEnvironmentVariable(\"output_private_key\") == outputData[i]['parameter value'];", + " break;", + " case \"protocol\":", + " tests[\"Body contains added output_protocol\"] = postman.getEnvironmentVariable(\"output_protocol\") == outputData[i]['parameter value'];", + " break;", + " case \"public_cert\":", + " tests[\"Body contains added output_public_cert\"] = postman.getEnvironmentVariable(\"output_public_cert\") == outputData[i]['parameter value'];", + " break;", + " case \"retry_interval\":", + " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", + " break;", + " case \"tls\":", + " tests[\"Body contains added output_tls\"] = postman.getEnvironmentVariable(\"output_tls\") == outputData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added output_type\"] = \"ipv6\" == outputData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_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": [] + }, + { + "name": "Addoutput file", + "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_file}};file;4\"\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": "Get output_key file", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " var i = 0;", + " while (i < outputData.length) {", + " if (postman.getEnvironmentVariable(\"output_name_file\") == outputData[i].name) {", + " postman.setEnvironmentVariable(\"output_file_id\",outputData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == outputData.length){", + " tests[\"output_name_file was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};category;{{output_category}}\"\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": "Setoutput compression", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};compression;{{output_compression}}\"\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": "Setoutput compression_buffer", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};compression_buffer;{{output_compression_buffer}}\"\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": "Setoutput compression_level", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};compression_level;{{output_compression_level}}\"\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": "Setoutput failover", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput protocol", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};protocol;{{output_protocol}}\"\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": "Setoutput max_size", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};max_size;{{output_max_size}}\"\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": "Setoutput path", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_id}};path;{{output_path}}\"\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": "Getoutput file", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " for (var i = 0; i < outputData.length; i++) {", + " switch (outputData[i]['parameter key'])", + " {", + " case \"buffering_timeout\":", + " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", + " break;", + " case \"category\":", + " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", + " break;", + " case \"compression\":", + " tests[\"Body contains added output_compression\"] = postman.getEnvironmentVariable(\"output_compression\") == outputData[i]['parameter value'];", + " break;", + " case \"compression_buffer\":", + " tests[\"Body contains added output_compression_buffer\"] = postman.getEnvironmentVariable(\"output_compression_buffer\") == outputData[i]['parameter value'];", + " break;", + " case \"compression_level\":", + " tests[\"Body contains added output_compression_level\"] = postman.getEnvironmentVariable(\"output_compression_level\") == outputData[i]['parameter value'];", + " break;", + " case \"max_size\":", + " tests[\"Body contains added output_max_size\"] = postman.getEnvironmentVariable(\"output_max_size\") == outputData[i]['parameter value'];", + " break;", + " case \"failover\":", + " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_file\") == outputData[i]['parameter value'];", + " break;", + " case \"path\":", + " tests[\"Body contains added output_path\"] = postman.getEnvironmentVariable(\"output_path\") == outputData[i]['parameter value'];", + " break;", + " case \"protocol\":", + " tests[\"Body contains added output_protocol\"] = postman.getEnvironmentVariable(\"output_protocol\") == outputData[i]['parameter value'];", + " break;", + " case \"retry_interval\":", + " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added output_type\"] = \"file\" == outputData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_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": [] + }, + { + "name": "Addoutput rrd", + "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_rrd}};rrd;4\"\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": "Get output_key rrd", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " var i = 0;", + " while (i < outputData.length) {", + " if (postman.getEnvironmentVariable(\"output_name_rrd\") == outputData[i].name) {", + " postman.setEnvironmentVariable(\"output_rrd_id\",outputData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == outputData.length){", + " tests[\"output_name_rrd was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};category;{{output_category}}\"\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": "Setoutput failover", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput metrics_path", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};metrics_path;{{output_metrics_path}}\"\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": "Setoutput status_path", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};status_path;{{output_status_path}}\"\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": "Setoutput write_metrics", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};write_metrics;{{output_write_metrics}}\"\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": "Setoutput write_status", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_id}};write_status;{{output_write_status}}\"\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": "Getoutput rrd", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " for (var i = 0; i < outputData.length; i++) {", + " switch (outputData[i]['parameter key'])", + " {", + " case \"buffering_timeout\":", + " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", + " break;", + " case \"category\":", + " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", + " break;", + " case \"failover\":", + " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", + " break;", + " case \"metrics_path\":", + " tests[\"Body contains added output_metrics_path\"] = postman.getEnvironmentVariable(\"output_metrics_path\") == outputData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_rrd\") == outputData[i]['parameter value'];", + " break;", + " case \"path\":", + " tests[\"Body contains added output_path\"] = postman.getEnvironmentVariable(\"output_path\") == outputData[i]['parameter value'];", + " break;", + " case \"port\":", + " tests[\"Body contains added output_port\"] = postman.getEnvironmentVariable(\"output_port\") == outputData[i]['parameter value'];", + " break;", + " case \"retry_interval\":", + " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", + " break;", + " case \"status_path\":", + " tests[\"Body contains added output_status_path\"] = postman.getEnvironmentVariable(\"output_status_path\") == outputData[i]['parameter value'];", + " break;", + " case \"store_in_data\":", + " tests[\"Body contains added output_store_in_data\"] = postman.getEnvironmentVariable(\"output_store_in_data_bin\") == outputData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added output_type\"] = \"rrd\" == outputData[i]['parameter value'];", + " break;", + " case \"write_metrics\":", + " tests[\"Body contains added output_write_metrics\"] = postman.getEnvironmentVariable(\"output_write_status\") == outputData[i]['parameter value'];", + " break;", + " case \"write_status\":", + " tests[\"Body contains added output_write_status\"] = postman.getEnvironmentVariable(\"output_write_status\") == outputData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_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": [] + }, + { + "name": "Addoutput storage", + "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_storage}};storage;4\"\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": "Get output_key storage", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " var i = 0;", + " while (i < outputData.length) {", + " if (postman.getEnvironmentVariable(\"output_name_storage\") == outputData[i].name) {", + " postman.setEnvironmentVariable(\"output_storage_id\",outputData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == outputData.length){", + " tests[\"output_name_storage was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};category;{{output_category}}\"\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": "Setoutput failover", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput check_replication", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};check_replication;{{output_check_replication}}\"\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": "Setoutput store_in_data_bin", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};store_in_data_bin;{{output_store_in_data_bin}}\"\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": "Setoutput db_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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_host;{{output_db_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": "Setoutput db_name", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_name;{{output_db_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": "Setoutput db_password", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_password;{{output_db_password}}\"\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": "Setoutput db_port", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_port;{{output_db_port}}\"\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": "Setoutput db_type", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_type;{{output_db_type}}\"\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": "Setoutput db_user", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};db_user;{{output_db_user}}\"\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": "Setoutput interval", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};interval;{{output_interval}}\"\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": "Setoutput length", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};length;{{output_length}}\"\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": "Setoutput queries_per_transaction", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};queries_per_transaction;{{output_queries_per_transaction}}\"\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": "Setoutput read_timeout", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};read_timeout;{{output_read_timeout}}\"\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": "Setoutput rebuild_check_interval", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_id}};rebuild_check_interval;{{output_rebuild_check_interval}}\"\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": "Getoutput storage", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " for (var i = 0; i < outputData.length; i++) {", + " switch (outputData[i]['parameter key'])", + " {", + " case \"buffering_timeout\":", + " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", + " break;", + " case \"category\":", + " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", + " break;", + " case \"check_replication\":", + " tests[\"Body contains added output_check_replication\"] = postman.getEnvironmentVariable(\"output_check_replication\") == outputData[i]['parameter value'];", + " break;", + " case \"db_host\":", + " tests[\"Body contains added output_db_host\"] = postman.getEnvironmentVariable(\"output_db_host\") == outputData[i]['parameter value'];", + " break;", + " case \"db_name\":", + " tests[\"Body contains added output_db_name\"] = postman.getEnvironmentVariable(\"output_db_name\") == outputData[i]['parameter value'];", + " break;", + " case \"db_password\":", + " tests[\"Body contains added output_db_password\"] = postman.getEnvironmentVariable(\"output_db_password\") == outputData[i]['parameter value'];", + " break;", + " case \"db_port\":", + " tests[\"Body contains added output_db_port\"] = postman.getEnvironmentVariable(\"output_db_port\") == outputData[i]['parameter value'];", + " break;", + " case \"db_type\":", + " tests[\"Body contains added output_db_type\"] = postman.getEnvironmentVariable(\"output_db_type\") == outputData[i]['parameter value'];", + " break;", + " case \"db_user\":", + " tests[\"Body contains added output_db_user\"] = postman.getEnvironmentVariable(\"output_db_user\") == outputData[i]['parameter value'];", + " break;", + " case \"failover\":", + " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", + " break;", + " case \"interval\":", + " tests[\"Body contains added output_interval\"] = postman.getEnvironmentVariable(\"output_interval\") == outputData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_storage\") == outputData[i]['parameter value'];", + " break;", + " case \"queries_per_transaction\":", + " tests[\"Body contains added output_queries_per_transaction\"] =postman.getEnvironmentVariable(\"output_queries_per_transaction\") == outputData[i]['parameter value'];", + " break;", + " case \"read_timeout\":", + " tests[\"Body contains added output_read_timeout\"] = postman.getEnvironmentVariable(\"output_read_timeout\") == outputData[i]['parameter value'];", + " break;", + " case \"rebuild_check_interval\":", + " tests[\"Body contains added output_rebuild_check_interval\"] = postman.getEnvironmentVariable(\"output_rebuild_check_interval\") == outputData[i]['parameter value'];", + " break;", + " case \"retry_interval\":", + " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", + " break;", + " case \"store_in_data_bin\":", + " tests[\"Body contains added output_store_in_data_bin\"] = postman.getEnvironmentVariable(\"output_store_in_data_bin\") == outputData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added output_type\"] = \"storage\" == outputData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_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": [] + }, + { + "name": "Addoutput sql", + "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\": \"addoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_name_sql}};sql;4\"\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": "Get output_key sql", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " var i = 0;", + " while (i < outputData.length) {", + " if (postman.getEnvironmentVariable(\"output_name_sql\") == outputData[i].name) {", + " postman.setEnvironmentVariable(\"output_sql_id\",outputData[i].id)", + " break;", + " }", + " i++;", + " }", + " if (i == outputData.length){", + " tests[\"output_name_sql was found\"] = false;", + " }", + "} catch (e) {}", + "", + "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\": \"listoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Setoutput buffering_timeout", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};buffering_timeout;{{output_buffering_timeout}}\"\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": "Setoutput 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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};category;{{output_category}}\"\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": "Setoutput failover", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};failover;{{output_failover}}\"\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": "Setoutput retry_interval", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};retry_interval;{{output_retry_interval}}\"\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": "Setoutput check_replication", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};check_replication;{{output_check_replication}}\"\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": "Setoutput cleanup_check_interval", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};cleanup_check_interval;{{output_cleanup_check_interval}}\"\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": "Setoutput db_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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_host;{{output_db_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": "Setoutput db_name", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_name;{{output_db_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": "Setoutput db_password", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_password;{{output_db_password}}\"\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": "Setoutput db_port", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_port;{{output_db_port}}\"\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": "Setoutput db_type", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_type;{{output_db_type}}\"\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": "Setoutput db_user", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};db_user;{{output_db_user}}\"\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": "Setoutput instance_timeout", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};instance_timeout;{{output_instance_timeout}}\"\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": "Setoutput queries_per_transaction", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};queries_per_transaction;{{output_queries_per_transaction}}\"\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": "Setoutput read_timeout", + "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\": \"setoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_id}};read_timeout;{{output_read_timeout}}\"\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": "Getoutput sql", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var outputData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of outputs\"] = outputData;", + " for (var i = 0; i < outputData.length; i++) {", + " switch (outputData[i]['parameter key'])", + " {", + " case \"buffering_timeout\":", + " tests[\"Body contains added output_buffering_timeout\"] = postman.getEnvironmentVariable(\"output_buffering_timeout\") == outputData[i]['parameter value'];", + " break;", + " case \"category\":", + " tests[\"Body contains added output_category\"] = postman.getEnvironmentVariable(\"output_category\") == outputData[i]['parameter value'];", + " break;", + " case \"check_replication\":", + " tests[\"Body contains added output_check_replication\"] = postman.getEnvironmentVariable(\"output_check_replication\") == outputData[i]['parameter value'];", + " break;", + " case \"cleanup_check_interval\":", + " tests[\"Body contains added output_cleanup_check_interval\"] = postman.getEnvironmentVariable(\"output_cleanup_check_interval\") == outputData[i]['parameter value'];", + " break;", + " case \"db_host\":", + " tests[\"Body contains added output_db_host\"] = postman.getEnvironmentVariable(\"output_db_host\") == outputData[i]['parameter value'];", + " break;", + " case \"db_name\":", + " tests[\"Body contains added output_db_name\"] = postman.getEnvironmentVariable(\"output_db_name\") == outputData[i]['parameter value'];", + " break;", + " case \"db_password\":", + " tests[\"Body contains added output_db_password\"] = postman.getEnvironmentVariable(\"output_db_password\") == outputData[i]['parameter value'];", + " break;", + " case \"db_port\":", + " tests[\"Body contains added output_db_port\"] = postman.getEnvironmentVariable(\"output_db_port\") == outputData[i]['parameter value'];", + " break;", + " case \"db_type\":", + " tests[\"Body contains added output_db_type\"] = postman.getEnvironmentVariable(\"output_db_type\") == outputData[i]['parameter value'];", + " break;", + " case \"db_user\":", + " tests[\"Body contains added output_db_user\"] = postman.getEnvironmentVariable(\"output_db_user\") == outputData[i]['parameter value'];", + " break;", + " case \"failover\":", + " tests[\"Body contains added output_failover\"] = postman.getEnvironmentVariable(\"output_failover\") == outputData[i]['parameter value'];", + " break;", + " case \"instance_timeout\":", + " tests[\"Body contains added output_instance_timeout\"] = postman.getEnvironmentVariable(\"output_instance_timeout\") == outputData[i]['parameter value'];", + " break;", + " case \"name\":", + " tests[\"Body contains added output_name\"] = postman.getEnvironmentVariable(\"output_name_sql\") == outputData[i]['parameter value'];", + " break;", + " case \"queries_per_transaction\":", + " tests[\"Body contains added output_queries_per_transaction\"] =postman.getEnvironmentVariable(\"output_queries_per_transaction\") == outputData[i]['parameter value'];", + " break;", + " case \"read_timeout\":", + " tests[\"Body contains added output_read_timeout\"] = postman.getEnvironmentVariable(\"output_read_timeout\") == outputData[i]['parameter value'];", + " break;", + " case \"retry_interval\":", + " tests[\"Body contains added output_retry_interval\"] = postman.getEnvironmentVariable(\"output_retry_interval\") == outputData[i]['parameter value'];", + " break;", + " case \"type\":", + " tests[\"Body contains added output_type\"] = \"sql\" == outputData[i]['parameter value'];", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\": \"getoutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_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": [] + }, + { + "name": "Gettypelist", + "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\": \"gettypelist\",\n \"object\": \"centbrokercfg\",\n \"values\": \"output\"\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": "Getfieldlist", + "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\": \"getfieldlist\",\n \"object\": \"centbrokercfg\",\n \"values\": \"ipv4\"\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": [] + } + ], + "protocolProfileBehavior": {} + }, + { + "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\": \"test_name;test_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 name", + "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\": \"test_name;name;{{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 alias", + "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}};alias;{{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": [] + }, + { + "name": "Setparam include", + "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}};include;{{tp_include}}\"\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 exclude", + "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}};exclude;{{tp_exclude}}\"\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 timeperiod", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var tpData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of time periods\"] = tpData;", + " var i = 0;", + " while (i < tpData.length) {", + " if (postman.getEnvironmentVariable(\"tp_name\") == tpData[i].name) {", + " tests[\"Body contains added name\"] = postman.getEnvironmentVariable(\"tp_name\") == tpData[i].name;", + " tests[\"Body contains added alias\"] = postman.getEnvironmentVariable(\"tp_alias\") == tpData[i].alias;", + " tests[\"Body contains added sunday\"] = postman.getEnvironmentVariable(\"tp_sunday\") == tpData[i].sunday;", + " tests[\"Body contains added monday\"] = postman.getEnvironmentVariable(\"tp_monday\") == tpData[i].monday;", + " tests[\"Body contains added tuesday\"] = postman.getEnvironmentVariable(\"tp_tuesday\") == tpData[i].tuesday;", + " tests[\"Body contains added wednesday\"] = postman.getEnvironmentVariable(\"tp_wednesday\") == tpData[i].wednesday;", + " tests[\"Body contains added thursday\"] = postman.getEnvironmentVariable(\"tp_thursday\") == tpData[i].thursday;", + " tests[\"Body contains added friday\"] = postman.getEnvironmentVariable(\"tp_friday\") == tpData[i].friday;", + " tests[\"Body contains added saturday\"] = postman.getEnvironmentVariable(\"tp_saturday\") == tpData[i].saturday;", + " break;", + " }", + " i++;", + " }", + " if (i == tpData.length)", + " tests[\"tp_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"tp\"\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 exception", + "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\": \"setexception\",\n \"object\": \"tp\",\n \"values\": \"{{tp_name}};{{exception_day}};{{exception_timerange}}\"\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": "Get exceptions", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var exceptionData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of exceptions\"] = exceptionData;", + " var i = 0;", + " while (i < exceptionData.length) {", + " if (postman.getEnvironmentVariable(\"exception_day\") == exceptionData[i].days) {", + " tests[\"Body contains added exception day\"] = postman.getEnvironmentVariable(\"exception_day\") == exceptionData[i].days;", + " tests[\"Body contains added exception timerange\"] = postman.getEnvironmentVariable(\"exception_timerange\") == exceptionData[i].timerange;", + " break;", + " }", + " i++;", + " }", + " if (i == tpData.length)", + " tests[\"tp_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getexception\",\n \"object\":\"tp\",\n \"values\": \"{{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": "Del exception", + "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\": \"delexception\",\n \"object\": \"tp\",\n \"values\": \"{{tp_name}};{{exception_day}}\"\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": [] + } + ], + "protocolProfileBehavior": {} + }, + { + "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\": \"cmd-test;misc;{{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 name", + "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\": \"cmd\",\n \"values\": \"cmd-test;name;{{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 line", + "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\": \"cmd\",\n \"values\": \"{{command_name}};line;{{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": [] + }, + { + "name": "Setparam type", + "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\": \"cmd\",\n \"values\": \"{{command_name}};type;{{command_type}}\"\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 graph", + "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\": \"cmd\",\n \"values\": \"{{command_name}};graph;{{command_graph}}\"\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 example", + "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\": \"cmd\",\n \"values\": \"{{command_name}};example;{{command_example}}\"\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 comment", + "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\": \"cmd\",\n \"values\": \"{{command_name}};comment;{{command_comment}}\"\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 argument", + "event": [ + { + "listen": "test", + "script": { + "id": "df114804-4a0c-4f9f-981b-d86f7f192dd3", + "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\": \"setargumentdescr\",\n \"object\": \"cmd\",\n \"values\": \"{{command_name}};ARG1:New First Arg\"\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 arguments", + "event": [ + { + "listen": "test", + "script": { + "id": "e33fe297-6eea-4cab-a6b8-4a5c96bcfc73", + "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\": {", + " \"name\": { \"type\": \"string\" },", + " \"description\": { \"type\": \"string\" }", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"name\", \"description\"]", + " }", + "};", + "", + "tests[\"Validate schema\"] = tv4.validate(result, schema);" + ], + "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\": \"getargumentdesc\",\n \"object\": \"cmd\",\n \"values\": \"mycommand\"\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 commands", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var commandData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of commands\"] = commandData;", + " var i = 0;", + " while (i < commandData.length) {", + " if (postman.getEnvironmentVariable(\"command_name\") == commandData[i].name) {", + " tests[\"Body contains added command_name\"] = postman.getEnvironmentVariable(\"command_name\") == commandData[i].name;", + " tests[\"Body contains added command_type\"] = postman.getEnvironmentVariable(\"command_type\") == commandData[i].type;", + " tests[\"Body contains added command_line\"] = postman.getEnvironmentVariable(\"command_line\") == commandData[i].line;", + " break;", + " }", + " i++;", + " }", + " if (i == commandData.length)", + " tests[\"command_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"cmd\"\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.", + "protocolProfileBehavior": {} + }, + { + "name": "20-Contacts templates", + "item": [ + { + "name": "Add ctpl", + "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\": \"contacttpl\",\n \"values\": \"test_name;test_alias;test@localhost;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 name", + "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\": \"contacttpl\",\n \"values\": \"test_alias;name;{{ctpl_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 alias", + "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\": \"contacttpl\",\n \"values\": \"test_alias;alias;{{ctpl_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 comment", + "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};comment;{{ctpl_comment}}\"\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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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\": \"contacttpl\",\n \"values\": \"{{ctpl_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": [] + }, + { + "name": "Setparam address1", + "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address1;{{contact_address1}}\"\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 address2", + "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address2;{{contact_address2}}\"\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 address3", + "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address3;{{contact_address3}}\"\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 address4", + "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address4;{{contact_address4}}\"\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 address5", + "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address5;{{contact_address5}}\"\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 address6", + "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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};address6;{{contact_address6}}\"\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": "Create ctpl2", + "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\": \"contacttpl\",\n \"values\": \"{{ctpl_name2}};{{ctpl_alias2}};test@localhost;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 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\": \"contacttpl\",\n \"values\": \"{{ctpl_alias}};template;{{ctpl_alias2}}\"\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": "Enable", + "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\": \"enable\",\n \"object\": \"contacttpl\",\n \"values\": \"{{ctpl_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": "Disable", + "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\": \"disable\",\n \"object\": \"contacttpl\",\n \"values\": \"{{ctpl_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.", + "protocolProfileBehavior": {} + }, + { + "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\": \"test_name;test_alias;test@localhost;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 name", + "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\": \"test_alias;name;{{contact_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 alias", + "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\": \"test_alias;alias;{{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": "Setparam comment", + "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}};comment;{{contact_comment}}\"\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 mail", + "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}};email;{{contact_mail}}\"\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 password", + "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}};password;{{contact_pwd}}\"\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 access", + "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}};access;{{contact_access}}\"\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 language", + "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}};language;{{contact_language}}\"\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 GUI access", + "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}};access;{{contact_GUI_access}}\"\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 admin", + "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}};admin;{{contact_admin}}\"\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 authtype", + "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}};authtype;{{contact_authentication}}\"\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": [] + }, + { + "name": "Setparam address1", + "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}};address1;{{contact_address1}}\"\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 address2", + "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}};address2;{{contact_address2}}\"\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 address3", + "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}};address3;{{contact_address3}}\"\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 address4", + "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}};address4;{{contact_address4}}\"\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 address5", + "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}};address5;{{contact_address5}}\"\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 address6", + "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}};address6;{{contact_address6}}\"\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 ldap_dn", + "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}};ldap_dn;{{contact_ldap_dn}}\"\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 autologin_key", + "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}};autologin_key;{{contact_autologin_key}}\"\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\": \"contact\",\n \"values\": \"{{contact_alias}};template;{{ctpl_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": "Enable", + "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\": \"enable\",\n \"object\": \"contact\",\n \"values\": \"{{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": "Disable", + "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\": \"disable\",\n \"object\": \"contact\",\n \"values\": \"{{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": "List contact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var contactData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contacts\"] = contactData;", + " var i = 0;", + " while (i < contactData.length) {", + " if (postman.getEnvironmentVariable(\"contact_name\") == contactData[i].name) {", + " tests[\"Body contains added contact_name\"] = postman.getEnvironmentVariable(\"contact_name\") == contactData[i].name;", + " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].alias;", + " tests[\"Body contains added contact_email\"] = postman.getEnvironmentVariable(\"contact_mail\") == contactData[i].email;", + " tests[\"Body contains added contact_GUI_access\"] = postman.getEnvironmentVariable(\"contact_GUI_access\") == contactData[i]['gui access'];", + " tests[\"Body contains added contact_admin\"] = postman.getEnvironmentVariable(\"contact_admin\") == contactData[i].admin;", + " break;", + " }", + " i++;", + " }", + " if (i == contactData.length)", + " tests[\"contact_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"contact\"\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 contact non admin", + "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}};admin;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": "Create contact-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\": \"contact\",\n \"values\": \"{{contact_name2}};{{contact_alias2}};test@localhost;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": "Set contact non admin", + "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}};admin;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": [] + } + ], + "description": "Tests all commands to manage contact.", + "protocolProfileBehavior": {} + }, + { + "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\": \"test_name;test_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 name", + "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\": \"cg\",\n \"values\": \"test_name;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": "Setparam alias", + "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\": \"cg\",\n \"values\": \"{{cg_name}};alias;{{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": "Enable", + "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\": \"enable\",\n \"object\": \"cg\",\n \"values\": \"{{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": "Disable", + "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\": \"disable\",\n \"object\": \"cg\",\n \"values\": \"{{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": "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": [] + }, + { + "name": "Delcontact", + "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\": \"delcontact\",\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": [] + }, + { + "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\": \"cg\",\n \"values\": \"{{cg_name}};{{contact_alias}}|{{contact_alias2}}\"\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": "Getcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var contactData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contacts\"] = contactData;", + " var i = 0;", + " while (i < contactData.length) {", + " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name)", + " {", + " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == contactData.length)", + " tests[\"contact_alias was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getcontact\",\n \"object\": \"cg\",\n \"values\": \"{{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": "List contact group", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var cgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contact groups\"] = cgData;", + " var i = 0;", + " while (i < cgData.length) {", + " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name)", + " {", + " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", + " tests[\"Body contains added cg_alias\"] = postman.getEnvironmentVariable(\"cg_alias\") == cgData[i].alias;", + " break;", + " }", + " i++;", + " }", + " if (i == cgData.length)", + " tests[\"cg_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"cg\"\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.", + "protocolProfileBehavior": {} + }, + { + "name": "30-Hosts_Templates", + "item": [ + { + "name": "Create host template2", + "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_name2}};{{htpl_name2}};0.0.0.0;;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 htpl", + "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\": \"test_host;test_host;0.0.0.0;{{htpl_name2}};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 name", + "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\": \"test_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": "Setparam 2d_coords", + "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}};2d_coords;{{host_2d_coords}}\"\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 3d_coords", + "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}};3d_coords;{{host_3d_coords}}\"\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 action_url", + "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}};action_url;{{host_action_url}}\"\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 activate", + "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}};activate;{{host_activate}}\"\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_checks_enabled", + "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}};active_checks_enabled;{{host_active_checks_enabled}}\"\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 address", + "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}};address;{{host_address}}\"\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 alias", + "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}};alias;{{host_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": "List hosts", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hostData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of hosts\"] = hostData;", + " var i = 0;", + " while (i < hostData.length) {", + " if (postman.getEnvironmentVariable(\"htpl_name\") == hostData[i].name) {", + " tests[\"Body contains added host\"] = postman.getEnvironmentVariable(\"htpl_name\") == hostData[i].name;", + " tests[\"Body contains added host_alias\"] = postman.getEnvironmentVariable(\"host_alias\") == hostData[i].alias;", + " tests[\"Body contains added host_address\"] = postman.getEnvironmentVariable(\"host_address\") == hostData[i].address;", + " tests[\"Body contains added host_activate\"] = postman.getEnvironmentVariable(\"host_activate\") == hostData[i].activate;", + " break;", + " }", + " i++;", + " }", + " if (i == hostData.length)", + " tests[\"htpl_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"show\",\n \"object\":\"htpl\"\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_command_arguments", + "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_arguments;{{command_example}}\"\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_interval", + "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_interval;{{host_normal_interval}}\"\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_freshness", + "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_freshness;{{host_check_freshness}}\"\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 check_enabled", + "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}};checks_enabled;{{host_check_enabled}}\"\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 contact_additive_inheritance", + "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}};contact_additive_inheritance;{{host_contact_additive_inheritance}}\"\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 cg_additive_inheritance", + "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}};cg_additive_inheritance;{{host_cg_additive_inheritance}}\"\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 event_handler", + "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}};event_handler;{{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 event_handler_arg", + "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}};event_handler_arguments;{{command_example}}\"\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 event_handler_enabled", + "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}};event_handler_enabled;{{host_event_handler_enabled}}\"\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 first_notification_delay", + "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}};first_notification_delay;{{host_first_notif_delay}}\"\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 flap_detection_enabled", + "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}};flap_detection_enabled;{{host_flap_detect_enabled}}\"\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 host_low_flap_threshold", + "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}};host_low_flap_threshold;{{host_low_flap}}\"\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 host_high_flap_threshold", + "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}};host_high_flap_threshold;{{host_high_flap}}\"\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 flap_detection_options", + "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}};flap_detection_options;{{host_flap_detect_options}}\"\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 icon_image", + "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}};icon_image;{{host_icon_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": [] + }, + { + "name": "Setparam icon_image_alt", + "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}};icon_image_alt;{{host_icon_image_alt}}\"\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 notes", + "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}};notes;{{host_notes}}\"\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 notes_url", + "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}};notes_url;{{host_notes_url}}\"\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 notifications_enabled", + "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}};notifications_enabled;{{host_notif_enabled}}\"\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 notification_interval", + "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}};notification_interval;{{host_notif_interval}}\"\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 notification_options", + "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}};notification_options;{{host_notif_options}}\"\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 notification_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}};notification_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 recovery_notif_delay", + "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}};recovery_notification_delay;{{host_recovery_notif_delay}}\"\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 obsess_over_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\":\"setparam\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};obsess_over_host;{{host_obsess_over_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": "Setparam passive_checks_enabled", + "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}};passive_checks_enabled;{{host_passive_checks_enabled}}\"\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 process_perf_data", + "event": [ + { + "listen": "test", + "script": { + "id": "042a5d7e-922d-438f-84d5-49a417ae9f5e", + "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\":\"htpl\",\n \"values\": \"{{htpl_name}};process_perf_data;2\"\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 retain_status_info", + "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}};retain_status_information;{{host_retain_status_info}}\"\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 retain_nonstatus_info", + "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}};retain_nonstatus_information;{{host_retain_nonstatus_info}}\"\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 retry_check_interval", + "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}};retry_check_interval;{{host_retry_check_interval}}\"\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": "Setparam stalking_options", + "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}};stalking_options;{{host_stalking_options}}\"\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 statusmap_image", + "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}};statusmap_image;{{host_statusmap_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": [] + }, + { + "name": "Setparam host_notif_options", + "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}};host_notification_options;{{host_notification_options}}\"\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 timezone", + "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}};timezone;{{host_timezone}}\"\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": "Setmacro", + "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\":\"setmacro\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};{{host_macro_name}};{{host_macro_value}};{{host_is_password}};{{host_macro_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": "Getmacro", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var macroData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of macros\"] = macroData;", + " var i = 0;", + " while (i < macroData.length) {", + " if (postman.getEnvironmentVariable(\"host_macro_name\") == macroData[i]['macro name']) {", + " tests[\"Body contains added macro\"] = postman.getEnvironmentVariable(\"host_macro_name\") == macroData[i]['macro name'];", + " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"host_macro_value\") == macroData[i]['macro value'];", + " tests[\"Body contains added macro_is_password\"] = postman.getEnvironmentVariable(\"host_is_password\") == macroData[i].is_password;", + " tests[\"Body contains added macro_description\"] = postman.getEnvironmentVariable(\"host_macro_description\") == macroData[i].description;", + " break;", + " }", + " i++;", + " }", + " if (i == macroData.length)", + " tests[\"host_macro_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getmacro\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "Delmacro", + "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\":\"delmacro\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};{{host_macro_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": "Create host template3", + "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_name3}};test_host;0.0.0.0;;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": "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\":\"htpl\",\n \"values\": \"{{htpl_name}};{{htpl_name3}}\"\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": "Deltemplate", + "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\":\"deltemplate\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};{{htpl_name3}}\"\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": "Settemplate", + "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\":\"settemplate\",\n \"object\":\"htpl\",\n \"values\": \"{{htpl_name}};{{htpl_name3}}\"\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": "Gettemplate", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var templateData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of templates\"] = templateData;", + " var i = 0;", + " while (i < templateData.length) {", + " if (postman.getEnvironmentVariable(\"htpl_name3\") == templateData[i].name) {", + " tests[\"Body contains added htpl_name3\"] = postman.getEnvironmentVariable(\"htpl_name3\") == templateData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == templateData.length)", + " tests[\"htpl_name3 was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"gettemplate\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "Addparent", + "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\": \"addparent\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{host_name2}}\"\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": "Delparent", + "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\": \"delparent\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{host_name2}}\"\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": "Setparent", + "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\": \"setparent\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name}};{{host_name2}}\"\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": "Getparent", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var parentData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of parents\"] = parentData;", + " var i = 0;", + " while (i < parentData.length) {", + " if (postman.getEnvironmentVariable(\"host_name2\") == parentData[i].name) {", + " tests[\"Body contains added host_name2\"] = postman.getEnvironmentVariable(\"host_name2\") == parentData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == parentData.length)", + " tests[\"host_name2 was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getparent\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "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": "Delcontactgroup", + "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\": \"delcontactgroup\",\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": "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\": \"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": "Getcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var cgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contact groups\"] = cgData;", + " var i = 0;", + " while (i < cgData.length) {", + " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name) {", + " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == cgData.length)", + " tests[\"cg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getcontactgroup\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "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\": \"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": "Delcontact", + "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\": \"delcontact\",\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": "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}}|{{contact_alias2}}\"\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": "Getcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var contactData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contacts\"] = contactData;", + " var i = 0;", + " while (i < contactData.length) {", + " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name) {", + " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == contactData.length)", + " tests[\"contact_alias was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getcontact\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "Add host 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\": \"hg\",\n \"values\": \"test_name;test_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 name", + "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\": \"hg\",\n \"values\": \"test_name;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": "Addhostgroup", + "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\": \"addhostgroup\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_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": "Delhostgroup", + "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\": \"delhostgroup\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_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": "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\": \"htpl\",\n \"values\": \"{{htpl_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": "Gethostgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contacts\"] = hgData;", + " var i = 0;", + " while (i < hgData.length) {", + " if (postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name) {", + " tests[\"Body contains added hg_name\"] = postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == hgData.length)", + " tests[\"hg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"gethostgroup\",\n \"object\":\"htpl\",\n \"values\": \"{{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": "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": [] + }, + { + "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": [] + }, + { + "name": "Unsetseverity", + "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\": \"unsetseverity\",\n \"object\": \"htpl\",\n \"values\": \"{{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": "Enable", + "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\": \"enable\",\n \"object\": \"htpl\",\n \"values\": \"{{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": "Disable", + "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\": \"disable\",\n \"object\": \"htpl\",\n \"values\": \"{{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": [] + } + ], + "protocolProfileBehavior": {} + }, + { + "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\": \"test_host;test_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 name", + "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\": \"test_host;name;{{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": "Setparam 2d_coords", + "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}};2d_coords;{{host_2d_coords}}\"\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 3d_coords", + "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}};3d_coords;{{host_3d_coords}}\"\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 action_url", + "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}};action_url;{{host_action_url}}\"\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 activate", + "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}};activate;{{host_activate}}\"\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_checks_enabled", + "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}};active_checks_enabled;{{host_active_checks_enabled}}\"\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 address", + "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}};address;{{host_address}}\"\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 alias", + "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}};alias;{{host_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": "List hosts", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hostData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of hosts\"] = hostData;", + " var i = 0;", + " while (i < hostData.length) {", + " if (postman.getEnvironmentVariable(\"host_name\") == hostData[i].name) {", + " tests[\"Body contains added host\"] = postman.getEnvironmentVariable(\"host_name\") == hostData[i].name;", + " tests[\"Body contains added host_alias\"] = postman.getEnvironmentVariable(\"host_alias\") == hostData[i].alias;", + " tests[\"Body contains added host_address\"] = postman.getEnvironmentVariable(\"host_address\") == hostData[i].address;", + " tests[\"Body contains added host_activate\"] = postman.getEnvironmentVariable(\"host_activate\") == hostData[i].activate;", + " break;", + " }", + " i++;", + " }", + " if (i == hostData.length)", + " tests[\"host_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"show\",\n \"object\":\"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": "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": "Setparam check_command_arguments", + "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_arguments;{{command_example}}\"\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_interval", + "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_interval;{{host_normal_interval}}\"\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_freshness", + "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_freshness;{{host_check_freshness}}\"\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\":\"host\",\n \"values\": \"{{host_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 check_enabled", + "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}};checks_enabled;{{host_check_enabled}}\"\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 contact_additive_inheritance", + "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}};contact_additive_inheritance;{{host_contact_additive_inheritance}}\"\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 cg_additive_inheritance", + "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}};cg_additive_inheritance;{{host_cg_additive_inheritance}}\"\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 event_handler", + "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}};event_handler;{{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 event_handler_arg", + "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}};event_handler_arguments;{{command_example}}\"\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 event_handler_enabled", + "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}};event_handler_enabled;{{host_event_handler_enabled}}\"\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 first_notification_delay", + "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}};first_notification_delay;{{host_first_notif_delay}}\"\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 flap_detection_enabled", + "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}};flap_detection_enabled;{{host_flap_detect_enabled}}\"\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 host_low_flap_threshold", + "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}};host_low_flap_threshold;{{host_low_flap}}\"\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 host_high_flap_threshold", + "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}};host_high_flap_threshold;{{host_high_flap}}\"\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 flap_detection_options", + "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}};flap_detection_options;{{host_flap_detect_options}}\"\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 icon_image", + "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}};icon_image;{{host_icon_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": [] + }, + { + "name": "Setparam icon_image_alt", + "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}};icon_image_alt;{{host_icon_image_alt}}\"\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\":\"host\",\n \"values\": \"{{host_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 notes", + "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}};notes;{{host_notes}}\"\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 notes_url", + "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}};notes_url;{{host_notes_url}}\"\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 notifications_enabled", + "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}};notifications_enabled;{{host_notif_enabled}}\"\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 notification_interval", + "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}};notification_interval;{{host_notif_interval}}\"\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 notification_options", + "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}};notification_options;{{host_notif_options}}\"\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 notification_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\":\"host\",\n \"values\": \"{{host_name}};notification_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 recovery_notif_delay", + "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}};recovery_notification_delay;{{host_recovery_notif_delay}}\"\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 obsess_over_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\":\"setparam\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};obsess_over_host;{{host_obsess_over_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": "Setparam passive_checks_enabled", + "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}};passive_checks_enabled;{{host_passive_checks_enabled}}\"\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 process_perf_data", + "event": [ + { + "listen": "test", + "script": { + "id": "898cfe6e-beb3-4e4c-a970-f07be37745df", + "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\": \"{{host_name}};process_perf_data;2\"\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 retain_status_info", + "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}};retain_status_information;{{host_retain_status_info}}\"\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 retain_nonstatus_info", + "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}};retain_nonstatus_information;{{host_retain_nonstatus_info}}\"\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 retry_check_interval", + "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}};retry_check_interval;{{host_retry_check_interval}}\"\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\":\"host\",\n \"values\": \"{{host_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\":\"host\",\n \"values\": \"{{host_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": "Setparam stalking_options", + "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}};stalking_options;{{host_stalking_options}}\"\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 statusmap_image", + "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}};statusmap_image;{{host_statusmap_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": [] + }, + { + "name": "Setparam host_notif_options", + "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}};host_notification_options;{{host_notification_options}}\"\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 timezone", + "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}};timezone;{{host_timezone}}\"\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": "Setinstance", + "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\":\"setinstance\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};{{instance_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": "Showinstance", + "event": [ + { + "listen": "test", + "script": { + "id": "d98aa955-00be-475b-88cd-b6eb878571f3", + "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\" },", + " \"name\": { \"type\": \"string\" }", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"id\", \"name\"]", + " }", + "};", + "", + "tests[\"Validate schema\"] = tv4.validate(result, schema);", + "" + ], + "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\":\"showinstance\",\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": "Setmacro", + "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\":\"setmacro\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};{{host_macro_name}};{{host_macro_value}};{{host_is_password}};{{host_macro_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": "Getmacro", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var macroData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of macros\"] = macroData;", + " var i = 0;", + " while (i < macroData.length) {", + " if (postman.getEnvironmentVariable(\"host_macro_name\") == macroData[i]['macro name']) {", + " tests[\"Body contains added macro\"] = postman.getEnvironmentVariable(\"host_macro_name\") == macroData[i]['macro name'];", + " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"host_macro_value\") == macroData[i]['macro value'];", + " tests[\"Body contains added macro_is_password\"] = postman.getEnvironmentVariable(\"host_is_password\") == macroData[i].is_password;", + " tests[\"Body contains added macro_description\"] = postman.getEnvironmentVariable(\"host_macro_description\") == macroData[i].description;", + " break;", + " }", + " i++;", + " }", + " if (i == macroData.length)", + " tests[\"host_macro_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getmacro\",\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": "Delmacro", + "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\":\"delmacro\",\n \"object\":\"host\",\n \"values\": \"{{host_name}};{{host_macro_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": "Deltemplate", + "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\":\"deltemplate\",\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": "Settemplate", + "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\":\"settemplate\",\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": "Gettemplate", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var templateData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of templates\"] = templateData;", + " var i = 0;", + " while (i < templateData.length) {", + " if (postman.getEnvironmentVariable(\"htpl_name\") == templateData[i].name) {", + " tests[\"Body contains added htpl_name\"] = postman.getEnvironmentVariable(\"htpl_name\") == templateData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == templateData.length)", + " tests[\"host_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"gettemplate\",\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": "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": "Addparent", + "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\": \"addparent\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{host_name2}}\"\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": "Delparent", + "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\": \"delparent\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{host_name2}}\"\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": "Setparent", + "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\": \"setparent\",\n \"object\": \"host\",\n \"values\": \"{{host_name}};{{host_name2}}\"\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": "Getparent", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var parentData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of parents\"] = parentData;", + " var i = 0;", + " while (i < parentData.length) {", + " if (postman.getEnvironmentVariable(\"host_name2\") == parentData[i].name) {", + " tests[\"Body contains added parent\"] = postman.getEnvironmentVariable(\"host_name2\") == parentData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == parentData.length)", + " tests[\"host_name2 was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getparent\",\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": "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\": \"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": "Delcontactgroup", + "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\": \"delcontactgroup\",\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": "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": "Getcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var cgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contact groups\"] = cgData;", + " var i = 0;", + " while (i < cgData.length) {", + " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name) {", + " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == cgData.length)", + " tests[\"cg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getcontactgroup\",\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": "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\": \"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": "Delcontact", + "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\": \"delcontact\",\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": "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": "Getcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var contactData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contacts\"] = contactData;", + " var i = 0;", + " while (i < contactData.length) {", + " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name) {", + " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == contactData.length)", + " tests[\"contact_alias was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getcontact\",\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": "Addhostgroup", + "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\": \"addhostgroup\",\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": "Delhostgroup", + "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\": \"delhostgroup\",\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": "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": "Gethostgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contacts\"] = hgData;", + " var i = 0;", + " while (i < hgData.length) {", + " if (postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name) {", + " tests[\"Body contains added hg_name\"] = postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == hgData.length)", + " tests[\"hg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"gethostgroup\",\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": "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": "Unsetseverity", + "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\": \"unsetseverity\",\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": "Enable", + "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\": \"enable\",\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": "Disable", + "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\": \"disable\",\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": [] + } + ], + "description": "Tests all commands to manage hosts", + "protocolProfileBehavior": {} + }, + { + "name": "32-Hostgroups", + "item": [ + { + "name": "Setparam alias", + "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\": \"hg\",\n \"values\": \"{{hg_name}};alias;{{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": [] + }, + { + "name": "Setparam comment", + "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\": \"hg\",\n \"values\": \"{{hg_name}};comment;{{hg_comment}}\"\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 activate", + "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\": \"hg\",\n \"values\": \"{{hg_name}};activate;{{hg_activate}}\"\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 notes", + "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\": \"hg\",\n \"values\": \"{{hg_name}};notes;{{hg_notes}}\"\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 notes_url", + "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\": \"hg\",\n \"values\": \"{{hg_name}};notes_url;{{hg_notes_url}}\"\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 action_url", + "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\": \"hg\",\n \"values\": \"{{hg_name}};action_url;{{hg_action_url}}\"\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 icon_image", + "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\": \"hg\",\n \"values\": \"{{hg_name}};icon_image;{{hg_icon_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": [] + }, + { + "name": "Setparam map_icon_image", + "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\": \"hg\",\n \"values\": \"{{hg_name}};map_icon_image;{{hg_map_icon_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": [] + }, + { + "name": "List host groups", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of host categories\"] = hgData;", + " var i = 0;", + " while (i < hgData.length) {", + " if (postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name)", + " {", + " tests[\"Body contains added hg_name\"] = postman.getEnvironmentVariable(\"hg_name\") == hgData[i].name;", + " tests[\"Body contains added hg_alias\"] = postman.getEnvironmentVariable(\"hg_alias\") == hgData[i].alias;", + " break;", + " }", + " i++;", + " }", + " if (i == hgData.length)", + " tests[\"hg_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"hg\"\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": "Addmember", + "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\": \"addmember\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name}};{{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": "Delmenber", + "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\": \"delmember\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name}};{{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": "Setmember", + "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\": \"setmember\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name}};{{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": "Getmember", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hg_member_Data = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of host group members\"] = hg_member_Data;", + " var i = 0;", + " while (i < hg_member_Data.length) {", + " if (postman.getEnvironmentVariable(\"host_name\") == hg_member_Data[i].name)", + " {", + " tests[\"Body contains added host_name\"] = postman.getEnvironmentVariable(\"host_name\") == hg_member_Data[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == hg_member_Data.length)", + " tests[\"host_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getmember\",\n \"object\": \"hg\",\n \"values\": \"{{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": [] + } + ], + "description": "Tests all commands to manage host groups.", + "protocolProfileBehavior": {} + }, + { + "name": "33-Hosts_Categories", + "item": [ + { + "name": "Addmember", + "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\": \"addmember\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{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": "Delmember", + "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\": \"delmember\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{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": "Setmember", + "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\": \"setmember\",\n \"object\": \"hc\",\n \"values\": \"{{hc_name}};{{host_name}}|{{host_name2}}\"\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": "Getmember", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hc_member_Data = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of host category members\"] = hc_member_Data;", + " var i = 0;", + " while (i < hc_member_Data.length) {", + " if (postman.getEnvironmentVariable(\"host_name\") == hc_member_Data[i].name)", + " {", + " tests[\"Body contains added host_name\"] = postman.getEnvironmentVariable(\"host_name\") == hc_member_Data[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == hc_member_Data.length)", + " {", + " tests[\"host_name was found\"] = false;", + " }", + "}", + "catch (e) {}", + "", + "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\": \"getmember\",\n \"object\": \"hc\",\n \"values\": \"{{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": "Unsetseverity", + "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\": \"unsetseverity\",\n \"object\": \"hc\",\n \"values\": \"{{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": "List host categories", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hcData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of host categories\"] = hcData;", + " var i = 0;", + " while (i < hcData.length) {", + " if (postman.getEnvironmentVariable(\"hc_name\") == hcData[i].name)", + " {", + " tests[\"Body contains added hc_name\"] = postman.getEnvironmentVariable(\"hc_name\") == hcData[i].name;", + " tests[\"Body contains added hc_alias\"] = postman.getEnvironmentVariable(\"hc_alias\") == hcData[i].alias;", + " break;", + " }", + " i++;", + " }", + " if (i == hcData.length)", + " tests[\"hc_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"hc\"\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.", + "protocolProfileBehavior": {} + }, + { + "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\": \"test_stpl;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 description", + "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\": \"test_stpl;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 activate", + "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}};activate;{{stpl_activate}}\"\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 alias", + "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}};alias;{{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": "Create service template-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\": \"stpl\",\n \"values\": \"{{stpl_description2}};test_alias;{{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\": \"stpl\",\n \"values\": \"{{stpl_description}};template;{{stpl_description2}}\"\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 is_volatile", + "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}};is_volatile;{{stpl_is_volatile}}\"\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 check_command_arguments", + "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_arguments;{{command_argument}}\"\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": "Setparam normal_check_interval", + "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}};normal_check_interval;{{stpl_normal_check_interval}}\"\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 retry_check_interval", + "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}};retry_check_interval;{{stpl_retry_check_interval}}\"\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_checks_enabled", + "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}};active_checks_enabled;{{stpl_active_check_enabled}}\"\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_checks_enabled", + "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}};passive_checks_enabled;{{stpl_passive_check_enabled}}\"\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 contact_additive_inheritance", + "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}};contact_additive_inheritance;{{stpl_contact_additive_inheritance}}\"\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 cg_additive_inheritance", + "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}};cg_additive_inheritance;{{stpl_cg_additive_inheritance}}\"\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 notification_interval", + "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}};notification_interval;{{stpl_notification_interval}}\"\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 notification_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}};notification_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 notification_options", + "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}};notification_options;{{stpl_notif_option}}\"\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 first_notification_delay", + "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}};first_notification_delay;{{stpl_first_notif_delay}}\"\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 parallelize_check", + "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}};parallelize_check;{{stpl_parallelize_checks}}\"\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 obsess_over_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\": \"setparam\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};obsess_over_service;{{stpl_obsess_over_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": [] + }, + { + "name": "Setparam check_freshness", + "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_freshness;{{stpl_check_freshness}}\"\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 freshness_threshold", + "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}};freshness_threshold;{{stpl_freshness_threshold}}\"\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 event_handler_enabled", + "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}};event_handler_enabled;{{stpl_event_handler_enabled}}\"\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 flap_detection_enabled", + "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}};flap_detection_enabled;{{stpl_flap_detection_enabled}}\"\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 process_perf_data", + "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}};process_perf_data;{{stpl_process_perf_data}}\"\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 retain_status_informations", + "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}};retain_status_information;{{stpl_retain_status_info}}\"\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 retain_nonstatus_informations", + "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}};retain_nonstatus_information;{{stpl_retain_nonstatus_info}}\"\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 stalking_options", + "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}};stalking_options;{{stpl_stalking_options}}\"\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 event_handler", + "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}};event_handler;{{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 event_handler_arguments", + "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}};event_handler_arguments;{{stpl_event_handler_arg}}\"\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 notes", + "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}};notes;{{stpl_notes}}\"\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 notes_url", + "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}};notes_url;{{stpl_notes_url}}\"\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 action_url", + "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}};action_url;{{stpl_action_url}}\"\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 icon_image", + "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}};icon_image;{{stpl_icon_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": [] + }, + { + "name": "Setparam icon_image_alt", + "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}};icon_image_alt;{{stpl_icon_image_alt}}\"\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 graphtemplate", + "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}};graphtemplate;{{stpl_graph_tpl}}\"\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 comment", + "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}};comment;{{stpl_comment}}\"\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 service_notif_options", + "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}};service_notification_options;{{stpl_notif_options}}\"\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 templates", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var stplData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of service templates\"] = stplData;", + " var i = 0;", + " while (i < stplData.length) {", + " if (postman.getEnvironmentVariable(\"stpl_description\") == stplData[i].description)", + " {", + " tests[\"Body contains added service template\"] = postman.getEnvironmentVariable(\"stpl_description\") == stplData[i].description;", + " tests[\"Body contains added alias\"] = postman.getEnvironmentVariable(\"stpl_alias\") == stplData[i].alias;", + " tests[\"Body contains added command_name\"] = postman.getEnvironmentVariable(\"command_name\") == stplData[i]['check command'];", + " tests[\"Body contains added comment argument\"] = postman.getEnvironmentVariable(\"command_argument\") == stplData[i]['check command arg'];", + " tests[\"Body contains added normal check interval\"] = postman.getEnvironmentVariable(\"stpl_normal_check_interval\") == stplData[i]['normal check interval'];", + " tests[\"Body contains added retry check interval\"] = postman.getEnvironmentVariable(\"stpl_retry_check_interval\") == stplData[i]['retry check interval'];", + " tests[\"Body contains added max check attempts\"] = postman.getEnvironmentVariable(\"stpl_max_check\") == stplData[i]['max check attempts'];", + " tests[\"Body contains added active checks enabled\"] = postman.getEnvironmentVariable(\"stpl_active_check_enabled\") == stplData[i]['active checks enabled'];", + " tests[\"Body contains added passive checks enabled\"] = postman.getEnvironmentVariable(\"stpl_passive_check_enabled\") == stplData[i]['passive checks enabled'];", + " break;", + " }", + " i++;", + " }", + " if (i == stplData.length)", + " tests[\"stpl_description was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"stpl\"\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": "Addhosttemplate", + "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\": \"addhosttemplate\",\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": "Delhosttemplate", + "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\": \"delhosttemplate\",\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": "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}}|{{htpl_name2}}\"\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": "Setmacro", + "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\": \"setmacro\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{stpl_macro_name}};{{stpl_macro_value}}\"\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": "Getmacro", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var macroData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of macros\"] = macroData;", + " var i = 0;", + " while (i < macroData.length) {", + " if (postman.getEnvironmentVariable(\"stpl_macro_value\") == macroData[i]['macro value']){", + " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"stpl_macro_value\") == macroData[i]['macro value'];", + " break;", + " }", + " i++;", + " }", + " if (i == macroData.length)", + " tests[\"stpl_macro_value was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getmacro\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "Delmacro", + "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\": \"delmacro\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{stpl_macro_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": "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\": \"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": "Delcontact", + "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\": \"delcontact\",\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": "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}}|{{contact_alias2}}\"\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": "Getcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var contactData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contacts\"] = contactData;", + " var i = 0;", + " while (i < contactData.length) {", + " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name){", + " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == contactData.length)", + " tests[\"contact_alias was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getcontact\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "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": [] + }, + { + "name": "Getcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var cgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contact groups\"] = cgData;", + " var i = 0;", + " while (i < cgData.length) {", + " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name){", + " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == cgData.length)", + " tests[\"cg_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getcontactgroup\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "Delcontactgroup", + "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\": \"delcontactgroup\",\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": [] + }, + { + "name": "Add trap", + "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\": \"trap\",\n \"values\": \"test_name;test_OID\"\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 name", + "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\": \"trap\",\n \"values\": \"test_name;name;{{trap_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": "Settrap", + "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\": \"settrap\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{trap_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": "Gettrap", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var trapData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of traps\"] = trapData;", + " var i = 0;", + " while (i < trapData.length) {", + " if (postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name){", + " tests[\"Body contains added trap_name\"] = postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == trapData.length)", + " tests[\"trap_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"gettrap\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "Deltrap", + "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\": \"deltrap\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description}};{{trap_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.", + "protocolProfileBehavior": {} + }, + { + "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_test;{{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 description", + "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_test;description;{{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": "Setparam activate", + "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}};activate;{{service_activate}}\"\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": "Setparam is_volatile", + "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}};is_volatile;{{service_is_volatile}}\"\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\": \"service\",\n \"values\": \"{{host_name}};{{service_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\": \"service\",\n \"values\": \"{{host_name}};{{service_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 check_command_arguments", + "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}};check_command_arguments;{{command_argument}}\"\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\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};max_check_attempts;{{service_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 normal_check_interval", + "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}};normal_check_interval;{{service_normal_check_interval}}\"\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 retry_check_interval", + "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}};retry_check_interval;{{service_retry_check_interval}}\"\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_checks_enabled", + "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}};active_checks_enabled;{{service_active_check_enabled}}\"\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_checks_enabled", + "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}};passive_checks_enabled;{{service_passive_check_enabled}}\"\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 contact_additive_inheritance", + "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}};contact_additive_inheritance;{{service_contact_additive_inheritance}}\"\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 cg_additive_inheritance", + "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}};cg_additive_inheritance;{{service_cg_additive_inheritance}}\"\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 notifications_enabled", + "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}};notifications_enabled;{{service_notifications_enabled}}\"\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 contact_additive_inheritance", + "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}};contact_additive_inheritance;{{service_contact_additive_inheritance}}\"\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 cg_additive_inheritance", + "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}};cg_additive_inheritance;{{service_cg_additive_inheritance}}\"\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 notification_interval", + "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}};notification_interval;{{service_notif_interval}}\"\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 notification_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\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};notification_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 notification_options", + "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}};notification_options;{{service_notif_option}}\"\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 first_notification_delay", + "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}};first_notification_delay;{{service_first_notif_delay}}\"\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 parallelize_check", + "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}};parallelize_check;{{service_parallelize_checks}}\"\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 obsess_over_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\": \"setparam\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};obsess_over_service;{{service_obsess_over_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": [] + }, + { + "name": "Setparam check_freshness", + "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}};check_freshness;{{service_check_freshness}}\"\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 freshness_threshold", + "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}};freshness_threshold;{{service_freshness_threshold}}\"\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 event_handler_enabled", + "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}};event_handler_enabled;{{service_event_handler_enabled}}\"\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 flap_detection_enabled", + "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}};flap_detection_enabled;{{service_flap_detection_enabled}}\"\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 service_low_flap_threshold", + "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}};service_low_flap_threshold;{{service_low_flap}}\"\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 service_high_flap_threshold", + "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}};service_high_flap_threshold;{{service_high_flap}}\"\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 process_perf_data", + "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}};process_perf_data;{{service_process_perf_data}}\"\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 retain_status_informations", + "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}};retain_status_information;{{service_retain_status_info}}\"\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 retain_nonstatus_informations", + "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}};retain_nonstatus_information;{{service_retain_nonstatus_info}}\"\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 event_handler", + "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}};event_handler;{{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 event_handler_arguments", + "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}};event_handler_arguments;{{service_event_handler_arg}}\"\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 notes", + "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}};notes;{{service_notes}}\"\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 notes_url", + "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}};notes_url;{{service_notes_url}}\"\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 action_url", + "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}};action_url;{{service_action_url}}\"\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 icon_image", + "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}};icon_image;{{service_icon_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": [] + }, + { + "name": "Setparam icon_image_alt", + "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}};icon_image_alt;{{service_icon_image_alt}}\"\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 comment", + "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}};comment;{{service_comment}}\"\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 service_notif_options", + "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}};service_notification_options;{{service_notif_option}}\"\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": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var serviceData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of services\"] = serviceData;", + " var i = 0;", + " while (i < serviceData.length) {", + " if (postman.getEnvironmentVariable(\"service_description\") == serviceData[i].description)", + " {", + " tests[\"Body contains added service\"] = postman.getEnvironmentVariable(\"service_description\") == serviceData[i].description;", + " tests[\"Body contains added host name\"] = postman.getEnvironmentVariable(\"host_name\") == serviceData[i]['host name'];", + " tests[\"Body contains added command_name\"] = postman.getEnvironmentVariable(\"command_name\") == serviceData[i]['check command'];", + " tests[\"Body contains added comment argument\"] = postman.getEnvironmentVariable(\"command_argument\") == serviceData[i]['check command arg'];", + " tests[\"Body contains added normal check interval\"] = postman.getEnvironmentVariable(\"service_normal_check_interval\") == serviceData[i]['normal check interval'];", + " tests[\"Body contains added retry check interval\"] = postman.getEnvironmentVariable(\"service_retry_check_interval\") == serviceData[i]['retry check interval'];", + " tests[\"Body contains added max check attempts\"] = postman.getEnvironmentVariable(\"service_max_check_attempts\") == serviceData[i]['max check attempts'];", + " tests[\"Body contains added active checks enabled\"] = postman.getEnvironmentVariable(\"service_active_check_enabled\") == serviceData[i]['active checks enabled'];", + " tests[\"Body contains added passive checks enabled\"] = postman.getEnvironmentVariable(\"service_passive_check_enabled\") == serviceData[i]['passive checks enabled'];", + " break;", + " }", + " i++;", + " }", + " if (i == serviceData.length)", + " tests[\"service_host was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"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": [] + }, + { + "name": "Addhost", + "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\": \"addhost\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{host_name2}}\"\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": "Delhost", + "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\": \"delhost\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{host_name2}}\"\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": "Sethost-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\": \"sethost\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{host_name2}}\"\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": "Sethost", + "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\": \"sethost\",\n \"object\": \"service\",\n \"values\": \"{{host_name2}};{{service_description}};{{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": "Setmacro", + "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\": \"setmacro\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{service_macro_name}};{{service_macro_value}}\"\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": "Getmacro", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var macroData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of macros\"] = macroData;", + " var i = 0;", + " while (i < macroData.length) {", + " if (postman.getEnvironmentVariable(\"service_macro_name\") == macroData[i]['macro name'])", + " {", + " tests[\"Body contains added macro_name\"] = postman.getEnvironmentVariable(\"service_macro_name\") == macroData[i]['macro name'];", + " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"service_macro_value\") == macroData[i]['macro value'];", + " break;", + " }", + " i++;", + " }", + " if (i == macroData.length)", + " tests[\"service_macro_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getmacro\",\n \"object\": \"service\",\n \"values\": \"{{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": "Delmacro", + "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\": \"delmacro\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{service_macro_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 service categories", + "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_test;description_test\"\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 name", + "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\": \"sc\",\n \"values\": \"sc_test;name;{{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": "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\": \"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": [] + }, + { + "name": "Unsetseverity", + "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\": \"unsetseverity\",\n \"object\": \"sc\",\n \"values\": \"{{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": "Resetseverity", + "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": [] + }, + { + "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": "Unsetseverity", + "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\": \"unsetseverity\",\n \"object\": \"service\",\n \"values\": \"{{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": "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\": \"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": "Delcontact", + "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\": \"delcontact\",\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": "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": "Getcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var contactData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of conctacts\"] = contactData;", + " var i = 0;", + " while (i < contactData.length) {", + " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name)", + " {", + " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == contactData.length)", + " tests[\"contact_alias was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getcontact\",\n \"object\": \"service\",\n \"values\": \"{{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": "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": "Getcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var cgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of conctact groups\"] = cgData;", + " var i = 0;", + " while (i < cgData.length) {", + " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name){", + " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == cgData.length)", + " tests[\"cg_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getcontactgroup\",\n \"object\": \"service\",\n \"values\": \"{{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": "Delcontactgroup", + "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\": \"delcontactgroup\",\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": "Addtrap", + "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\": \"addtrap\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{trap_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": "Deltrap", + "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\": \"deltrap\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{trap_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": "Settrap", + "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\": \"settrap\",\n \"object\": \"service\",\n \"values\": \"{{host_name}};{{service_description}};{{trap_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": "Gettrap", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var trapData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of traps\"] = trapData;", + " var i = 0;", + " while (i < trapData.length) {", + " if (postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name)", + " {", + " tests[\"Body contains added trap_name\"] = postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == trapData.length)", + " tests[\"trap_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"gettrap\",\n \"object\": \"service\",\n \"values\": \"{{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": [] + } + ], + "description": "Tests all commands to manage services.", + "protocolProfileBehavior": {} + }, + { + "name": "42-Service_by_Hostgroups", + "item": [ + { + "name": "Add hgservice", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};hgservice_test;{{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 description", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};hgservice_test;description;{{hgservice_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 activate", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};activate;{{hgservice_activate}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Setparam is_volatile", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};is_volatile;{{hgservice_is_volatile}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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 check_command_arguments", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};check_command_arguments;{{command_argument}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};max_check_attempts;{{hgservice_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 normal_check_interval", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};normal_check_interval;{{hgservice_normal_check_interval}}\"\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 retry_check_interval", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};retry_check_interval;{{hgservice_retry_check_interval}}\"\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_checks_enabled", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};active_checks_enabled;{{hgservice_active_check_enabled}}\"\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_checks_enabled", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};passive_checks_enabled;{{hgservice_passive_check_enabled}}\"\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 contact_additive_inheritance", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};contact_additive_inheritance;{{hgservice_contact_additive_inheritance}}\"\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 cg_additive_inheritance", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};cg_additive_inheritance;{{hgservice_cg_additive_inheritance}}\"\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 notifications_enabled", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notifications_enabled;{{hgservice_notifications_enabled}}\"\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 notification_interval", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notification_interval;{{hgservice_notif_interval}}\"\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 notification_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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notification_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 notification_options", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notification_options;{{hgservice_notif_option}}\"\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 first_notification_delay", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};first_notification_delay;{{hgservice_first_notif_delay}}\"\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 parallelize_check", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};parallelize_check;{{hgservice_parallelize_checks}}\"\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 obsess_over_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\": \"setparam\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};obsess_over_service;{{hgservice_obsess_over_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": [] + }, + { + "name": "Setparam check_freshness", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};check_freshness;{{hgservice_check_freshness}}\"\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 freshness_threshold", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};freshness_threshold;{{hgservice_freshness_threshold}}\"\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 event_handler_enabled", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};event_handler_enabled;{{hgservice_event_handler_enabled}}\"\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 flap_detection_enabled", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};flap_detection_enabled;{{hgservice_flap_detection_enabled}}\"\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 process_perf_data", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};process_perf_data;{{hgservice_process_perf_data}}\"\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 retain_status_informations", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};retain_status_information;{{hgservice_retain_status_info}}\"\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 retain_nonstatus_informations", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};retain_nonstatus_information;{{hgservice_retain_nonstatus_info}}\"\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 event_handler", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};event_handler;{{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 event_handler_arguments", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};event_handler_arguments;{{hgservice_event_handler_arg}}\"\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 notes", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notes;{{hgservice_notes}}\"\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 notes_url", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};notes_url;{{hgservice_notes_url}}\"\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 action_url", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};action_url;{{hgservice_action_url}}\"\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 icon_image", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};icon_image;{{hgservice_icon_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": [] + }, + { + "name": "Setparam icon_image_alt", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};icon_image_alt;{{hgservice_icon_image_alt}}\"\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 comment", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};comment;{{hgservice_comment}}\"\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 service_notif_options", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};service_notification_options;{{hg_notif_option}}\"\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": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var serviceData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of host group services\"] = serviceData;", + " var i = 0;", + " while (i < serviceData.length) {", + " if (postman.getEnvironmentVariable(\"hgservice_description\") == serviceData[i].description)", + " {", + " tests[\"Body contains added hgservice\"] = postman.getEnvironmentVariable(\"hgservice_description\") == serviceData[i].description;", + " tests[\"Body contains added hgservice_hg\"] = postman.getEnvironmentVariable(\"hg_name\") == serviceData[i]['hg name'];", + " tests[\"Body contains added command_name\"] = postman.getEnvironmentVariable(\"command_name\") == serviceData[i]['check command'];", + " tests[\"Body contains added comment argument\"] = postman.getEnvironmentVariable(\"command_argument\") == serviceData[i]['check command arg'];", + " tests[\"Body contains added normal check interval\"] = postman.getEnvironmentVariable(\"hgservice_normal_check_interval\") == serviceData[i]['normal check interval'];", + " tests[\"Body contains added retry check interval\"] = postman.getEnvironmentVariable(\"hgservice_retry_check_interval\") == serviceData[i]['retry check interval'];", + " tests[\"Body contains added max check attempts\"] = postman.getEnvironmentVariable(\"hgservice_max_check_attempts\") == serviceData[i]['max check attempts'];", + " tests[\"Body contains added active checks enabled\"] = postman.getEnvironmentVariable(\"hgservice_active_check_enabled\") == serviceData[i]['active checks enabled'];", + " tests[\"Body contains added passive checks enabled\"] = postman.getEnvironmentVariable(\"hgservice_passive_check_enabled\") == serviceData[i]['passive checks enabled'];", + " break;", + " }", + " i++;", + " }", + " if (i == serviceData.length)", + " tests[\"hgservice_description was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"hgservice\"\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": "Create hg-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\": \"hg\",\n \"values\": \"{{hg_name2}};{{hg_name2}};0.0.0.0;;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": "Addhostgroup", + "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\": \"addhostgroup\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hg_name2}}\"\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": "Delhostgroup", + "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\": \"delhostgroup\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hg_name2}}\"\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-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\": \"sethostgroup\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hg_name2}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name2}};{{hgservice_description}};{{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": "Setmacro", + "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\": \"setmacro\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hgservice_macro_name}};{{hgservice_macro_value}}\"\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": "Getmacro", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var macroData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of macros\"] = macroData;", + " var i = 0;", + " var macro_name = \"$_SERVICE\" + postman.getEnvironmentVariable(\"hgservice_macro_name\") + \"$\";", + " while (i < macroData.length) {", + " if (macro_name == macroData[i]['macro name'])", + " {", + " tests[\"Body contains added macro_name\"] = macro_name == macroData[i]['macro name'];", + " tests[\"Body contains added macro_value\"] = postman.getEnvironmentVariable(\"hgservice_macro_value\") == macroData[i]['macro value'];", + " break;", + " }", + " i++;", + " }", + " if (i == macroData.length)", + " tests[\"hgservice_macro_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getmacro\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Delmacro", + "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\": \"delmacro\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_description}};{{hgservice_macro_name}};{{hgservice_macro_value}}\"\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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Delcontact", + "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\": \"delcontact\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Getcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var contactData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of conctacts\"] = contactData;", + " var i = 0;", + " while (i < contactData.length) {", + " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name)", + " {", + " tests[\"Body contains added contact_alias\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == contactData.length)", + " tests[\"contact_alias was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getcontact\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Unsetseverity", + "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\": \"unsetseverity\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Delcontactgroup", + "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "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\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Getcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var cgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contact groups\"] = cgData;", + " var i = 0;", + " while (i < cgData.length) {", + " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name)", + " {", + " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == cgData.length)", + " tests[\"cg_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getcontactgroup\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": [] + } + ], + "description": "Tests all commands to manage services on host group.", + "protocolProfileBehavior": {} + }, + { + "name": "43-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_test;alias_test\"\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 name", + "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\": \"sg\",\n \"values\": \"sg_test;name;{{sg_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 activate", + "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\": \"sg\",\n \"values\": \"{{sg_name}};activate;{{sg_activate}}\"\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 alias", + "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\": \"sg\",\n \"values\": \"{{sg_name}};alias;{{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": [] + }, + { + "name": "Setparam comment", + "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\": \"sg\",\n \"values\": \"{{sg_name}};comment;{{sg_comment}}\"\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 group", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var sgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of service groups\"] = sgData;", + " var i = 0;", + " while (i < sgData.length) {", + " if (postman.getEnvironmentVariable(\"sg_name\") == sgData[i].name)", + " {", + " tests[\"Body contains added service group\"] = postman.getEnvironmentVariable(\"sg_name\") == sgData[i].name;", + " tests[\"Body contains added service alias\"] = postman.getEnvironmentVariable(\"sg_alias\") == sgData[i].alias;", + " break;", + " }", + " i++;", + " }", + " if (i == sgData.length)", + " tests[\"sg_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"sg\"\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": { + "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\": \"addservice\",\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": "Delservice", + "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\": \"delservice\",\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": "Setservice", + "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": "Getservice", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var serviceData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of services\"] = serviceData;", + " var i = 0;", + " while (i < serviceData.length) {", + " if (postman.getEnvironmentVariable(\"service_description\") == serviceData[i]['service description'])", + " {", + " tests[\"Body contains added host_name\"] = postman.getEnvironmentVariable(\"host_name\") == serviceData[i]['host name'];", + " tests[\"Body contains added service\"] = postman.getEnvironmentVariable(\"service_description\") == serviceData[i]['service description'];", + " break;", + " }", + " i++;", + " }", + " if (i == serviceData.length)", + " tests[\"service_description was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_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": "Addhostgroupservice", + "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\": \"addhostgroupservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{hg_name}},{{hgservice_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": "Delhostgroupservice", + "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\": \"delhostgroupservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{hg_name}},{{hgservice_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": "Sethostgroupservice", + "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\": \"sethostgroupservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_name}};{{hg_name}},{{hgservice_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": "Gethostgroupservice", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var hgserviceData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of host group services\"] = hgserviceData;", + " var i = 0;", + " while (i < hgserviceData.length) {", + " if (postman.getEnvironmentVariable(\"hgservice_description\") == hgserviceData[i]['service description'])", + " {", + " tests[\"Body contains added hg_name\"] = postman.getEnvironmentVariable(\"hg_name\") == hgserviceData[i]['hostgroup name'];", + " tests[\"Body contains added host hgservice_description\"] = postman.getEnvironmentVariable(\"hgservice_description\") == hgserviceData[i]['service description'];", + " break;", + " }", + " i++;", + " }", + " if (i == hgserviceData.length)", + " tests[\"hg_service_description was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"gethostgroupservice\",\n \"object\": \"sg\",\n \"values\": \"{{sg_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 groups.", + "protocolProfileBehavior": {} + }, + { + "name": "44-Services_Categories", + "item": [ + { + "name": "Setparam description", + "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\": \"sc\",\n \"values\": \"{{sc_name}};description;{{sc_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": "List service category", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var scData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of service categories\"] = scData;", + " var i = 0;", + " while (i < scData.length) {", + " if (postman.getEnvironmentVariable(\"sc_name\") == scData[i].name)", + " {", + " tests[\"Body contains added service category\"] = postman.getEnvironmentVariable(\"sc_name\") == scData[i].name;", + " tests[\"Body contains added description\"] = postman.getEnvironmentVariable(\"sc_description\") == scData[i].description;", + " break;", + " }", + " i++;", + " }", + " if (i == scData.length)", + " tests[\"sc_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"sc\"\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": { + "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\": \"addservice\",\n \"object\": \"sc\",\n \"values\": \"{{sc_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": "Getservice", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var serviceData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of services\"] = serviceData;", + " var i = 0;", + " while (i < serviceData.length) {", + " if (postman.getEnvironmentVariable(\"service_description\") == serviceData[i]['service description'])", + " {", + " tests[\"Body contains added host_name\"] = postman.getEnvironmentVariable(\"host_name\") == serviceData[i]['host name'];", + " tests[\"Body contains added service_description\"] = postman.getEnvironmentVariable(\"service_description\") == serviceData[i]['service description'];", + " break;", + " }", + " i++;", + " }", + " if (i == serviceData.length)", + " tests[\"service_description was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getservice\",\n \"object\": \"sc\",\n \"values\": \"{{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": "Delservice", + "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\": \"delservice\",\n \"object\": \"sc\",\n \"values\": \"{{sc_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": "Setservice", + "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\": \"sc\",\n \"values\": \"{{sc_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": "Addservicetemplate", + "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\": \"addservicetemplate\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{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": "Getservicetemplate", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var stplData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of stpl_description\"] = stplData;", + " var i = 0;", + " while (i < stplData.length) {", + " if (postman.getEnvironmentVariable(\"stpl_description\") == hgserviceData[i]['service template description']){", + " tests[\"Body contains added stpl_description\"] = postman.getEnvironmentVariable(\"stpl_description\") == stplData[i]['service template description'];", + " break;", + " }", + " i++;", + " }", + " if (i == serviceData.length)", + " tests[\"stpl_description was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"getservicetemplate\",\n \"object\": \"sc\",\n \"values\": \"{{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": "Delservicetemplate", + "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\": \"delservicetemplate\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{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": "Setservicetemplate", + "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\": \"setservicetemplate\",\n \"object\": \"sc\",\n \"values\": \"{{sc_name}};{{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": [] + } + ], + "description": "Tests all commands to manage service categories.", + "protocolProfileBehavior": {} + }, + { + "name": "50-Traps_Vendors", + "item": [ + { + "name": "Add vendor", + "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\": \"vendor\",\n \"values\": \"test_vendor;test_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 name", + "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\": \"vendor\",\n \"values\": \"test_vendor;name;{{vendor_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 alias", + "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\": \"vendor\",\n \"values\": \"{{vendor_name}};alias;{{vendor_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 description", + "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\": \"vendor\",\n \"values\": \"{{vendor_name}};description;{{vendor_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": "List vendors", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var vendorData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of vendors\"] = vendorData;", + " var i = 0;", + " while (i < vendorData.length) {", + " if (postman.getEnvironmentVariable(\"vendor_name\") == vendorData[i].name) {", + " tests[\"Body contains added vendor\"] = postman.getEnvironmentVariable(\"vendor_name\") == vendorData[i].name;", + " tests[\"Body contains added vendor_alias\"] = postman.getEnvironmentVariable(\"vendor_alias\") == vendorData[i].alias;", + " break;", + " }", + " i++;", + " }", + " if (i == vendorData.length)", + " tests[\"vendor_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"show\",\n \"object\":\"vendor\"\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": "Generatetraps", + "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\": \"generatetraps\",\n \"object\": \"vendor\",\n \"values\": \"{{vendor_name}};{{mib_path}}\"\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 vendors.", + "protocolProfileBehavior": {} + }, + { + "name": "51-Traps_SNMP", + "item": [ + { + "name": "Setparam comment", + "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\": \"trap\",\n \"values\": \"{{trap_name}};comments;{{trap_comment}}\"\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 output", + "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\": \"trap\",\n \"values\": \"{{trap_name}};output;{{trap_output}}\"\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 oid", + "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\": \"trap\",\n \"values\": \"{{trap_name}};oid;{{trap_oid}}\"\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 status", + "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\": \"trap\",\n \"values\": \"{{trap_name}};status;{{trap_status}}\"\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 vendor", + "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\": \"trap\",\n \"values\": \"{{trap_name}};vendor;{{trap_vendor}}\"\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 matching_mode", + "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\": \"trap\",\n \"values\": \"{{trap_name}};matching_mode;{{trap_matching_mode}}\"\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 reschedule_svc_enable", + "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\": \"trap\",\n \"values\": \"{{trap_name}};reschedule_svc_enable;{{trap_reschedule_svc_enable}}\"\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 execution_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\": \"trap\",\n \"values\": \"{{trap_name}};execution_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 exec_command_enable", + "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\": \"trap\",\n \"values\": \"{{trap_name}};execution_command_enable;{{trap_exec_command_enable}}\"\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 submit_result_enable", + "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\": \"trap\",\n \"values\": \"{{trap_name}};submit_result_enable;{{trap_submit_result_enable}}\"\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 traps", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var trapData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of matchings\"] = trapData;", + " var i = 0;", + " while (i < trapData.length) {", + " if (postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name) {", + " tests[\"Body contains added trap\"] = postman.getEnvironmentVariable(\"trap_name\") == trapData[i].name;", + " tests[\"Body contains added trap oid\"] = postman.getEnvironmentVariable(\"trap_oid\") == trapData[i].oid;", + " break;", + " }", + " i++;", + " }", + " if (i == trapData.length)", + " tests[\"trap_name was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"show\",\n \"object\":\"trap\"\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": "Addmatching", + "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\": \"addmatching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_name}};test_string;test_reg_exp;ok\"\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": "Get matching id", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var matchingData = jsonData.result;", + "", + "try {", + " var i = 0;", + " while (i < matchingData.length) {", + " if (\"test_string\" == matchingData[i].string) {", + " postman.setEnvironmentVariable(\"trap_matching_token\",matchingData[i].id);", + " break;", + " }", + " i++;", + " }", + "} catch (e) {}", + "", + "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\":\"getmatching\",\n \"object\":\"trap\",\n \"values\": \"{{trap_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": "Updatematching name", + "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\": \"updatematching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}};string;{{trap_string}}\"\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": "Updatematching order", + "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\": \"updatematching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}};order;{{trap_matching_order}}\"\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": "Updatematching status", + "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\": \"updatematching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}};status;{{trap_status_string}}\"\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": "Updatematching regexp", + "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\": \"updatematching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}};regexp;{{trap_reg_exp}}\"\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": "Getmatching", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var matchingData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of matchings\"] = matchingData;", + " var i = 0;", + " while (i < matchingData.length) {", + " if (postman.getEnvironmentVariable(\"trap_string\") == matchingData[i].string) {", + " tests[\"Body contains added string\"] = postman.getEnvironmentVariable(\"trap_string\") == matchingData[i].string;", + " tests[\"Body contains added regular expression\"] = postman.getEnvironmentVariable(\"trap_reg_exp\") == matchingData[i].regexp;", + " tests[\"Body contains added matching status\"] = postman.getEnvironmentVariable(\"trap_status_string\") == matchingData[i].status;", + " tests[\"Body contains added matching order\"] = postman.getEnvironmentVariable(\"trap_matching_order\") == matchingData[i].order;", + " break;", + " }", + " i++;", + " }", + " if (i == matchingData.length)", + " tests[\"trap_string was found\"] = false;", + "} catch (e) {}", + "", + "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\":\"getmatching\",\n \"object\":\"trap\",\n \"values\": \"{{trap_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": "Delmatching", + "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\": \"delmatching\",\n \"object\": \"trap\",\n \"values\": \"{{trap_matching_token}}\"\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 traps.", + "protocolProfileBehavior": {} + }, + { + "name": "60-Downtimes", + "item": [ + { + "name": "Add downtime", + "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\": \"downtime\",\n \"values\": \"downtime_test;descritpion_test\"\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 name", + "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\": \"downtime\",\n \"values\": \"downtime_test;name;{{downtime_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 description", + "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\": \"downtime\",\n \"values\": \"{{downtime_name}};description;{{downtime_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": "List downtimes", + "event": [ + { + "listen": "test", + "script": { + "id": "9dd93e49-984a-4bd8-9235-438e0335fea4", + "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\" },", + " \"name\": { \"type\": \"string\" },", + " \"description\": { \"type\": \"string\" },", + " \"activate\": { \"type\": \"string\" }", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"id \", \"name \", \"description\", \"activate\"]", + " }", + "};", + "", + "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\": \"downtime\"\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 downtimes resources", + "event": [ + { + "listen": "test", + "script": { + "id": "1e5db65d-8018-4b73-a2ec-f20ce4c66eca", + "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\" },", + " \"name\": { \"type\": \"string\" },", + " \"description\": { \"type\": \"string\" },", + " \"activate\": { \"type\": \"string\" },", + " \"hosts\": {},", + " \"host groups\": {},", + " \"services\": {},", + " \"service groups\": {}", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"id \", \"name \", \"description\", \"activate\", \"hosts\", \"host groups\", \"services\", \"service groups\"]", + " }", + "};", + "", + "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\": \"downtime\",\n \"values\" : \"{{downtime_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": "List downtimes resource", + "event": [ + { + "listen": "test", + "script": { + "id": "e1be0a8f-3d90-4111-bbfd-b90bc0be15ee", + "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\" },", + " \"name\": { \"type\": \"string\" },", + " \"description\": { \"type\": \"string\" },", + " \"activate\": { \"type\": \"string\" },", + " \"hosts\": {}", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"id \", \"name \", \"description\", \"activate\", \"hosts\", \"host groups\", \"services\", \"service groups\"]", + " }", + "};", + "", + "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\": \"downtime\",\n \"values\" : \"{{downtime_name}};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": "Addweeklyperiod", + "event": [ + { + "listen": "test", + "script": { + "id": "c5920d29-dd72-42c2-ba6d-fadf7ab06da2", + "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\" },", + " \"name\": { \"type\": \"string\" },", + " \"description\": { \"type\": \"string\" },", + " \"activate\": { \"type\": \"string\" },", + " \"hosts\": {},", + " \"host groups\": {},", + " \"services\": {},", + " \"service groups\": {}", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"id \", \"name \", \"description\", \"activate\", \"hosts\", \"host groups\", \"services\", \"service groups\"]", + " }", + "};", + "", + "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\": \"downtime\",\n \"values\" : \"{{downtime_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": "List downtimes resource", + "event": [ + { + "listen": "test", + "script": { + "id": "1a562f54-f44d-40c5-945a-40f082a82c32", + "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\" },", + " \"name\": { \"type\": \"string\" },", + " \"description\": { \"type\": \"string\" },", + " \"activate\": { \"type\": \"string\" },", + " \"hosts\": {}", + " },", + " \"additionalProperties\": false,", + " \"required \": [\"id \", \"name \", \"description\", \"activate\", \"hosts\", \"host groups\", \"services\", \"service groups\"]", + " }", + "};", + "", + "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\": \"downtime\",\n \"values\" : \"{{downtime_name}};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": "Addweeklyperiod", + "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\": \"addweeklyperiod\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{weekly_start_time}};{{weekly_end_time}};{{weekly_fixed}};{{weekly_duration}};{{weekly_day_of_week}}\"\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": "Addmonthlyperiod", + "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\": \"addmonthlyperiod\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{monthly_start_time}};{{monthly_end_time}};{{monthly_fixed}};{{monthly_duration}};{{monthly_day_of_month}}\"\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": "Addspecificperiod", + "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\": \"addspecificperiod\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{specific_start}};{{specific_end}};{{specific_fixed}};{{specific_duration}};{{specific_day_of_week}};{{specific_month_cycle}}\"\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 periods", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var downtimeData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of downtimes\"] = downtimeData;", + " var test_start_w = postman.getEnvironmentVariable(\"weekly_start_time\") + ':00';", + " var test_start_m = postman.getEnvironmentVariable(\"monthly_start_time\") + ':00';", + " var test_start_s = postman.getEnvironmentVariable(\"specific_start\") + ':00';", + " for (var i = 0; i < downtimeData.length; i++) {", + " if (test_start_w == downtimeData[i]['start time'])", + " {", + " tests[\"Body contains added weekly_start_time\"] = test_start_w == downtimeData[i]['start time'];", + " var test_end = postman.getEnvironmentVariable(\"weekly_end_time\") + ':00';", + " tests[\"Body contains added weekly_end_time\"] = test_end == downtimeData[i]['end time'];", + " tests[\"Body contains added weekly_fixed\"] = postman.getEnvironmentVariable(\"weekly_fixed\") == downtimeData[i].fixed;", + " if (downtimeData[i].fixed == \"0\")", + " tests[\"Body contains added weekly_duration\"] = postman.getEnvironmentVariable(\"weekly_duration\") == downtimeData[i].duration;", + " tests[\"Body contains added weekly_day_of_week\"] = postman.getEnvironmentVariable(\"weekly_number_days_of_week\") == downtimeData[i]['day of week'];", + " }", + " if (test_start_m == downtimeData[i]['start time'])", + " {", + " tests[\"Body contains added monthly_start_time\"] = test_start_m == downtimeData[1]['start time'];", + " var test_end = postman.getEnvironmentVariable(\"monthly_end_time\") + ':00';", + " tests[\"Body contains added monthly_end_time\"] = test_end == downtimeData[i]['end time'];", + " tests[\"Body contains added monthly_fixed\"] = postman.getEnvironmentVariable(\"monthly_fixed\") == downtimeData[i].fixed;", + " if (downtimeData[i].fixed == \"0\")", + " tests[\"Body contains added monthly_duration\"] = postman.getEnvironmentVariable(\"monthly_duration\") == downtimeData[i].duration;", + " tests[\"Body contains added monthly_day_of_month\"] = postman.getEnvironmentVariable(\"monthly_day_of_month\") == downtimeData[i]['day of month'];", + " }", + " if (test_start_s == downtimeData[i]['start time'])", + " {", + " tests[\"Body contains added specific_start_time\"] = test_start_s == downtimeData[i]['start time'];", + " var test_end = postman.getEnvironmentVariable(\"specific_end\") + ':00';", + " tests[\"Body contains added specific_end_time\"] = test_end == downtimeData[i]['end time'];", + " tests[\"Body contains added specific_fixed\"] = postman.getEnvironmentVariable(\"specific_fixed\") == downtimeData[i].fixed;", + " if (downtimeData[i].fixed == \"0\")", + " tests[\"Body contains added specific_duration\"] = postman.getEnvironmentVariable(\"specific_duration\") == downtimeData[i].duration;", + " tests[\"Body contains added specific_day_of_week\"] = postman.getEnvironmentVariable(\"specific_number_day_of_week\") == downtimeData[i]['day of week'];", + " }", + " }", + "}", + "catch (e) {}", + "", + "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\": \"listperiods\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Addhost", + "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\": \"addhost\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{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": "Delhost", + "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\": \"delhost\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{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": "Sethost", + "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\": \"sethost\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{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": "Addhostgroup", + "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\": \"addhostgroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Delhostgroup", + "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\": \"delhostgroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "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\": \"downtime\",\n \"values\": \"{{downtime_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": "Addservice", + "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\": \"addservice\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Delservice", + "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\": \"delservice\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Setservice", + "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\": \"downtime\",\n \"values\": \"{{downtime_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": "Addservicegroup", + "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\": \"addservicegroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{sg_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": "Delservicegroup", + "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\": \"delservicegroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{sg_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": "Setservicegroup", + "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\": \"setservicegroup\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_name}};{{sg_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 downtimes.", + "protocolProfileBehavior": {} + }, + { + "name": "61-Dependencies", + "item": [ + { + "name": "Add dependency", + "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\": \"dep\",\n \"values\": \"dep_test;test_description;{{dep_type}};{{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": "Setparam name", + "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\": \"dep\",\n \"values\": \"dep_test;name;{{dep_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 description", + "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\": \"dep\",\n \"values\": \"{{dep_name}};description;{{dep_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 comment", + "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\": \"dep\",\n \"values\": \"{{dep_name}};comment;{{dep_comment}}\"\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 inherits_parent", + "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\": \"dep\",\n \"values\": \"{{dep_name}};inherits_parent;{{dep_inherits_parent}}\"\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 exec_fail_criteria", + "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\": \"dep\",\n \"values\": \"{{dep_name}};execution_failure_criteria;{{dep_exec_fail_crit}}\"\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 notif_fail_criteria", + "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\": \"dep\",\n \"values\": \"{{dep_name}};notification_failure_criteria;{{dep_notif_fail_crit}}\"\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 dependencies", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var depData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of dependencies\"] = depData;", + " var i = 0;", + " while (i < depData.length) {", + " if (postman.getEnvironmentVariable(\"dep_name\") == depData[i].name)", + " {", + " tests[\"Body contains added dep_name\"] = postman.getEnvironmentVariable(\"dep_name\") == depData[i].name;", + " tests[\"Body contains added dep_description\"] = postman.getEnvironmentVariable(\"dep_description\") == depData[i].description;", + " tests[\"Body contains added dep_inherits_parents\"] = postman.getEnvironmentVariable(\"dep_inherits_parent\") == depData[i].inherits_parent;", + " tests[\"Body contains added dep_execution_failure_criteria\"] = postman.getEnvironmentVariable(\"dep_exec_fail_crit\") == depData[i].execution_failure_criteria;", + " tests[\"Body contains added dep_notification_failure_criteria\"] = postman.getEnvironmentVariable(\"dep_notif_fail_crit\") == depData[i].notification_failure_criteria;", + " break;", + " }", + " i++;", + " }", + " if (i == depData.length)", + " tests[\"dep_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"dep\"\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": "Addparent", + "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\": \"addparent\",\n \"object\": \"dep\",\n \"values\": \"{{dep_name}};{{host_name2}}\"\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": "Create host3", + "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_name3}};{{host_name3}};0.0.0.0;;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": "Addchild", + "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\": \"addchild\",\n \"object\": \"dep\",\n \"values\": \"{{dep_name}};{{host_name3}}\"\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": "Delparent", + "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\": \"delparent\",\n \"object\": \"dep\",\n \"values\": \"{{dep_name}};{{host_name2}}\"\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": "Listdep", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var depData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of dependencies\"] = depData;", + " var i = 0;", + " var nb_find = 0", + " while (i < depData.length) {", + " if (postman.getEnvironmentVariable(\"host_name\") == depData[i].parents)", + " {", + " tests[\"Body contains added a parent\"] = postman.getEnvironmentVariable(\"host_name\") == depData[i].parents;", + " nb_find += 1;", + " }", + " if (postman.getEnvironmentVariable(\"host_name3\") == depData[i].children)", + " {", + " tests[\"Body contains added a child\"] = postman.getEnvironmentVariable(\"host_name3\") == depData[i].children;", + " nb_find += 1;", + " }", + " if (nb_find == 2)", + " break;", + " i++;", + " }", + " if (i == depData.length)", + " tests[\"the child and the parent were found\"] = i < depData.length;", + "}", + "catch (e) {}", + "", + "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\": \"listdep\",\n \"object\": \"dep\",\n \"values\": \"{{dep_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": "Delchild", + "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\": \"delchild\",\n \"object\": \"dep\",\n \"values\": \"{{dep_name}};{{host_name3}}\"\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 dependencies.", + "protocolProfileBehavior": {} + }, + { + "name": "70-ACL_Groups", + "item": [ + { + "name": "Add ACL 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\": \"aclgroup\",\n \"values\": \"test_aclg;aclg_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 name", + "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\": \"aclgroup\",\n \"values\": \"test_aclg;name;{{aclg_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 alias", + "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\": \"aclgroup\",\n \"values\": \"{{aclg_name}};alias;{{aclg_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 activate", + "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\": \"aclgroup\",\n \"values\": \"{{aclg_name}};activate;{{aclg_activate}}\"\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 ACL groups", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var aclgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL groups\"] = aclgData;", + " var i = 0;", + " while (i < aclgData.length) {", + " if (postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name) {", + " tests[\"Body contains added ACL resource\"] = postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name;", + " tests[\"Body contains added aclg_alias\"] = postman.getEnvironmentVariable(\"aclg_alias\") == aclgData[i].alias;", + " tests[\"Body contains added aclg_activate\"] = postman.getEnvironmentVariable(\"aclg_activate\") == aclgData[i].activate;", + " break;", + " }", + " i++;", + " }", + " if (i == aclgData.length)", + " tests[\"aclg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"aclgroup\"\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 resource ACL", + "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\": \"aclresource\",\n \"values\": \"test_resourceacl;test_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 name", + "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\": \"aclresource\",\n \"values\": \"test_resourceacl;name;{{racl_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": "Addresource", + "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\": \"addresource\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{racl_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": "Delresource", + "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\": \"delresource\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{racl_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": "Setresource", + "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\": \"setresource\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{racl_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": "Getresource", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var raclData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL resources\"] = raclData;", + " var i = 0;", + " while (i < raclData.length) {", + " if (postman.getEnvironmentVariable(\"racl_name\") == raclData[i].name) {", + " tests[\"Body contains added ACL resource\"] = postman.getEnvironmentVariable(\"racl_name\") == raclData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == raclData.length)", + " tests[\"racl_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"getresource\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "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\": \"aclgroup\",\n \"values\": \"{{aclg_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": "Delcontact", + "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\": \"delcontact\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "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\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{contact_alias}}|{{contact_alias2}}\"\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": "Getcontact", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var contactData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contacts\"] = contactData;", + " var i = 0;", + " while (i < contactData.length) {", + " if (postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name) {", + " tests[\"Body contains added contact\"] = postman.getEnvironmentVariable(\"contact_alias\") == contactData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == contactData.length)", + " tests[\"aclg_contact_alias was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"getcontact\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "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\": \"aclgroup\",\n \"values\": \"{{aclg_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": "Delcontactgroup", + "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\": \"delcontactgroup\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "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\": \"aclgroup\",\n \"values\": \"{{aclg_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": "Getcontactgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var cgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of contact groups\"] = cgData;", + " var i = 0;", + " while (i < cgData.length) {", + " if (postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name) {", + " tests[\"Body contains added cg_name\"] = postman.getEnvironmentVariable(\"cg_name\") == cgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == cgData.length)", + " tests[\"cg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"getcontactgroup\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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 ACL Menu", + "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\": \"aclmenu\",\n \"values\": \"test_aclmenu;test_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 name", + "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\": \"aclmenu\",\n \"values\": \"test_aclmenu;name;{{aclmenu_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": "Addmenu", + "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\": \"addmenu\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{aclmenu_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": "Delmenu", + "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\": \"delmenu\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{aclmenu_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": "Setmenu", + "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\": \"setmenu\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{aclmenu_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": "Getmenu", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var aclmenuData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL menus\"] = aclmenuData;", + " var i = 0;", + " while (i < aclmenuData.length) {", + " if (postman.getEnvironmentVariable(\"aclmenu_name\") == aclmenuData[i].name) {", + " tests[\"Body contains added ACL menu\"] = postman.getEnvironmentVariable(\"aclmenu_name\") == aclmenuData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == aclmenuData.length)", + " tests[\"menu_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"getmenu\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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 ACL action", + "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\": \"aclaction\",\n \"values\": \"test_acla;acla_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 name", + "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\": \"aclaction\",\n \"values\": \"test_acla;name;{{acla_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": "Addaction", + "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\": \"addaction\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{acla_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": "Delaction", + "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\": \"delaction\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{acla_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": "Setaction", + "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\": \"setaction\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_name}};{{acla_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": "Getaction", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var aclaData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL actions\"] = aclaData;", + " var i = 0;", + " while (i < aclaData.length) {", + " if (postman.getEnvironmentVariable(\"acla_name\") == aclaData[i].name) {", + " tests[\"Body contains added ACL action\"] = postman.getEnvironmentVariable(\"acla_name\") == aclaData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == aclaData.length)", + " tests[\"acla_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"getaction\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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 ACL groups.", + "protocolProfileBehavior": {} + }, + { + "name": "71-ACL_Menus", + "item": [ + { + "name": "Setparam alias", + "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\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};alias;{{aclmenu_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 activate", + "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\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};activate;{{aclmenu_activate}}\"\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 comment", + "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\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};comment;{{aclmenu_comment}}\"\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 ACL menu", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var aclmenuData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL Menu\"] = aclmenuData;", + " var i = 0;", + " while (i < aclmenuData.length) {", + " if (postman.getEnvironmentVariable(\"aclmenu_name\") == aclmenuData[i].name) {", + " tests[\"Body contains added ACL menu\"] = postman.getEnvironmentVariable(\"aclmenu_name\") == aclmenuData[i].name;", + " tests[\"Body contains added aclmenu_alias\"] = postman.getEnvironmentVariable(\"aclmenu_alias\") == aclmenuData[i].alias;", + " tests[\"Body contains added aclmenu_comment\"] = postman.getEnvironmentVariable(\"aclmenu_comment\") == aclmenuData[i].comment;", + " tests[\"Body contains added aclmenu_activate\"] = postman.getEnvironmentVariable(\"aclmenu_activate\") == aclmenuData[i].activate;", + " break;", + " }", + " i++;", + " }", + " if (i == aclmenuData.length)", + " tests[\"aclmenu_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"aclmenu\"\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": "Get ACL Groups", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var aclgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL Menu\"] = aclgData;", + " var i = 0;", + " while (i < aclgData.length) {", + " if (postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name) {", + " tests[\"Body contains ACL menu\"] = postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i > aclgData.length)", + " tests[\"aclg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"getaclgroup\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_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": "Grantrw Home", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home\"\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": "Revoke Home", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home\"\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": "Grantrw Custom Views", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views\"\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": "Revoke Custom Views", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views\"\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": "Grantrw Edit View", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;Edit View\"\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": "Revoke Edit View", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;Edit View\"\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": "Grantrw Share View", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;Share View\"\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": "Revoke Share View", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;Share View\"\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": "Grantrw Widget Parameters", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;Widget Parameters\"\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": "Revoke Widget Parameters", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;Widget Parameters\"\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": "Grantrw Add Widget", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;add Widget\"\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": "Revoke Add Widget", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;add Widget\"\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": "Grantrw rotation", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;rotation\"\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": "Revoke rotation", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;rotation\"\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": "Grantrw delete view", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;delete view\"\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": "Revoke delete view", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;delete view\"\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": "Grantrw add view", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;add view\"\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": "Revoke add view", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;add view\"\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": "Grantrw set default", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;Home;Custom Views;set default\"\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": "Revoke set default", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;Home;Custom Views;set default\"\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": "Grantrw monitoring", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring\"\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": "Revoke monitoring", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring\"\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": "Grantrw status details", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details\"\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": "Revoke status details", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details\"\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": "Grantrw services (monitoring)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;services\"\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": "Revoke services (monitoring)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;services\"\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": "Grantrw hosts (monitoring)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;hosts\"\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": "Revoke hosts (monitoring)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;hosts\"\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": "Grantrw services grid", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;services grid\"\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": "Revoke services grid", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;services grid\"\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": "Grantrw services by 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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;services by hostgroup\"\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": "Revoke services by 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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;services by hostgroup\"\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": "Grantrw services by 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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;services by servicegroup\"\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": "Revoke services by 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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;services by servicegroup\"\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": "Grantrw hostgroups summary", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;status details;hostgroups summary\"\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": "Revoke hostgroups summary", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;status details;hostgroups summary\"\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": "Grantrw performances", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances\"\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": "Revoke performances", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances\"\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": "Grantrw graphs", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;graphs\"\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": "Revoke graphs", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;graphs\"\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": "Grantrw chart split", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;graphs;chart split\"\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": "Revoke chart split", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;graphs;chart split\"\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": "Grantrw chart periods", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;graphs;chart periods\"\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": "Revoke chart periods", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;graphs;chart periods\"\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": "Grantrw templates (perf)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;templates\"\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": "Revoke templates (perf)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;templates\"\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": "Grantrw curves", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;curves\"\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": "Revoke curves", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;curves\"\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": "Grantrw metrics", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;performances;virtual metrics\"\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": "Revoke metrics", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;performances;virtual metrics\"\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": "Grantrw event logs", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;event logs\"\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": "Revoke event logs", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;event logs\"\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": "Grantrw event logs (advanced)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;event logs;event logs\"\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": "Revoke event logs (advanced)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;event logs;event logs\"\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": "Grantrw system logs", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;event logs;system logs\"\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": "Revoke system logs", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;event logs;system logs\"\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": "Grantrw downtimes", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes\"\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": "Revoke downtimes", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;downtimes\"\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": "Grantrw downtimes (main menu)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes;downtimes\"\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": "Revoke downtimes (main menu)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;downtimes;downtimes\"\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": "Grantrw recurrent downtimes", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes;recurrent downtimes\"\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": "Grantro recurrent downtimes", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes;recurrent downtimes\"\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": "Revoke recurrent downtimes", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;downtimes;recurrent downtimes\"\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": "Grantrw comments", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;monitoring;downtimes;comments\"\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": "Revoke comments", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;monitoring;downtimes;comments\"\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": "Grantrw reporting", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting\"\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": "Revoke reporting", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting\"\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": "Grantrw dashboard", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard\"\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": "Revoke dashboard", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard\"\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": "Grantrw hosts (dashboard)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard;hosts\"\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": "Revoke hosts (dashboard)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard;hosts\"\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": "Grantrw services (dashboard)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard;services\"\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": "Revoke services (dashboard)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard;services\"\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": "Grantrw host groups (dashboard)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard;host groups\"\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": "Revoke host groups (dashboard)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard;host groups\"\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": "Grantrw service groups (dashboard)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;reporting;dashboard;service groups\"\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": "Revoke service groups (dashboard)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;reporting;dashboard;service groups\"\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": "Grantrw configuration", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration\"\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": "Revoke configuration", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration\"\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": "Grant hostsrw (config)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts\"\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": "Revoke hosts (config)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts\"\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": "Grant hostsrw (config/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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;hosts\"\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": "Grant hostsro (config/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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;hosts\"\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": "Revoke hosts (config/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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts;hosts\"\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": "Grantrw host groups (config/hosts)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;host groups\"\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": "Grantro host groups (config/hosts)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;host groups\"\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": "Revoke host groups (config/hosts)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts;host groups\"\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": "Grantrw templates (config/hosts)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;templates\"\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": "Grantro templates (config/hosts)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;templates\"\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": "Revoke templates (config/hosts)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts;templates\"\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": "Grantrw categories (config/hosts)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;categories\"\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": "Grantro categories (config/hosts)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;hosts;categories\"\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": "Revoke categories (config/hosts)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;hosts;categories\"\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": "Grantrw services (config)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services\"\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": "Revoke services (config)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services\"\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": "Grantrw services by host (config/services)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;services by 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": "Grantro services by host (config/services)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;services by 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": "Revoke services by host (config/services)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;services by 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": "Grantrw services by host group (config/services)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;services by host group\"\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": "Grantro services by host group (config/services)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;services by host group\"\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": "Revoke services by host group (config/services)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;services by host group\"\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": "Grantrw service groups (config/services)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;service groups\"\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": "Grantro service groups (config/services)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;service groups\"\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": "Revoke service groups (config/services)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;service groups\"\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": "Grantrw templates (config/services)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;templates\"\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": "Grantro templates (config/services)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;templates\"\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": "Revoke templates (config/services)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;templates\"\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": "Grantrw categories (config/services)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;categories\"\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": "Grantro categories (config/services)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;categories\"\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": "Revoke categories (config/services)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;categories\"\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": "Grantrw meta services(config/services)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;services;meta services\"\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": "Revoke meta services(config/services)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;services;meta services\"\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": "Grantrw users", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users\"\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": "Revoke users", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users\"\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": "Grantrw Contacts / Users", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contacts / users\"\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": "Grantro Contacts / Users", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contacts / users\"\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": "Revoke Contacts / Users", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users;contacts / users\"\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": "Grantrw contact templates", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contact templates\"\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": "Grantro contact templates", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contact templates\"\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": "Revoke contact templates", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users;contact templates\"\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": "Grantrw contact groups", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contact groups\"\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": "Grantro contact groups", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;contact groups\"\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": "Revoke contact groups", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users;contact groups\"\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": "Grantrw time periods", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;time periods\"\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": "Grantro time periods", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;users;time periods\"\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": "Revoke time periods", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;users;time periods\"\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": "Grantrw commands", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands\"\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": "Revoke commands", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands\"\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": "Grantrw checks", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;checks\"\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": "Grantro checks", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;checks\"\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": "Revoke checks", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;checks\"\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": "Grantrw notifications", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;notifications\"\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": "Grantro notifications", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;notifications\"\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": "Revoke notifications", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;notifications\"\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": "Grantrw discovery", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;discovery\"\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": "Grantro discovery", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;discovery\"\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": "Revoke discovery", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;discovery\"\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": "Grantrw miscellaneous", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;miscellaneous\"\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": "Grantro miscellaneous", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;miscellaneous\"\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": "Revoke miscellaneous", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;miscellaneous\"\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": "Grantrw connectors", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;connectors\"\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": "Grantro connectors", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;commands;connectors\"\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": "Revoke connectors", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;commands;connectors\"\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": "Grantrw notifications", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications\"\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": "Revoke notifications", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications\"\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": "Grantrw escalations", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;escalations\"\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": "Grantro escalations", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;escalations\"\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": "Revoke escalations", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;escalations\"\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": "Grantrw hosts (dependencies)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;hosts\"\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": "Grantro hosts (dependencies)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;hosts\"\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": "Revoke hosts (dependencies)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;hosts\"\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": "Grantrw host groups (dependencies)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;host groups\"\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": "Grantro host groups (dependencies)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;host groups\"\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": "Revoke host groups (dependencies)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;host groups\"\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": "Grantrw services(dependencies)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;services\"\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": "Grantro services(dependencies)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;services\"\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": "Revoke services(dependencies)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;services\"\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": "Grantrw service groups(dependencies)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;service groups\"\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": "Grantro service groups(dependencies)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;service groups\"\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": "Revoke service groups(dependencies)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;service groups\"\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": "Grantrw meta services (dependencies)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;meta services\"\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": "Grantro meta services (dependencies)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;notifications;meta services\"\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": "Revoke meta services (dependencies)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;notifications;meta services\"\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": "Grantrw SNMP traps (config)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps\"\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": "Revoke SNMP traps (config)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps\"\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": "Grantrw SNMP traps (SNMP)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;snmp traps\"\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": "Revoke SNMP traps (SNMP)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;snmp traps\"\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": "Grantrw manufacturer", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;manufacturer\"\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": "Revoke manufacturer", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;manufacturer\"\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": "Grantrw group (SNMP)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;group\"\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": "Revoke group (SNMP)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;group\"\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": "Grantrw mibs", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;mibs\"\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": "Revoke mibs", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;mibs\"\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": "Grantrw generate", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;SNMP traps;generate\"\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": "Revoke generate", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;SNMP traps;generate\"\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": "Grantrw knowledge base", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base\"\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": "Revoke knowledge base", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base\"\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": "Grantrw hosts (knowledge)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base;hosts\"\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": "Revoke hosts (knowledge)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base;hosts\"\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": "Grantrw services (knowledge)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base;services\"\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": "Revoke services (knowledge)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base;services\"\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": "Grantrw host templates (knowledge)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base;host templates\"\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": "Revoke host templates (knowledge)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base;host templates\"\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": "Grantrw service templates (knowledge)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;knowledge base;service templates\"\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": "Revoke service templates (knowledge)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;knowledge base;service templates\"\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": "Grantrw pollers (config)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers\"\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": "Revoke pollers (config)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers\"\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": "Grantrw export configuration", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;export configuration\"\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": "Revoke export configuration", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;export configuration\"\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": "Grantrw pollers (pollers)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;pollers\"\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": "Grantro pollers (pollers)", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;pollers\"\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": "Revoke pollers (pollers)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;pollers\"\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": "Grantrw engine configuration", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;engine configuration\"\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": "Grantro engine configuration", + "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\": \"grantro\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;engine configuration\"\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": "Revoke engine configuration", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;engine configuration\"\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": "Grantrw broker configuration", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;broker configuration\"\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": "Revoke broker configuration", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;broker configuration\"\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": "Grantrw wizard", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;broker configuration;wizard\"\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": "Revoke wizard", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;broker configuration;wizard\"\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": "Grantrw wizardajax", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;broker configuration;wizardajax\"\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": "Revoke wizardajax", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;broker configuration;wizardajax\"\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": "Grantrw resources", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;configuration;pollers;resources\"\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": "Revoke resources", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;configuration;pollers;resources\"\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": "Grantrw administration", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration\"\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": "Revoke administration", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration\"\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": "Grantrw parameters", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters\"\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": "Revoke parameters", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters\"\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": "Grantrw centreon UI", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;centreon UI\"\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": "Revoke centreon UI", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;centreon UI\"\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": "Grantrw monitoring (parameters)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;monitoring\"\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": "Revoke monitoring (parameters)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;monitoring\"\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": "Grantrw gorgone", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;gorgone\"\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": "Revoke gorgone", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;gorgone\"\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": "Grantrw my account", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;my account\"\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": "Revoke my account", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;my account\"\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": "Grantrw LDAP", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;LDAP\"\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": "Revoke LDAP", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;LDAP\"\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": "Grantrw RRDtool", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;RRDtool\"\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": "Revoke RRDtool", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;RRDtool\"\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": "Grantrw debug", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;debug\"\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": "Revoke debug", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;debug\"\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": "Grantrw knowledge base (parameters)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;knowledge base\"\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": "Revoke knowledge base (parameters)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;knowledge base\"\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": "Grantrw backup", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;backup\"\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": "Revoke backup", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;backup\"\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": "Grantrw options", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;options\"\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": "Revoke options", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;options\"\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": "Grantrw data", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;data\"\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": "Revoke data", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;data\"\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": "Grantrw images", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;parameters;images\"\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": "Revoke images", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;parameters;images\"\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": "Grantrw extensions", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;extensions\"\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": "Revoke extensions", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;extensions\"\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": "Grantrw manager", + "event": [ + { + "listen": "test", + "script": { + "id": "81a0aa8e-4490-4a4e-8233-f9c16a06fd9d", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;extensions;manager\"\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": "Revoke manager", + "event": [ + { + "listen": "test", + "script": { + "id": "d8323be9-72b3-424d-b7ea-2838ac284089", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;extensions;manager\"\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": "Grantrw ACL", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL\"\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": "Revoke ACL", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL\"\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": "Grantrw access groups", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;access groups\"\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": "Revoke access groups", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;access groups\"\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": "Grantrw menus access", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;menus access\"\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": "Revoke menus access", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;menus access\"\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": "Grantrw resources access", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;resources access\"\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": "Revoke resources access", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;resources access\"\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": "Grantrw actions access", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;actions access\"\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": "Revoke actions access", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;actions access\"\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": "Grantrw reload ACL", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;ACL;reload ACL\"\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": "Revoke reload ACL", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;ACL;reload ACL\"\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": "Grantrw logs", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;logs\"\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": "Revoke logs", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;logs\"\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": "Grantrw sessions", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;sessions\"\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": "Revoke sessions", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;sessions\"\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": "Grantrw platform status", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;platform status\"\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": "Revoke platform status", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;platform status\"\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": "Grantrw broker statistics", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;platform status;broker statistics\"\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": "Revoke broker statistics", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;platform status;broker statistics\"\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": "Grantrw engine statistics", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;platform status;engine statistics\"\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": "Revoke engine statistics", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;platform status;engine statistics\"\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": "Grantrw databases", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;platform status;databases\"\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": "Revoke databases", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;platform status;databases\"\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": "Grantrw about (admin)", + "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\": \"grantrw\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};0;administration;about\"\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": "Revoke about (admin)", + "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\": \"revoke\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_name}};1;administration;about\"\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 ACL menu.", + "protocolProfileBehavior": {} + }, + { + "name": "72-ACL_Resources", + "item": [ + { + "name": "Setparam alias", + "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\": \"aclresource\",\n \"values\": \"{{racl_name}};alias;{{racl_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 activate", + "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\": \"aclresource\",\n \"values\": \"{{racl_name}};activate;{{racl_activate}}\"\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 resource ACL", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var raclData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL resource\"] = raclData;", + " var i = 0;", + " while (i < raclData.length) {", + " if (postman.getEnvironmentVariable(\"racl_name\") == raclData[i].name) {", + " tests[\"Body contains added ACL resource\"] = postman.getEnvironmentVariable(\"racl_name\") == raclData[i].name;", + " tests[\"Body contains added racl_alias\"] = postman.getEnvironmentVariable(\"racl_alias\") == raclData[i].alias;", + " tests[\"Body contains added racl_activate\"] = postman.getEnvironmentVariable(\"racl_activate\") == raclData[i].activate;", + " break;", + " }", + " i++;", + " }", + " if (i == raclData.length)", + " tests[\"racl_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"aclresource\"\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": "Getaclgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var aclgData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL groups\"] = aclgData;", + " var i = 0;", + " while (i < aclgData.length) {", + " if (postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name) {", + " tests[\"Body contains added ACL resource\"] = postman.getEnvironmentVariable(\"aclg_name\") == aclgData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == aclgData.length)", + " tests[\"aclg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"getaclgroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "Grant_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\": \"grant_host\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "Revoke_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\": \"revoke_host\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "Grant_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\": \"grant_hostgroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "Revoke_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\": \"revoke_hostgroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "Grant_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\": \"grant_servicegroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{sg_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": "Revoke_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\": \"revoke_servicegroup\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{sg_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": "addhostexclusion", + "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\": \"addhostexclusion\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "delhostexclusion", + "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\": \"delhostexclusion\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "addfilter_instance", + "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\": \"addfilter_instance\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{instance_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": "delfilter_instance", + "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\": \"delfilter_instance\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{instance_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": "addfilter_hostcategory", + "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\": \"addfilter_hostcategory\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "delfilter_hostcategory", + "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\": \"delfilter_hostcategory\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "addfilter_servicecategory", + "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\": \"addfilter_servicecategory\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": "delfilter_servicecategory", + "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\": \"delfilter_servicecategory\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_name}};{{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": [] + } + ], + "description": "Tests all commands to manage Resource ACL.", + "protocolProfileBehavior": {} + }, + { + "name": "74-ACL_Actions", + "item": [ + { + "name": "Setparam description", + "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\": \"aclaction\",\n \"values\": \"{{acla_name}};description;{{acla_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 activate", + "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\": \"aclaction\",\n \"values\": \"{{acla_name}};activate;{{acla_activate}}\"\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 ACL actions", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var aclaData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL actions\"] = aclaData;", + " var i = 0;", + " while (i < aclaData.length) {", + " if (postman.getEnvironmentVariable(\"acla_name\") == aclaData[i].name) {", + " tests[\"Body contains added ACL action\"] = postman.getEnvironmentVariable(\"acla_name\") == aclaData[i].name;", + " tests[\"Body contains added acla_description\"] = postman.getEnvironmentVariable(\"acla_description\") == aclaData[i].description;", + " tests[\"Body contains added acla_activate\"] = postman.getEnvironmentVariable(\"acla_activate\") == aclaData[i].activate;", + " break;", + " }", + " i++;", + " }", + " if (i == aclaData.length)", + " tests[\"acla_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"aclaction\"\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": "Getaclgroup", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var aclaData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ACL actions\"] = aclaData;", + " var i = 0;", + " while (i < aclaData.length) {", + " if (postman.getEnvironmentVariable(\"aclg_name\") == aclaData[i].name) {", + " tests[\"Body contains added ACL action\"] = postman.getEnvironmentVariable(\"aclg_name\") == aclaData[i].name;", + " break;", + " }", + " i++;", + " }", + " if (i == aclaData.length)", + " tests[\"aclg_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"getaclgroup\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_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": "Grant global_event_handler", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_event_handler\"\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": "Revoke global_event_handler", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_event_handler\"\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": "Grant global_flap_detection", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_flap_detection\"\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": "Revoke global_flap_detection", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_flap_detection\"\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": "Grant global_host_checks", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_checks\"\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": "Revoke global_host_checks", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_checks\"\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": "Grant global_host_obsess", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_obsess\"\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": "Revoke global_host_obsess", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_obsess\"\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": "Grant global_host_passive_checks", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_passive_checks\"\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": "Revoke global_host_passive_checks", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_host_passive_checks\"\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": "Grant global_notifications", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_notifications\"\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": "Revoke global_notifications", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_notifications\"\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": "Grant global_perf_data", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_perf_data\"\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": "Revoke global_perf_data", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_perf_data\"\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": "Grant global_restart", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_restart\"\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": "Revoke global_restart", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_restart\"\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": "Grant global_service_checks", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_checks\"\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": "Revoke global_service_checks", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_checks\"\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": "Grant global_service_obsess", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_obsess\"\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": "Revoke global_service_obsess", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_obsess\"\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": "Grant global_service_passive_checks", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_passive_checks\"\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": "Revoke global_service_passive_checks", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_service_passive_checks\"\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": "Grant global_shutdown", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_shutdown\"\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": "Revoke global_shutdown", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};global_shutdown\"\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": "Grant host_acknowledgement", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_acknowledgement\"\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": "Revoke host_acknowledgement", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_acknowledgement\"\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": "Grant host_checks", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_checks\"\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": "Revoke host_checks", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_checks\"\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": "Grant host_checks_for_services", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_checks_for_services\"\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": "Revoke host_checks_for_services", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_checks_for_services\"\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": "Grant host_comment", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_comment\"\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": "Revoke host_comment", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_comment\"\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": "Grant host_event_handler", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_event_handler\"\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": "Revoke host_event_handler", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_event_handler\"\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": "Grant host_flap_detection", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_flap_detection\"\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": "Revoke host_flap_detection", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_flap_detection\"\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": "Grant host_notifications", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_notifications\"\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": "Revoke host_notifications", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_notifications\"\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": "Grant host_notifications_for_services", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_notifications_for_services\"\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": "Revoke host_notigications_for_services", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_notifications_for_services\"\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": "Grant host_schedule_check", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_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": "Revoke host_schedule_check", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_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": "Grant host_schedule_downtime", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_forced_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": "Revoke host_schedule_downtime", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_downtime\"\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": "Grant host_schedule_forced_check", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_forced_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": "Revoke host_schedule_forced_check", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_schedule_forced_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": "Grant host_submit_result", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_submit_result\"\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": "Revoke host_submit_result", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};host_submit_result\"\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": "Grant poller_listing", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};poller_listing\"\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": "Revoke poller_listing", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};poller_listing\"\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": "Grant poller_stats", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};poller_stats\"\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": "Revoke poller_stats", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};poller_stats\"\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": "Grant service_acknowledgement", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_acknowledgement\"\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": "Revoke service_acknowledgement", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_acknowledgement\"\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": "Grant service_checks", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_checks\"\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": "Revoke service_checks", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_checks\"\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": "Grant service_comment", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_comment\"\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": "Revoke service_comment", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_comment\"\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": "Grant service_event_handler", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_event_handler\"\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": "Revoke service_event_handler", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_event_handler\"\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": "Grant service_flap_detection", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_flap_detection\"\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": "Revoke service_flap_detection", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_flap_detection\"\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": "Grant service_notifications", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_notifications\"\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": "Revoke service_notifications", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_notifications\"\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": "Grant service_passive_checks", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_passive_checks\"\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": "Revoke service_passive_checks", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_passive_checks\"\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": "Grant service_schedule_check", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_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": "Revoke service_schedule_check", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_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": "Grant service_schedule_downtime", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_downtime\"\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": "Revoke service_schedule_downtime", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_downtime\"\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": "Grant service_schedule_forced_check", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_forced_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": "Revoke service_schedule_forced_check", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_schedule_forced_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": "Grant service_submit_result", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_submit_result\"\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": "Revoke service_submit_result", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};service_submit_result\"\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": "Grant top_counter", + "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\": \"grant\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};top_counter\"\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": "Revoke top_counter", + "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\": \"revoke\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_name}};top_counter\"\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 ACL action.", + "protocolProfileBehavior": {} + }, + { + "name": "75-ACL_Reload", + "item": [ + { + "name": "Reload", + "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\": \"reload\",\n \"object\": \"acl\"\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": "Lastreload", + "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\": \"lastreload\",\n \"object\": \"acl\"\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": "Lastreload input time", + "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\": \"lastreload\",\n \"object\": \"acl\",\n \"values\": \"lastreload_time\"\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 ACL.", + "protocolProfileBehavior": {} + }, + { + "name": "80-Administration_General_Settings", + "item": [ + { + "name": "Setparam broker", + "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\": \"settings\",\n \"values\": \"broker;{{broker_value}}\"\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 centstorage", + "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\": \"settings\",\n \"values\": \"centstorage;{{centstorage_value}}\"\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 debug_auth", + "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\": \"settings\",\n \"values\": \"debug_auth;{{enable_debug_auth}}\"\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 debug_ldap_import", + "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\": \"settings\",\n \"values\": \"debug_ldap_import;{{enable_ldap_debug}}\"\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 debug_nagios_import", + "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\": \"settings\",\n \"values\": \"debug_nagios_import;{{enable_nagios_debug}}\"\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 debug_path", + "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\": \"settings\",\n \"values\": \"debug_path;{{debug_path}}\"\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 debug_rrdtool", + "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\": \"settings\",\n \"values\": \"debug_rrdtool;{{enable_debug_rrdtool}}\"\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 enable_autologin", + "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\": \"settings\",\n \"values\": \"enable_autologin;{{enable_autologin}}\"\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 enable_gmt", + "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\": \"settings\",\n \"values\": \"enable_gmt;{{enable_gmt}}\"\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 gmt", + "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\": \"settings\",\n \"values\": \"gmt;{{gmt_value}}\"\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 interval_length", + "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\": \"settings\",\n \"values\": \"interval_length;{{interval_length}}\"\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 mailer_path_bin", + "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\": \"settings\",\n \"values\": \"mailer_path_bin;{{mailer_path_bin}}\"\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 nagios_path_img", + "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\": \"settings\",\n \"values\": \"nagios_path_img;{{nagios_path_img}}\"\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 perl_library_path", + "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\": \"settings\",\n \"values\": \"perl_library_path;{{perl_library_path}}\"\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 rrdtool_path_bin", + "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\": \"settings\",\n \"values\": \"rrdtool_path_bin;{{rrdtool_path_bin}}\"\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 snmpttconvertmib_path_bin", + "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\": \"settings\",\n \"values\": \"snmpttconvertmib_path_bin;{{snmpttconvertmib_path_bin}}\"\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 snmptt_unknowntrap_log_file", + "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\": \"settings\",\n \"values\": \"snmptt_unknowntrap_log_file;{{snmptt_unknowntrap_log_file}}\"\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 settings", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var exceptionData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of exceptions\"] = exceptionData;", + " for (var i = 0; i < exceptionData.length; i++) {", + " switch (exceptionDate[i].parameter)", + " {", + " case \"broker\":", + " tests[\"Body contains the correct setting broker\"] = postman.getEnvironmentVariable(\"broker_value\") == exceptionData[i].value;", + " break;", + " case \"debug_auth\":", + " tests[\"Body contains the correct setting debug_auth\"] = postman.getEnvironmentVariable(\"enable_debug_auth\") == exceptionData[i].value;", + " break;", + " case \"debug_ldap_import\":", + " tests[\"Body contains the correct setting debug_ldap_import\"] = postman.getEnvironmentVariable(\"enable_ldap_debug\") == exceptionData[i].value;", + " break;", + " case \"debug_nagios_import\":", + " tests[\"Body contains the correct setting debug_nagios_ldap\"] = postman.getEnvironmentVariable(\"enable_nagios_debug\") == exceptionData[i].value;", + " break;", + " case \"debug_path\":", + " tests[\"Body contains the correct setting debug_path\"] = postman.getEnvironmentVariable(\"debug_path\") == exceptionData[i].value;", + " break;", + " case \"debug_rrdtool\":", + " tests[\"Body contains the correct setting debug_rrdtool\"] = postman.getEnvironmentVariable(\"enable_debug_rrdtool\") == exceptionData[i].value;", + " break;", + " case \"enable_autologin\":", + " tests[\"Body contains the correct setting enable_authologin\"] = postman.getEnvironmentVariable(\"enable_autologin\") == exceptionData[i].value;", + " break;", + " case \"enable_logs_sync\":", + " tests[\"Body contains the correct setting enable_logs_sync\"] = postman.getEnvironmentVariable(\"enable_logs_sync\") == exceptionData[i].value;", + " break;", + " case \"enable_perfdata_sync\":", + " tests[\"Body contains the correct setting enable_logs_sync\"] = postman.getEnvironmentVariable(\"enable_logs_sync\") == exceptionData[i].value;", + " break;", + " case \"enable_perfdata_sync\":", + " tests[\"Body contains the correct setting enable_perfdata_sync\"] = postman.getEnvironmentVariable(\"enable_perfdata_sync\") == exceptionData[i].value;", + " break;", + " case \"gmt\":", + " tests[\"Body contains the correct setting gmt\"] = postman.getEnvironmentVariable(\"gmt_value\") == exceptionData[i].value;", + " break;", + " case \"interval_length\":", + " tests[\"Body contains the correct setting interval_length\"] = postman.getEnvironmentVariable(\"interval_length\") == exceptionData[i].value;", + " break;", + " case \"mailer_path_bin\":", + " tests[\"Body contains the correct setting mailer_path_bin\"] = postman.getEnvironmentVariable(\"mailer_path_bin\") == exceptionData[i].value;", + " break;", + " case \"nagios_path_img\":", + " tests[\"Body contains the correct setting nagios_path_img\"] = postman.getEnvironmentVariable(\"nagios_path_img\") == exceptionData[i].value;", + " break;", + " case \"perl_library_path\":", + " tests[\"Body contains the correct setting perl_library_path\"] = postman.getEnvironmentVariable(\"perl_library_path\") == exceptionData[i].value;", + " break;", + " case \"rrdtool_path_bin\":", + " tests[\"Body contains the correct setting rrdtool_path_bin\"] = postman.getEnvironmentVariable(\"rrdtool_path_bin\") == exceptionData[i].value;", + " break;", + " case \"snmpttconvertmib_path_bin\":", + " tests[\"Body contains the correct setting snmpttconvertmib_path_bin\"] = postman.getEnvironmentVariable(\"snmpttconvertmib_path_bin\") == exceptionData[i].value;", + " break;", + " case \"snmptt_unknowntrap_log_file\":", + " tests[\"Body contains the correct setting snmptt_unknowntrap_log_file\"] = postman.getEnvironmentVariable(\"snmptt_unknowntrap_log_file\") == exceptionData[i].value;", + " break;", + " }", + " }", + "} catch (e) {}", + "", + "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\":\"show\",\n \"object\":\"settings\"\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 settings.", + "protocolProfileBehavior": {} + }, + { + "name": "81-Administration_LDAP_Settings", + "item": [ + { + "name": "Add LDAP", + "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\": \"ldap\",\n \"values\": \"test_ldap;test_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 name", + "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\": \"ldap\",\n \"values\": \"test_ldap;name;{{ldap_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 description", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};description;{{ldap_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 enable", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};enable;{{ldap_enable}}\"\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 alias", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};alias;{{ldap_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 bind_dn", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};bind_dn;{{ldap_bind_dn}}\"\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 bind_pass", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};bind_pass;{{ldap_bind_pass}}\"\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 group_base_search", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};group_base_search;{{ldap_group_base_search}}\"\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 group_filter", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};group_filter;{{ldap_group_filter}}\"\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 group_member", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};group_member;{{ldap_group_member}}\"\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 group_name", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};group_name;{{ldap_group_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 ldap_auto_import", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_auto_import;{{ldap_auto_import}}\"\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 ldap_contact_tmpl", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_contact_tmpl;{{ctpl_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 ldap_dns_use_domain", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_dns_use_domain;{{ldap_dns_use_domain}}\"\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 ldap_search_limit", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_search_limit;{{ldap_search_limit}}\"\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 ldap_search_timeout", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_search_timeout;{{ldap_search_timeout}}\"\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 ldap_srv_dns", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_srv_dns;{{ldap_srv_dns}}\"\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 ldap_store_password", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_store_password;{{ldap_store_pwd}}\"\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 ldap_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\": \"ldap\",\n \"values\": \"{{ldap_name}};ldap_template;{{ldap_tpl}}\"\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 protocol_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\": \"ldap\",\n \"values\": \"{{ldap_name}};protocol_version;{{ldap_protocol_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": "Setparam user_base_search", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_base_search;{{ldap_user_base_search}}\"\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 user_email", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_email;{{ldap_user_email}}\"\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 user_filter", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_filter;{{ldap_user_filter}}\"\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 user_firstname", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_firstname;{{ldap_user_firstname}}\"\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 user_lastname", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_lastname;{{ldap_user_lastname}}\"\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 user_name", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_name;{{ldap_user_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 user_pager", + "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\": \"ldap\",\n \"values\": \"{{ldap_name}};user_pager;{{ldap_user_pager}}\"\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 user_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\": \"setparam\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_name}};user_group;{{ldap_user_group}}\"\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 LDAP", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var ldapData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of ldap configurations\"] = ldapData;", + " var i = 0;", + " while (i < ldapData.length) {", + " if (postman.getEnvironmentVariable(\"ldap_name\") == ldapData[i].name) {", + " tests[\"Body contains added ldap_name\"] = postman.getEnvironmentVariable(\"ldap_name\") == ldapData[i].name;", + " tests[\"Body contains added ldap_description\"] = postman.getEnvironmentVariable(\"ldap_description\") == ldapData[i].description;", + " tests[\"Body contains added ldap_enable\"] = postman.getEnvironmentVariable(\"ldap_enable\") == ldapData[i].status;", + " break;", + " }", + " i++;", + " }", + " if (i == ldapData.length)", + " tests[\"ldap_name was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"ldap\"\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": "Addserver", + "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\": \"addserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_name}};{{ldap_server_address}};{{ldap_server_port}};{{ldap_use_ssl}};{{ldap_use_tls}}\"\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": "Get server id", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var serverData = jsonData.result;", + "", + "try {", + " var i = 0;", + " while (i < serverData.length) {", + " if (postman.getEnvironmentVariable(\"ldap_server_address\") == serverData[i].address) {", + " postman.setEnvironmentVariable(\"ldap_server_id\",serverData[i].id);", + " break;", + " }", + " i++;", + " }", + " if (i == serverData.length)", + " tests[\"ldap_server_adress was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"showserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_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": "Setparamserver host_address", + "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};host_address;{{ldap_host_address}}\"\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": "Setparamserver host_port", + "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};host_port;{{ldap_host_port}}\"\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": "Setparamserver host_order", + "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};host_order;{{ldap_host_order}}\"\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": "Setparamserver use_ssl", + "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};use_ssl;{{ldap_use_ssl_changed}}\"\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": "Setparamserver use_tls", + "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\": \"setparamserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_id}};use_tls;{{ldap_use_tls_changed}}\"\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": "Showserver", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var serverData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of servers\"] = serverData;", + " var i = 0;", + " while (i < serverData.length) {", + " if (postman.getEnvironmentVariable(\"ldap_host_address\") == serverData[i].address) {", + " tests[\"Body contains added server\"] = postman.getEnvironmentVariable(\"ldap_host_address\") == serverData[i].address;", + " tests[\"Body contains added server_port\"] = postman.getEnvironmentVariable(\"ldap_host_port\") == serverData[i].port;", + " tests[\"Body contains added server_use_ssl\"] = postman.getEnvironmentVariable(\"ldap_use_ssl_changed\") == serverData[i].ssl;", + " tests[\"Body contains added server_use_tls\"] = postman.getEnvironmentVariable(\"ldap_use_tls_changed\") == serverData[i].tls;", + " tests[\"Body contains added server_use_tls\"] = postman.getEnvironmentVariable(\"ldap_host_order\") == serverData[i].order;", + " break;", + " }", + " i++;", + " }", + " if (i == serverData.length)", + " tests[\"ldap_server_address was found\"] = false;", + "} catch (e) {}", + "", + "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\": \"showserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_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": "Delserver", + "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\": \"delserver\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_server_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": [] + } + ], + "description": "Tests all commands to manage LDAP.", + "protocolProfileBehavior": {} + }, + { + "name": "90-Engine_CFG", + "item": [ + { + "name": "Add engine_CFG", + "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\": \"enginecfg\",\n \"values\": \"{{engine_nagios_config}};{{instance_name}};{{engine_comment}}\"\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 name", + "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\": \"enginecfg\",\n \"values\": \"{{engine_nagios_config}};nagios_name;{{engine_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 instance", + "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\": \"enginecfg\",\n \"values\": \"{{engine_name}};instance;{{instance_name2}}\"\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 broker_module", + "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\": \"enginecfg\",\n \"values\": \"{{engine_name}};broker_module;{{instance_broker_module}}\"\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 activate", + "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\": \"enginecfg\",\n \"values\": \"{{engine_name}};nagios_activate;{{instance_activate}}\"\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 engine_CFG", + "event": [ + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var jsonData = JSON.parse(responseBody);", + "var engineData = jsonData.result;", + "", + "try {", + " tests[\"Body contains list of downtimes\"] = engineData;", + " var i = 0;", + " while (i < engineData.length) {", + " if (postman.getEnvironmentVariable(\"engine_name\") == engineData[i]['nagios name']){", + " tests[\"Body contains added engine_name\"] = postman.getEnvironmentVariable(\"engine_name\") == engineData[i]['nagios name'];", + " tests[\"Body contains added instance_name2\"] = postman.getEnvironmentVariable(\"instance_name2\") == engineData[i].instance;", + " tests[\"Body contains added engine_comment\"] = postman.getEnvironmentVariable(\"engine_comment\") == engineData[i]['nagios comment'];", + " break;", + " }", + " i++;", + " }", + " if (i == engineData.length)", + " tests[\"engine_name was found\"] = false;", + "}", + "catch (e) {}", + "", + "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\": \"show\",\n \"object\": \"enginecfg\"\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": "Addbrokermodule", + "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\": \"addbrokermodule\",\n \"object\": \"enginecfg\",\n \"values\": \"{{engine_name}};{{instance_broker_module2}}\"\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 ACL.", + "protocolProfileBehavior": {} + }, + { + "name": "99-Delete", + "item": [ + { + "name": "Del ACL action", + "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\": \"del\",\n \"object\": \"aclaction\",\n \"values\": \"{{acla_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": "Del ACL 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\": \"del\",\n \"object\": \"aclgroup\",\n \"values\": \"{{aclg_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": "Del ACL Menu", + "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\": \"del\",\n \"object\": \"aclmenu\",\n \"values\": \"{{aclmenu_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": "Del resource ACL", + "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\": \"del\",\n \"object\": \"aclresource\",\n \"values\": \"{{racl_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": "Del 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\": \"del\",\n \"object\": \"cmd\",\n \"values\": \"{{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": "Del 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\": \"del\",\n \"object\": \"cg\",\n \"values\": \"{{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": "Del ctpl", + "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\": \"del\",\n \"object\": \"contacttpl\",\n \"values\": \"{{ctpl_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": "Del ctpl2", + "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\": \"del\",\n \"object\": \"contacttpl\",\n \"values\": \"{{ctpl_alias2}}\"\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": "Del 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\": \"del\",\n \"object\": \"contact\",\n \"values\": \"{{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": "Del contact2", + "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\": \"del\",\n \"object\": \"contact\",\n \"values\": \"{{contact_alias2}}\"\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": "Del dependencies", + "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\": \"del\",\n \"object\": \"dep\",\n \"values\": \"{{dep_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": "Del downtime", + "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\": \"del\",\n \"object\": \"downtime\",\n \"values\": \"{{downtime_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": "Del engine_CFG", + "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\": \"del\",\n \"object\": \"enginecfg\",\n \"values\": \"{{engine_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": "Del 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\": \"del\",\n \"object\": \"hc\",\n \"values\": \"{{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": "Del hgservice", + "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\": \"del\",\n \"object\": \"hgservice\",\n \"values\": \"{{hg_name}};{{hgservice_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": "Del host 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\": \"del\",\n \"object\": \"hg\",\n \"values\": \"{{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": "Del host group2", + "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\": \"del\",\n \"object\": \"hg\",\n \"values\": \"{{hg_name2}}\"\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": "Del resource CFG", + "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\": \"del\",\n \"object\": \"resourcecfg\",\n \"values\": \"{{resourcecfg_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": [] + }, + { + "name": "Del Instance", + "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\": \"del\",\n \"object\": \"instance\",\n \"values\": \"{{instance_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": "Del Instance2", + "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\": \"del\",\n \"object\": \"instance\",\n \"values\": \"{{instance_name2}}\"\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": "Del 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\": \"del\",\n \"object\": \"service\",\n \"values\": \"{{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": "Del host3", + "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\": \"del\",\n \"object\": \"host\",\n \"values\": \"{{host_name3}}\"\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": "Del htpl2", + "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\": \"del\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name2}}\"\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": "Del htpl3", + "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\": \"del\",\n \"object\": \"htpl\",\n \"values\": \"{{htpl_name3}}\"\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": "Del LDAP", + "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\": \"del\",\n \"object\": \"ldap\",\n \"values\": \"{{ldap_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": "Del 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\": \"del\",\n \"object\": \"sg\",\n \"values\": \"{{sg_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": "Del 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\": \"del\",\n \"object\": \"stpl\",\n \"values\": \"{{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": "Del service template2", + "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\": \"del\",\n \"object\": \"stpl\",\n \"values\": \"{{stpl_description2}}\"\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": "Del 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\": \"del\",\n \"object\": \"sc\",\n \"values\": \"{{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": "Del 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\": \"del\",\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": "Del htpl", + "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\": \"del\",\n \"object\": \"htpl\",\n \"values\": \"{{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": "Del 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\": \"del\",\n \"object\": \"tp\",\n \"values\": \"{{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": "Del trap", + "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\": \"del\",\n \"object\": \"trap\",\n \"values\": \"{{trap_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": "Del vendor", + "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\": \"del\",\n \"object\": \"vendor\",\n \"values\": \"{{vendor_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": "Delinput ipv4", + "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\": \"delinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv4_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": [] + }, + { + "name": "Delinput ipv6", + "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\": \"delinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_ipv6_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": [] + }, + { + "name": "Delinput file", + "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\": \"delinput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{input_file_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": [] + }, + { + "name": "Dellogger file", + "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\": \"dellogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_file_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": [] + }, + { + "name": "Dellogger standard", + "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\": \"dellogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_standard_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": [] + }, + { + "name": "Dellogger syslog", + "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\": \"dellogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_syslog_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": [] + }, + { + "name": "Dellogger monitoring", + "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\": \"dellogger\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{logger_monitoring_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": [] + }, + { + "name": "Deloutput ipv4", + "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv4_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": [] + }, + { + "name": "Deloutput ipv6", + "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_ipv6_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": [] + }, + { + "name": "Deloutput file", + "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_file_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": [] + }, + { + "name": "Deloutput rrd", + "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_rrd_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": [] + }, + { + "name": "Deloutput storage", + "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_storage_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": [] + }, + { + "name": "Deloutput sql", + "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\": \"deloutput\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_name}};{{output_sql_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": [] + }, + { + "name": "Del broker", + "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\": \"del\",\n \"object\": \"centbrokercfg\",\n \"values\": \"{{broker_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": "Del host2", + "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\": \"del\",\n \"object\": \"host\",\n \"values\": \"{{host_name2}}\"\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": [] + } + ], + "protocolProfileBehavior": {} + } + ], + "protocolProfileBehavior": {} } \ No newline at end of file diff --git a/tests/rest_api/rest_api.postman_environment.json b/tests/rest_api/rest_api.postman_environment.json index 190ca9f13f5..ead90b63dc7 100644 --- a/tests/rest_api/rest_api.postman_environment.json +++ b/tests/rest_api/rest_api.postman_environment.json @@ -1930,7 +1930,7 @@ }, { "enabled": true, - "key": "instance_ssh_port", + "key": "instance_gorgone_port", "value": "23", "type": "text" }, diff --git a/tmpl/install/debian/centcore.default b/tmpl/install/debian/centcore.default deleted file mode 100644 index d6aa71e94ea..00000000000 --- a/tmpl/install/debian/centcore.default +++ /dev/null @@ -1,9 +0,0 @@ -# Configuration for /etc/init.d/centcore - -# If run centcore at startup default: NO -RUN_AT_STARTUP="NO" - -# Centreon user default: nagios -CENTREON_USER="@CENTREON_USER@" - -OPTIONS="--logfile=@CENTREON_LOG@/centcore.log --severity=error --config=@CENTREON_ETC@/conf.pm" \ No newline at end of file diff --git a/tmpl/install/debian/centcore.init.d b/tmpl/install/debian/centcore.init.d deleted file mode 100644 index 0ad8e902343..00000000000 --- a/tmpl/install/debian/centcore.init.d +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: centcore -# Required-Start: $local_fs $network -# Required-Stop: $local_fs $network -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Should-Start: mysql -# Should-Stop: -# Short-Description: Start daemon centcore at boot -# Description: Enable service provided CentCore : Manage pollers -### END INIT INFO - -PKGNAME=centcore -DESC="Centcore" -DAEMON=@CENTCORE_BINDIR@/centcore -PIDFILE=@CENTREON_RUNDIR@/centcore.pid -FOLDER=/var/run/centreon/ -if [ ! -d "$FOLDER" ]; then # Control will enter here if $DIRECTORY doesn't exist. - mkdir $FOLDER -fi - -if [ ! -x "${DAEMON}" ]; then - echo "The program ${DAEMON} does not exists or is not executable" - exit 3 -fi - -# Include the default user configuration if exists -[ -r /etc/default/${PKGNAME} ] && . /etc/default/${PKGNAME} - -# Load the VERBOSE setting and other rcS variables -[ -f /etc/init/vars.sh ] && . /etc/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -if [ -z "${RUN_AT_STARTUP}" -o "${RUN_AT_STARTUP}" != "YES" ]; then - log_warning_msg "Not starting $PKGNAME, edit /etc/default/$PKGNAME to start it." - exit 0 -fi - -if [ -z "${CENTREON_USER}" ]; then - log_warning_msg "Not starting $PKGNAME, CENTREON_USER not set in /etc/default/$PKGNAME." - exit 0 -fi - -do_start() -{ - start-stop-daemon --start --background --quiet --pidfile ${PIDFILE} --exec ${DAEMON} \ - --chuid ${CENTREON_USER} --user ${CENTREON_USER} --test -- $OPTIONS - [ "$?" = "0" ] || return 1 - start-stop-daemon --start --background --quiet --pidfile ${PIDFILE} --exec ${DAEMON} \ - --make-pidfile --chuid ${CENTREON_USER} --user ${CENTREON_USER} -- $OPTIONS - [ "$?" = "0" ] || return 2 - return 0 -} - -do_stop() -{ - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --user ${CENTREON_USER} --pidfile ${PIDFILE} - [ "$?" = "2" ] && return 2 - rm -rf ${PIDFILE} - [ "$?" = 0 ] && return 0 || return 1 -} - -case "$1" in - start) - [ "${VERBOSE}" != "no" ] && log_daemon_msg "Starting ${DESC}" "${PKGNAME}" - do_start - case "$?" in - 0|1) [ "${VERBOSE}" != "no" ] && log_end_msg 0 ;; - 2) [ "${VERBOSE}" != "no" ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "${VERBOSE}" != no ] && log_daemon_msg "Stopping ${DESC}" "${PKGNAME}" - do_stop - case "$?" in - 0|1) [ "${VERBOSE}" != no ] && log_end_msg 0 ;; - 2) [ "${VERBOSE}" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc ${DAEMON} ${PKGNAME} -p ${PIDFILE} - ;; - restart|force-reload) - [ "${VERBOSE}" != no ] && log_daemon_msg "Restarting ${DESC}" "${PKGNAME}" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; - *) log_end_msg 1 ;; - esac - ;; - *) log_end_msg 1 ;; - esac - ;; - *) - echo "Usage: ${SCRIPTNAME} (start|stop|status|restart|force-reload)" >&2 - exit 3 -esac diff --git a/tmpl/install/redhat/centcore.init.d b/tmpl/install/redhat/centcore.init.d deleted file mode 100644 index 4a986287092..00000000000 --- a/tmpl/install/redhat/centcore.init.d +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin/env bash -# -# crond Start/Stop the centcore daemon. -# -# chkconfig: 2345 70 30 -# description: centcore is a Centreon program that manage pollers -# processname: centcore -# config: @CENTREON_ETC@ -# pidfile: ${RunDir}/centcore.pid - -# Source function library. -. /etc/init.d/functions - -binary=@CENTCORE_BINDIR@/centcore -servicename=centcore -user=@CENTREON_USER@ -timeout=60 -start_timeout=5 - -pidfile=@CENTREON_RUNDIR@/centcore.pid - -FOLDER=/var/run/centreon/ -if [ ! -d "$FOLDER" ]; then # Control will enter here if $DIRECTORY doesn't exist. - mkdir $FOLDER -fi - -[ -e /etc/sysconfig/$servicename ] && . /etc/sysconfig/$servicename - -# Check if we can find the binary. -if [ ! -x $binary ]; then - echo -n $"Starting $servicename."; - failure $"Executable file $binary not found. Exiting." - echo - exit 2 -fi - -start() { - echo -n $"Starting $servicename: " - if [ -e "$pidfile" ] && [ -n "$(cat $pidfile)" ] && [ -e "/proc/`cat $pidfile`" ]; then - echo -n $"cannot start $servicename: $servicename is already running."; - failure $"cannot start $servicename: $servicename already running."; - echo - return 1 - fi - if [ ! -e "$pidfile" ] ; then - pid=$(pidofproc $binary) - if [ -n "$pid" ] ; then - echo -n $"cannot start $servicename: $servicename is already running."; - failure $"cannot start $servicename: $servicename already running."; - echo - return 1 - fi - fi - - if [ "$(id -u -n)" = "$user" ] ; then - daemon ''$binary' '$OPTIONS' > /dev/null 2>&1 &' - else - daemon --user $user ''$binary' '$OPTIONS' > /dev/null 2>&1 &' - fi - - i=0 - while : ; do - if [ "$i" -gt $start_timeout ] ; then - failure $"service not launched" - echo - return 1 - fi - pid=$(pidofproc $binary) - if [ -n "$pid" ] ; then - echo $pid > $pidfile - break - fi - sleep 1 - i=$(($i + 1)) - done - success $"service launched" - echo - return 0 -} - -stop() { - echo -n $"Stopping $servicename: " - if [ ! -e "$pidfile" ] || [ -z "$(cat $pidfile)" ] ; then - killproc -d $timeout "$binary" - else - killproc -p "$pidfile" -d $timeout "$binary" - fi - RETVAL=$? - echo - return $RETVAL -} - -rhstatus() { - if [ ! -e "$pidfile" ] || [ -z "$(cat $pidfile)" ] ; then - status "$binary" - else - status -p "$pidfile" "$binary" - fi -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $servicename daemon configuration: " - if [ ! -e "$pidfile" ] || [ -z "$(cat $pidfile)" ] ; then - killproc "$binary" -HUP - else - killproc -p "$pidfile" "$binary" -HUP - fi - RETVAL=$? - echo - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - reload) - reload - ;; - status) - rhstatus - ;; - condrestart) - [ -f /var/lock/subsys/centcore ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" - exit 1 -esac - diff --git a/tmpl/install/redhat/centcore.sysconfig b/tmpl/install/redhat/centcore.sysconfig deleted file mode 100644 index 7d87a49e11d..00000000000 --- a/tmpl/install/redhat/centcore.sysconfig +++ /dev/null @@ -1,2 +0,0 @@ -# centcore command line options -OPTIONS="--logfile=@CENTREON_LOG@/centcore.log --severity=error --config=@CENTREON_ETC@/conf.pm" \ No newline at end of file diff --git a/tmpl/install/redhat/centcore.systemd b/tmpl/install/redhat/centcore.systemd deleted file mode 100644 index 87c9b22d69f..00000000000 --- a/tmpl/install/redhat/centcore.systemd +++ /dev/null @@ -1,33 +0,0 @@ -## -## Copyright 2015,2019 Centreon -## -## Licensed under the Apache License, Version 2.0 (the "License"); -## you may not use this file except in compliance with the License. -## You may obtain a copy of the License at -## -## http://www.apache.org/licenses/LICENSE-2.0 -## -## Unless required by applicable law or agreed to in writing, software -## distributed under the License is distributed on an "AS IS" BASIS, -## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -## See the License for the specific language governing permissions and -## limitations under the License. -## -## For more information : contact@centreon.com -## - -[Unit] -Description=Centreon Core -PartOf=centreon.service -After=centreon.service -ReloadPropagatedFrom=centreon.service - -[Service] -EnvironmentFile=/etc/sysconfig/centcore -ExecStart=@CENTCORE_BINDIR@/centcore $OPTIONS -ExecReload=/bin/kill -HUP $MAINPID -Type=simple -User=centreon - -[Install] -WantedBy=centreon.service diff --git a/tmpl/install/suse/centcore.init.d b/tmpl/install/suse/centcore.init.d deleted file mode 100644 index 326059aeb92..00000000000 --- a/tmpl/install/suse/centcore.init.d +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/env bash -### BEGIN INIT INFO -# Provides: centcore -# Required-Start: $syslog $remote_fs -# Should-Start: centcore -# Required-Stop: $syslog $remote_fs -# Should-Stop: centcore -# Default-Start: 2 3 5 -# Default-Stop: 0 1 6 -# Description: centcore is a Centreon program that manage pollers -# Short-Description: centcore is a Centreon program that manage pollers -### END INIT INFO - -# Source function library. -. /lib/lsb/init-functions - -binary=@CENTCORE_BINDIR@/centcore -servicename=$(basename "$0") -user=@CENTREON_USER@ -timeout=60 -start_timeout=5 -logfile=@CENTREON_LOG@/centcore.log -config=@CENTREON_ETC@/conf.pm - -FOLDER=/var/run/centreon/ -if [ ! -d "$FOLDER" ]; then # Control will enter here if $DIRECTORY doesn't exist. - mkdir $FOLDER -fi - -# Add optionnal option for centcore daemon -opt_daemon="" -if [ -n "${logfile}" ]; then - opt_daemon=" --logfile=${logfile}" -fi - -if [ -n "${config}" ]; then - opt_daemon="${opt_daemon} --config=${config}" -fi - -pidfile=@CENTREON_RUNDIR@/centcore.pid - -# Check if we can find the binary. -if [ ! -x $binary ]; then - echo -n $"Starting $servicename."; - log_failure_msg $"Executable file $binary not found. Exiting." - echo - exit 2 -fi - -start() { - echo -n $"Starting $servicename: " - if [ -e "$pidfile" ] && [ -n "$(cat $pidfile)" ] && [ -e "/proc/`cat $pidfile`" ]; then - echo -n $"cannot start $servicename: $servicename is already running."; - log_failure_msg $"cannot start $servicename: $servicename already running."; - echo - return 1 - fi - if [ ! -e "$pidfile" ] ; then - pid=$(pidofproc $binary) - if [ -n "$pid" ] ; then - echo -n $"cannot start $servicename: $servicename is already running."; - log_failure_msg $"cannot start $servicename: $servicename already running."; - echo - return 1 - fi - fi - - if [ "$(id -u -n)" = "$user" ] ; then - startproc $binary ${opt_daemon} - else - startproc -u $user $binary ${opt_daemon} - fi - - i=0 - while : ; do - if [ "$i" -gt $start_timeout ] ; then - log_failure_msg $"service not launched" - echo - return 1 - fi - pid=$(pidofproc $binary) - if [ -n "$pid" ] ; then - echo $pid > $pidfile - break - fi - sleep 1 - i=$(($i + 1)) - done - log_success_msg $"service launched" - echo - return 0 -} - -stop() { - echo -n $"Stopping $servicename: " - if [ ! -e "$pidfile" ] || [ -z "$(cat $pidfile)" ] ; then - killproc -t$timeout "$binary" - else - killproc -p "$pidfile" -t$timeout "$binary" - fi - RETVAL=$? - echo - return $RETVAL -} - -rhstatus() { - if [ ! -e "$pidfile" ] || [ -z "$(cat $pidfile)" ] ; then - echo -n "centcore is " - checkproc "$binary" - rc_status -v - else - echo -n "centcore is " - checkproc -p "$pidfile" "$binary" - rc_status -v - fi -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading $servicename daemon configuration: " - if [ ! -e "$pidfile" ] || [ -z "$(cat $pidfile)" ] ; then - killproc "$binary" -HUP - else - killproc -p "$pidfile" "$binary" -HUP - fi - RETVAL=$? - echo - return $RETVAL -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - reload) - reload - ;; - status) - rhstatus - ;; - condrestart) - [ -f /var/lock/subsys/centcore ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" - exit 1 -esac - diff --git a/tmpl/install/suse/centcore.sysconfig b/tmpl/install/suse/centcore.sysconfig deleted file mode 100644 index 7d87a49e11d..00000000000 --- a/tmpl/install/suse/centcore.sysconfig +++ /dev/null @@ -1,2 +0,0 @@ -# centcore command line options -OPTIONS="--logfile=@CENTREON_LOG@/centcore.log --severity=error --config=@CENTREON_ETC@/conf.pm" \ No newline at end of file diff --git a/varinstall/vars b/varinstall/vars index 180eb454f7e..26223cabff7 100644 --- a/varinstall/vars +++ b/varinstall/vars @@ -1,4 +1,5 @@ -#!/bin/sh +#!/bin/bash + # -*-Shell-script-*- # install_vars # This file contain reconfigured variables used in install scripts @@ -39,7 +40,6 @@ DEFAULT_CENTREON_VARLIB="/var/lib/centreon" DEFAULT_CENTSTORAGE_RRD="/var/lib/centreon" DEFAULT_CENTPLUGINS_TMP="/var/lib/centreon/centplugins" DEFAULT_CENTSTORAGE_BINDIR="bin" -DEFAULT_CENTCORE_BINDIR="bin" DEFAULT_SNMP_ETC="/etc/snmp" DEFAULT_SNMPTT_BINDIR="/usr/share/centreon/bin/" DEFAULT_CENTPLUGINSTRAPS_BINDIR="/usr/share/centreon/bin" @@ -56,3 +56,9 @@ DEFAULT_MONITORINGENGINE_INIT_SCRIPT="centengine" DEFAULT_BROKER_USER="centreon-broker" DEFAULT_BROKER_ETC="/etc/centreon-broker" DEFAULT_PHP_FPM_SERVICE="fpm-php" +CENTREON_SPOOL_SSH=`eval echo "~$CENTREON_USER"` + +DEFAULT_GORGONE_VARLIB="/var/lib/centreon-gorgone" +DEFAULT_GORGONE_CONFIG="/etc/centreon-gorgone" +DEFAULT_GORGONE_USER="centreon-gorgone" +DEFAULT_GORGONE_GROUP="centreon-gorgone" \ No newline at end of file diff --git a/www/class/centreon-clapi/centreonInstance.class.php b/www/class/centreon-clapi/centreonInstance.class.php index d5d912b1cf0..3df2b5d8df3 100644 --- a/www/class/centreon-clapi/centreonInstance.class.php +++ b/www/class/centreon-clapi/centreonInstance.class.php @@ -49,9 +49,11 @@ class CentreonInstance extends CentreonObject { const ORDER_UNIQUENAME = 0; const ORDER_ADDRESS = 1; - const ORDER_SSH_PORT = 2; + const ORDER_GORGONE_PROTOCOL = 2; + const ORDER_GORGONE_PORT = 3; + const GORGONE_COMMUNICATION = array('ZMQ' => '1', 'SSH' => '2'); - /** + /* * Constructor * * @return void @@ -63,7 +65,8 @@ public function __construct(\Pimple\Container $dependencyInjector) $this->params = [ 'localhost' => '0', 'ns_activate' => '1', - 'ssh_port' => '22', + 'gorgone_communication_type' => self::GORGONE_COMMUNICATION['ZMQ'], + 'gorgone_port' => '5556', 'nagios_bin' => '/usr/sbin/centengine', 'nagiostats_bin' => '/usr/bin/centenginestats', 'engine_start_command' => 'service centengine start', @@ -75,7 +78,7 @@ public function __construct(\Pimple\Container $dependencyInjector) 'centreonbroker_module_path' => '/usr/share/centreon/lib/centreon-broker', 'centreonconnector_path' => '/usr/lib64/centreon-connector' ]; - $this->insertParams = array('name', 'ns_ip_address', 'ssh_port'); + $this->insertParams = array('name', 'ns_ip_address', 'gorgone_communication_type', 'gorgone_port'); $this->exportExcludedParams = array_merge( $this->insertParams, array( @@ -103,10 +106,18 @@ public function initInsertParameters($parameters) $addParams = array(); $addParams[$this->object->getUniqueLabelField()] = $params[self::ORDER_UNIQUENAME]; $addParams['ns_ip_address'] = $params[self::ORDER_ADDRESS]; - if (!is_numeric($params[self::ORDER_SSH_PORT])) { + + if (isset(self::GORGONE_COMMUNICATION[strtoupper($params[self::ORDER_GORGONE_PROTOCOL])])) { + $addParams['gorgone_communication_type'] = + self::GORGONE_COMMUNICATION[strtoupper($params[self::ORDER_GORGONE_PROTOCOL])]; + } else { + throw new CentreonClapiException('Incorrect connection protocol'); + } + if (!is_numeric($params[self::ORDER_GORGONE_PORT])) { throw new CentreonClapiException('Incorrect port parameters'); } - $addParams['ssh_port'] = $params[self::ORDER_SSH_PORT]; + $addParams['gorgone_port'] = $params[self::ORDER_GORGONE_PORT]; + if ($addParams['ns_ip_address'] == "127.0.0.1" || strtolower($addParams['ns_ip_address']) == "localhost") { $this->params['localhost'] = '1'; } @@ -127,6 +138,9 @@ public function initUpdateParameters($parameters) } $objectId = $this->getObjectId($params[self::ORDER_UNIQUENAME]); + if ($params[1] === 'gorgone_communication_type') { + $params[2] = self::GORGONE_COMMUNICATION[$params[2]]; + } if ($objectId != 0) { $updateParams = array($params[1] => $params[2]); $updateParams['objectId'] = $objectId; @@ -139,6 +153,7 @@ public function initUpdateParameters($parameters) /** * @param null $parameters * @param array $filters + * @throws \Exception */ public function show($parameters = null, $filters = array()) { @@ -161,12 +176,14 @@ public function show($parameters = null, $filters = array()) 'broker_reload_command', 'nagios_bin', 'nagiostats_bin', - 'ssh_port' + 'gorgone_communication_type', + 'gorgone_port' ]; $paramString = str_replace("_", " ", implode($this->delim, $params)); $paramString = str_replace("ns ", "", $paramString); $paramString = str_replace("nagios ", "", $paramString); $paramString = str_replace("nagiostats", "stats", $paramString); + $paramString = str_replace("communication type", "protocol", $paramString); echo $paramString . "\n"; $elements = $this->object->getList($params, -1, 0, null, null, $filters); foreach ($elements as $tab) { @@ -175,6 +192,9 @@ public function show($parameters = null, $filters = array()) } else { $tab["ns_status"] = '-'; } + $tab["gorgone_communication_type"] = + array_search($tab["gorgone_communication_type"], self::GORGONE_COMMUNICATION); + echo implode($this->delim, $tab) . "\n"; } } diff --git a/www/class/centreon-clapi/centreonSettings.class.php b/www/class/centreon-clapi/centreonSettings.class.php index 52eb9495c7f..db6b0c1f898 100644 --- a/www/class/centreon-clapi/centreonSettings.class.php +++ b/www/class/centreon-clapi/centreonSettings.class.php @@ -64,8 +64,6 @@ public function __construct(\Pimple\Container $dependencyInjector) $this->authorizedOptions = array( 'broker' => array('values' => array('ndo', 'broker')), 'centstorage' => array('values' => array('0', '1')), - 'enable_perfdata_sync' => array('values' => array('0', '1')), - 'enable_logs_sync' => array('values' => array('0', '1')), 'gmt' => array( 'format' => self::ISSTRING, 'getterFormatMethod' => 'getTimezonenameFromId', diff --git a/www/class/config-generate-remote/Generate.php b/www/class/config-generate-remote/Generate.php index 348c701388b..516eb91adba 100644 --- a/www/class/config-generate-remote/Generate.php +++ b/www/class/config-generate-remote/Generate.php @@ -213,7 +213,7 @@ public function configRemoteServerFromId(int $remoteServerId, $username = 'unkno $this->getPollerFromId($remoteServerId); $this->currentPoller['localhost'] = 1; $this->currentPoller['remote_id'] = 'NULL'; - $this->currentPoller['remote_server_centcore_ssh_proxy'] = 0; + $this->currentPoller['remote_server_use_as_proxy'] = 0; $this->configPoller($username); Relations\NagiosServer::getInstance($this->dependencyInjector)->add($this->currentPoller, $remoteServerId); @@ -221,7 +221,7 @@ public function configRemoteServerFromId(int $remoteServerId, $username = 'unkno foreach ($pollers as $poller) { $poller['localhost'] = 0; $poller['remote_id'] = 'NULL'; - $poller['remote_server_centcore_ssh_proxy'] = 0; + $poller['remote_server_use_as_proxy'] = 0; $this->currentPoller = $poller; $this->configPoller($username); Relations\NagiosServer::getInstance($this->dependencyInjector)->add($poller, $poller['id']); diff --git a/www/class/config-generate-remote/Relations/NagiosServer.php b/www/class/config-generate-remote/Relations/NagiosServer.php index 2d9357ef19c..101d54d720a 100644 --- a/www/class/config-generate-remote/Relations/NagiosServer.php +++ b/www/class/config-generate-remote/Relations/NagiosServer.php @@ -46,15 +46,15 @@ class NagiosServer extends AbstractObject 'centreonbroker_cfg_path', 'centreonbroker_module_path', 'centreonconnector_path', - 'ssh_port', - 'ssh_private_key', + 'gorgone_communication_type', + 'gorgone_port', 'init_script_centreontrapd', 'snmp_trapd_path_conf', 'engine_name', 'engine_version', 'centreonbroker_logs_path', 'remote_id', - 'remote_server_centcore_ssh_proxy' + 'remote_server_use_as_proxy' ]; /** diff --git a/www/class/config-generate/abstract/object.class.php b/www/class/config-generate/abstract/object.class.php index 36f5d45da1d..55c078cff7e 100644 --- a/www/class/config-generate/abstract/object.class.php +++ b/www/class/config-generate/abstract/object.class.php @@ -109,7 +109,7 @@ private function setHeader() "# #\n" . "# GENERATED BY CENTREON #\n" . "# #\n" . - "# Developped by : #\n" . + "# Developed by : #\n" . "# - Julien Mathis #\n" . "# - Romain Le Merlus #\n" . "# #\n" . diff --git a/www/include/Administration/brokerPerformance/brokerPerformance.php b/www/include/Administration/brokerPerformance/brokerPerformance.php index 0fae569cb05..31186d5bc8b 100644 --- a/www/include/Administration/brokerPerformance/brokerPerformance.php +++ b/www/include/Administration/brokerPerformance/brokerPerformance.php @@ -180,7 +180,7 @@ function parseStatsFile($statfile) } /* Create list of loaded modules */ - if (preg_match('/module \/.*\/\d+\-(.*)\.so/', $key, $matches)) { + if (preg_match('/module\s*\/.*\/\d+\-(.*)\.so/', $key, $matches)) { $result['modules'][$matches[1]] = $json_stats[$key]['state']; } } @@ -265,7 +265,7 @@ function parseStatsFile($statfile) while ($row = $stmt->fetch()) { $statsfile = $row['cache_directory'] . '/' . $row['config_name'] . '-stats.json'; if ($defaultPoller != $selectedPoller) { - $statsfile = _CENTREON_VARLIB_ . '/broker-stats/broker-stats-' . $selectedPoller . '.dat'; + $statsfile = _CENTREON_CACHEDIR_ . '/broker-stats/' . $selectedPoller . '/' . $row['config_name'] . '.json'; } if (!file_exists($statsfile) || !is_readable($statsfile)) { $perf_err[$row['config_name']] = _('Cannot open statistics file'); diff --git a/www/include/Administration/parameters/DB-Func.php b/www/include/Administration/parameters/DB-Func.php index f5eebaaaa3f..3f131a75473 100644 --- a/www/include/Administration/parameters/DB-Func.php +++ b/www/include/Administration/parameters/DB-Func.php @@ -281,27 +281,50 @@ function updateNagiosConfigData($gopt_id = null) $centreon->initOptGen($pearDB); } -function updateCentcoreConfigData($db, $form, $centreon) +function updateGorgoneConfigData($db, $form, $centreon) { $ret = $form->getSubmitValues(); + updateOption($db, "enable_broker_stats", isset($ret["enable_broker_stats"]) && $ret['enable_broker_stats'] ? 1 : 0); updateOption( $db, - "enable_perfdata_sync", - isset($ret["enable_perfdata_sync"]) && $ret['enable_perfdata_sync'] ? 1 : 0 + 'gorgone_cmd_timeout', + $ret['gorgone_cmd_timeout'] ?? 0 + ); + updateOption( + $db, + 'gorgone_illegal_characters', + $ret['gorgone_illegal_characters'] ?? '' + ); + //API + updateOption( + $db, + 'gorgone_api_address', + $ret['gorgone_api_address'] ?? '127.0.0.1' + ); + updateOption( + $db, + 'gorgone_api_port', + $ret['gorgone_api_port'] ?? '8085' + ); + updateOption( + $db, + 'gorgone_api_username', + $ret['gorgone_api_username'] ?? '' + ); + updateOption( + $db, + 'gorgone_api_password', + $ret['gorgone_api_password'] ?? '' ); - updateOption($db, "enable_logs_sync", isset($ret["enable_logs_sync"]) && $ret['enable_logs_sync'] ? 1 : 0); - updateOption($db, "enable_broker_stats", isset($ret["enable_broker_stats"]) && $ret['enable_broker_stats'] ? 1 : 0); updateOption( $db, - "centcore_cmd_timeout", - isset($ret["centcore_cmd_timeout"]) && $ret['centcore_cmd_timeout'] ? $ret['centcore_cmd_timeout'] : 0 + 'gorgone_api_ssl', + $ret['gorgone_api_ssl'] ?? '0' ); updateOption( $db, - "centcore_illegal_characters", - isset($ret["centcore_illegal_characters"]) && $ret['centcore_illegal_characters'] - ? $ret['centcore_illegal_characters'] - : "" + 'gorgone_api_allow_self_signed', + $ret['gorgone_api_allow_self_signed'] ?? '1' ); $centreon->initOptGen($db); } @@ -372,7 +395,7 @@ function updateDebugConfigData($gopt_id = null) updateOption($pearDB, "debug_rrdtool", isset($ret["debug_rrdtool"]) && $ret['debug_rrdtool'] ? 1 : 0); updateOption($pearDB, "debug_ldap_import", isset($ret["debug_ldap_import"]) && $ret['debug_ldap_import'] ? 1 : 0); updateOption($pearDB, "debug_sql", isset($ret["debug_sql"]) && $ret['debug_sql'] ? 1 : 0); - updateOption($pearDB, "debug_centcore", isset($ret["debug_centcore"]) && $ret['debug_centcore'] ? 1 : 0); + updateOption($pearDB, "debug_gorgone", isset($ret["debug_gorgone"]) && $ret['debug_gorgone'] ? 1 : 0); updateOption($pearDB, "debug_centstorage", isset($ret["debug_centstorage"]) && $ret['debug_centstorage'] ? 1 : 0); updateOption( $pearDB, diff --git a/www/include/Administration/parameters/api/api.php b/www/include/Administration/parameters/api/api.php index 5bdacf4a2bf..0484dd5a0be 100644 --- a/www/include/Administration/parameters/api/api.php +++ b/www/include/Administration/parameters/api/api.php @@ -57,7 +57,7 @@ * Centcore Options */ $form->addElement('checkbox', 'enable_broker_stats', _("Enable Broker Statistics Collection")); -$form->addElement('text', 'centcore_cmd_timeout', _("Timeout value for Centcore commands"), $attrsText2); +$form->addElement('text', 'gorgone_cmd_timeout', _("Timeout value for Gorgone commands"), $attrsText2); $attrContacts = array( 'datasourceOrigin' => 'ajax', diff --git a/www/include/Administration/parameters/api/help.php b/www/include/Administration/parameters/api/help.php index 0a495ad5fea..fe2605b9a4e 100644 --- a/www/include/Administration/parameters/api/help.php +++ b/www/include/Administration/parameters/api/help.php @@ -2,20 +2,11 @@ $help = array(); /** - * Centcore Settings + * Centreon Gorgone Settings */ -$help['tip_enable_perfdata_sync'] = dgettext( +$help['tip_gorgone_cmd_timeout'] = dgettext( 'help', - 'Enable Perfdata synchronisation between poller and Central Server operated by Centcore' -); -$help['tip_enable_logs_sync'] = dgettext( - 'help', - 'Enable Monitoring Engine Logs synchronisation between poller and Central Server operated by Centcore' -); -$help['tip_centcore_cmd_timeout'] = dgettext( - 'help', - "Timeout value in seconds. Used for freeing Centcore when it's stuck because" - . " of blocking pipe files or SSH connections." + "Timeout value in seconds. Used to make actions calls timeout." ); $help['tip_enable_broker_stats'] = dgettext( 'help', diff --git a/www/include/Administration/parameters/centcore/centcore.ihtml b/www/include/Administration/parameters/centcore/centcore.ihtml deleted file mode 100644 index 92335b32d0b..00000000000 --- a/www/include/Administration/parameters/centcore/centcore.ihtml +++ /dev/null @@ -1,33 +0,0 @@ -{$form.javascript} -{$colorJS} -
- - - - - - - - - - - - - -
-

| {t}Centcore properties{/t}

-
-

{t}Centcore Options{/t}

-
 {$form.enable_broker_stats.label}{$form.enable_broker_stats.html}
 {$form.centcore_cmd_timeout.label}{$form.centcore_cmd_timeout.html} {t}seconds{/t}
-  {$form.centcore_illegal_characters.label} - - {$form.centcore_illegal_characters.html} -
- {if !$valid} -

{$form.submitC.html}   {$form.reset.html}

- {else} -

{$form.change.html}

- {/if} -{$form.hidden} -
-{$helptext} diff --git a/www/include/Administration/parameters/centcore/help.php b/www/include/Administration/parameters/centcore/help.php deleted file mode 100644 index 19e0b985b4a..00000000000 --- a/www/include/Administration/parameters/centcore/help.php +++ /dev/null @@ -1,29 +0,0 @@ - Broker statistics." -); -$help['tip_centcore_illegal_characters'] = dgettext( - 'help', - "Illegal characters in external commands. Those characters will be removed before being interpreted by Centcore." -); diff --git a/www/include/Administration/parameters/debug/form.ihtml b/www/include/Administration/parameters/debug/form.ihtml index bda6125aada..57d6fb0b3bf 100644 --- a/www/include/Administration/parameters/debug/form.ihtml +++ b/www/include/Administration/parameters/debug/form.ihtml @@ -18,7 +18,7 @@ {$form.debug_rrdtool.label}{$form.debug_rrdtool.html} {$form.debug_ldap_import.label}{$form.debug_ldap_import.html} {$form.debug_sql.label}{$form.debug_sql.html} - {$form.debug_centcore.label}{$form.debug_centcore.html} + {$form.debug_gorgone.label}{$form.debug_gorgone.html} {$form.debug_centreontrapd.label}{$form.debug_centreontrapd.html} {$form.required._note} diff --git a/www/include/Administration/parameters/debug/form.php b/www/include/Administration/parameters/debug/form.php index bc6f279a8bb..bfd7f421f2b 100644 --- a/www/include/Administration/parameters/debug/form.php +++ b/www/include/Administration/parameters/debug/form.php @@ -59,7 +59,7 @@ $form->addElement('checkbox', 'debug_nagios_import', _("Monitoring Engine Import debug")); $form->addElement('checkbox', 'debug_rrdtool', _("RRDTool debug")); $form->addElement('checkbox', 'debug_ldap_import', _("LDAP User Import debug")); -$form->addElement('checkbox', 'debug_centcore', _("Centcore Engine debug")); +$form->addElement('checkbox', 'debug_gorgone', _("Centreon Gorgone debug")); $form->addElement('checkbox', 'debug_centreontrapd', _("Centreontrapd debug")); $form->applyFilter('__ALL__', 'myTrim'); diff --git a/www/include/Administration/parameters/gorgone/gorgone.ihtml b/www/include/Administration/parameters/gorgone/gorgone.ihtml new file mode 100644 index 00000000000..f539440d3ee --- /dev/null +++ b/www/include/Administration/parameters/gorgone/gorgone.ihtml @@ -0,0 +1,75 @@ +{$form.javascript} +{$colorJS} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

| {t}Gorgone properties{/t}

+
+

{t}Common Options{/t}

+
 {$form.enable_broker_stats.label}{$form.enable_broker_stats.html}
 {$form.gorgone_cmd_timeout.label}{$form.gorgone_cmd_timeout.html} {t}seconds{/t}
+  {$form.gorgone_illegal_characters.label} + + {$form.gorgone_illegal_characters.html} +
+

{t}API Options{/t}

+
+  {$form.gorgone_api_address.label} + {$form.gorgone_api_address.html}
+  {$form.gorgone_api_port.label} + {$form.gorgone_api_port.html}
+  {$form.gorgone_api_username.label} + {$form.gorgone_api_username.html}
+  {$form.gorgone_api_password.label} + {$form.gorgone_api_password.html}
+  {$form.gorgone_api_ssl.label} + {$form.gorgone_api_ssl.html}
+ + {$form.gorgone_api_allow_self_signed.label} + {$form.gorgone_api_allow_self_signed.html}
+ {if !$valid} +

{$form.submitC.html}   {$form.reset.html}

+ {else} +

{$form.change.html}

+ {/if} +{$form.hidden} +
+{$helptext} diff --git a/www/include/Administration/parameters/centcore/centcore.php b/www/include/Administration/parameters/gorgone/gorgone.php similarity index 73% rename from www/include/Administration/parameters/centcore/centcore.php rename to www/include/Administration/parameters/gorgone/gorgone.php index b69cf5dcc76..fefe0565157 100644 --- a/www/include/Administration/parameters/centcore/centcore.php +++ b/www/include/Administration/parameters/gorgone/gorgone.php @@ -47,19 +47,36 @@ $attrsText2 = array("size" => "5"); $attrsAdvSelect = null; -/* - * Form begin - */ +// Form begin $form = new HTML_QuickFormCustom('Form', 'post', "?p=" . $p); -$form->addElement('header', 'title', _("Modify Centcore options")); - -/* - * Centcore Options - */ -$form->addElement('checkbox', 'enable_broker_stats', _("Enable Broker Statistics Collection")); -$form->addElement('text', 'centcore_cmd_timeout', _("Timeout value for Centcore commands"), $attrsText2); -$form->addRule('centcore_cmd_timeout', _('Must be a number'), 'numeric'); -$form->addElement('text', 'centcore_illegal_characters', _("Illegal characters for Centcore commands"), $attrsText); +$form->addElement('header', 'title', _("Modify Gorgone options")); + +// Gorgone Options +$form->addElement('checkbox', 'enable_broker_stats', _("Enable Broker statistics collection")); +$form->addElement('text', 'gorgone_cmd_timeout', _("Timeout value for Gorgone commands"), $attrsText2); +$form->addRule('gorgone_cmd_timeout', _('Must be a number'), 'numeric'); +$form->addElement('text', 'gorgone_illegal_characters', _("Illegal characters for Gorgone commands"), $attrsText); + +// API +$form->addElement('text', 'gorgone_api_address', _("IP address or hostname"), $attrsText); +$form->addElement('text', 'gorgone_api_port', _("Port"), $attrsText2); +$form->addRule('gorgone_api_port', _('Must be a number'), 'numeric'); +$form->addElement('text', 'gorgone_api_username', _("Username"), $attrsText); +$form->addElement('password', 'gorgone_api_password', _("Password"), $attrsText); +$form->addElement( + 'checkbox', + 'gorgone_api_ssl', + _("Use SSL/TLS"), + null +); +$form->setDefaults(1); +$form->addElement( + 'checkbox', + 'gorgone_api_allow_self_signed', + _("Allow self signed certificate"), + null +); +$form->setDefaults(1); $form->addElement('hidden', 'gopt_id'); $redirect = $form->addElement('hidden', 'o'); @@ -71,7 +88,7 @@ * Smarty template Init */ $tpl = new Smarty(); -$tpl = initSmartyTpl($path . "/centcore", $tpl); +$tpl = initSmartyTpl($path . "/gorgone", $tpl); $form->setDefaults($gopt); @@ -88,10 +105,8 @@ $valid = false; if ($form->validate()) { - /* - * Update in DB - */ - updateCentcoreConfigData($pearDB, $form, $oreon); + //Update in DB + updateGorgoneConfigData($pearDB, $form, $oreon); $o = null; $valid = true; @@ -105,7 +120,7 @@ "button", "change", _("Modify"), - array("onClick" => "javascript:window.location.href='?p=" . $p . "&o=centcore'", 'class' => 'btc bt_info') + array("onClick" => "javascript:window.location.href='?p=" . $p . "&o=gorgone'", 'class' => 'btc bt_info') ); /* @@ -117,8 +132,6 @@ $form->accept($renderer); $tpl->assign('form', $renderer->toArray()); $tpl->assign('o', $o); -$tpl->assign("centcore_properties", _("Centcore properties")); -$tpl->assign("centcore_options", _("Centcore Options")); $tpl->assign('valid', $valid); -$tpl->display("centcore.ihtml"); +$tpl->display("gorgone.ihtml"); diff --git a/www/include/Administration/parameters/gorgone/help.php b/www/include/Administration/parameters/gorgone/help.php new file mode 100644 index 00000000000..723bad090b3 --- /dev/null +++ b/www/include/Administration/parameters/gorgone/help.php @@ -0,0 +1,70 @@ + Broker statistics.' +); +$help['tip_gorgone_illegal_characters'] = dgettext( + 'help', + 'Illegal characters in external commands. Those characters will be removed ' . + 'before being processed by Centreon Gorgone.' +); +$help['tip_gorgone_api_address'] = dgettext( + 'help', + 'IP Address or hostname to communicate with Gorgone API. Should remain default value ' . + '(Default: "127.0.0.1").' +); +$help['tip_gorgone_api_port'] = dgettext( + 'help', + 'Port on which Gorgone API is listening. It must match Gorgone httpserver module definition. ' . + 'Should remain default value (Default: "8085").' +); +$help['tip_gorgone_api_username'] = dgettext( + 'help', + 'Username used to connect to Gorgone API. It must match Gorgone httpserver module definition ' . + '(Default: none).' +); +$help['tip_gorgone_api_password'] = dgettext( + 'help', + 'Password used to connect to Gorgone API. It must match Gorgone httpserver module definition ' . + '(Default: none).' +); +$help['tip_gorgone_api_ssl'] = dgettext( + 'help', + 'Define if SSL/TLS must be used to connect to API. It must match Gorgone httpserver module definition ' . + '(Default: no).' +); +$help['tip_gorgone_api_allow_self_signed'] = dgettext( + 'help', + 'Define if connection to Gorgone API can be done even if a self signed certificat is used ' . + '(Default: yes).' +); diff --git a/www/include/Administration/parameters/centcore/index.html b/www/include/Administration/parameters/gorgone/index.html similarity index 100% rename from www/include/Administration/parameters/centcore/index.html rename to www/include/Administration/parameters/gorgone/index.html diff --git a/www/include/Administration/parameters/parameters.php b/www/include/Administration/parameters/parameters.php index 6ed8dea0c66..06f9b9daa24 100644 --- a/www/include/Administration/parameters/parameters.php +++ b/www/include/Administration/parameters/parameters.php @@ -86,8 +86,8 @@ case "storage": require_once $path . "centstorage/form.php" ; break; - case "centcore": - require_once $path . 'centcore/centcore.php'; + case "gorgone": + require_once $path . 'gorgone/gorgone.php'; break; case "knowledgeBase": require_once $path . 'knowledgeBase/formKnowledgeBase.php'; diff --git a/www/include/configuration/configServers/DB-Func.php b/www/include/configuration/configServers/DB-Func.php index 7dc36e61855..7fa493a2b01 100644 --- a/www/include/configuration/configServers/DB-Func.php +++ b/www/include/configuration/configServers/DB-Func.php @@ -1,7 +1,8 @@ query($query); - $notAvailableSuffixes = array(); + $notAvailableSuffixes = []; while ($result = $results->fetch()) { $suffix = (int)$result['suffix']; @@ -101,12 +106,14 @@ function getAvailableSuffixIds( * Check if Master Remote is selected to use additional Remote Server * * @param array $values the values of Remote Servers selectboxes + * * @return false only if additional Remote Server selectbox is not empty and Master selectbox is empty */ function testAdditionalRemoteServer(array $values) { # If remote_additional_id select2 is not empty - if (isset($values[0]) + if ( + isset($values[0]) && is_array($values[0]) && count($values[0]) >= 1 ) { @@ -125,6 +132,7 @@ function testAdditionalRemoteServer(array $values) * Check if the name already exist in database * * @param string $name Name to check + * * @return bool Return true if the name does not exist in database */ function testExistence($name = null): bool @@ -153,10 +161,11 @@ function testExistence($name = null): bool /** * Enable a server * - * @global CentreonDB $pearDB DB connector - * @global Centreon $centreon - * @param int $id Id of the server + * @param int $id Id of the server + * * @throws Exception + * @global CentreonDB $pearDB DB connector + * @global Centreon $centreon */ function enableServerInDB(int $id): void { @@ -177,7 +186,7 @@ function enableServerInDB(int $id): void "UPDATE `cfg_nagios` SET `nagios_activate` = '0' WHERE `nagios_server_id` = " . $id ); $pearDB->query( - "UPDATE cfg_nagios SET nagios_activate = '1' WHERE nagios_id = " . (int) $idEngine['idEngine'] + "UPDATE cfg_nagios SET nagios_activate = '1' WHERE nagios_id = " . (int)$idEngine['idEngine'] ); } } @@ -185,10 +194,11 @@ function enableServerInDB(int $id): void /** * Disable a server * - * @global CentreonDB $pearDB DB connector - * @global Centreon $centreon - * @param int $id Id of the server + * @param int $id Id of the server + * * @throws Exception + * @global CentreonDB $pearDB DB connector + * @global Centreon $centreon */ function disableServerInDB(int $id): void { @@ -214,9 +224,10 @@ function disableServerInDB(int $id): void /** * Delete a server * - * @param array $serverIds + * @param array $serverIds + * * @global CentreonDB $pearDB DB connector - * @global Centreon $centreon + * @global Centreon $centreon */ function deleteServerInDB(array $serverIds): void { @@ -267,7 +278,8 @@ function deleteServerInDB(array $serverIds): void /** * Delete Centreon Broker configurations * - * @param int $id The Id poller + * @param int $id The Id poller + * * @global CentreonDB $pearDB DB connector */ function deleteCentreonBrokerByPollerId(int $id) @@ -282,10 +294,11 @@ function deleteCentreonBrokerByPollerId(int $id) /** * Duplicate server * - * @param array $server List of server id to duplicate - * @param array $nbrDup Number of duplications per server id - * @global CentreonDB $pearDB DB connector + * @param array $server List of server id to duplicate + * @param array $nbrDup Number of duplications per server id + * * @throws Exception + * @global CentreonDB $pearDB DB connector */ function duplicateServer(array $server, array $nbrDup): void { @@ -295,7 +308,7 @@ function duplicateServer(array $server, array $nbrDup): void foreach (array_keys($server) as $serverId) { $result = $pearDB->query( - 'SELECT * FROM `nagios_server` WHERE id = ' . (int) $serverId . ' LIMIT 1' + 'SELECT * FROM `nagios_server` WHERE id = ' . (int)$serverId . ' LIMIT 1' ); $rowServer = $result->fetch(); $rowServer["id"] = null; @@ -303,7 +316,7 @@ function duplicateServer(array $server, array $nbrDup): void $rowServer["is_default"] = '0'; $rowServer["localhost"] = '0'; $result->closeCursor(); - + if (!isset($rowServer['name'])) { continue; } @@ -376,12 +389,13 @@ function duplicateServer(array $server, array $nbrDup): void /** * Insert additionnal Remote Servers relation * - * @global CentreonDB $pearDB DB connector - * @param int $id Id of the server - * @param array $remotes Id of the additionnal Remote Servers - * @throws Exception + * @param int $id Id of the server + * @param array $remotes Id of the additionnal Remote Servers * * @return void + * @throws Exception + * + * @global CentreonDB $pearDB DB connector */ function additionnalRemoteServersByPollerId(int $id, array $remotes = null): void { @@ -405,6 +419,7 @@ function additionnalRemoteServersByPollerId(int $id, array $remotes = null): voi * Insert a new server * * @param array $data Data of the new server + * * @return int Id of the new server */ function insertServerInDB(array $data): int @@ -425,106 +440,190 @@ function insertServerInDB(array $data): int $srvObj->insertBrokerDefaultDirectives($iIdNagios, 'ui'); } addUserRessource($id); + return $id; } /** * Create a server in database * - * @param array $data Data of the new server - * @global CentreonDB $pearDB DB connector - * @global Centreon $centreon + * @param array $data Data of the new server + * * @return int Id of the new server + * @global Centreon $centreon + * @global CentreonDB $pearDB DB connector */ function insertServer(array $data): int { global $pearDB, $centreon; - $rq = "INSERT INTO `nagios_server` (`name` , `localhost`, `ns_ip_address`, `ssh_port`, `nagios_bin`, " . - "`nagiostats_bin`, " . + $retValue = []; + $rq = "INSERT INTO `nagios_server` (`name` , `localhost`, `ns_ip_address`, `gorgone_communication_type`, " . + "`gorgone_port`, `nagios_bin`, `nagiostats_bin`, " . "`engine_start_command`, `engine_stop_command`, `engine_restart_command`, `engine_reload_command`, " . "`init_script_centreontrapd`, `snmp_trapd_path_conf`, " . "`nagios_perfdata` , `broker_reload_command`, " . "`centreonbroker_cfg_path`, `centreonbroker_module_path`, `centreonconnector_path`, " . - "`ssh_private_key`, `is_default`, `ns_activate`, `centreonbroker_logs_path`, `remote_id`, " . - "`remote_server_centcore_ssh_proxy`) "; + "`is_default`, `ns_activate`, `centreonbroker_logs_path`, `remote_id`, `remote_server_use_as_proxy`) "; $rq .= "VALUES ("; - isset($data["name"]) && $data["name"] != null - ? $rq .= "'" . htmlentities(trim($data["name"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["localhost"]["localhost"]) && $data["localhost"]["localhost"] != null - ? $rq .= "'" . htmlentities($data["localhost"]["localhost"], ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["ns_ip_address"]) && $data["ns_ip_address"] != null - ? $rq .= "'" . htmlentities(trim($data["ns_ip_address"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["ssh_port"]) && $data["ssh_port"] != null - ? $rq .= "'" . htmlentities(trim($data["ssh_port"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "'22', "; - isset($data["nagios_bin"]) && $data["nagios_bin"] != null - ? $rq .= "'" . htmlentities(trim($data["nagios_bin"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["nagiostats_bin"]) && $data["nagiostats_bin"] != null - ? $rq .= "'" . htmlentities(trim($data["nagiostats_bin"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["engine_start_command"]) && $data["engine_start_command"] != null - ? $rq .= "'" . htmlentities(trim($data["engine_start_command"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["engine_stop_command"]) && $data["engine_stop_command"] != null - ? $rq .= "'" . htmlentities(trim($data["engine_stop_command"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["engine_restart_command"]) && $data["engine_restart_command"] != null - ? $rq .= "'" . htmlentities(trim($data["engine_restart_command"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["engine_reload_command"]) && $data["engine_reload_command"] != null - ? $rq .= "'" . htmlentities(trim($data["engine_reload_command"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["init_script_centreontrapd"]) && $data["init_script_centreontrapd"] != null - ? $rq .= "'" . htmlentities(trim($data["init_script_centreontrapd"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["snmp_trapd_path_conf"]) && $data["snmp_trapd_path_conf"] != null - ? $rq .= "'" . htmlentities(trim($data["snmp_trapd_path_conf"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["nagios_perfdata"]) && $data["nagios_perfdata"] != null - ? $rq .= "'" . htmlentities(trim($data["nagios_perfdata"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["broker_reload_command"]) && $data["broker_reload_command"] != null - ? $rq .= "'" . htmlentities(trim($data["broker_reload_command"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["centreonbroker_cfg_path"]) && $data["centreonbroker_cfg_path"] != null - ? $rq .= "'" . htmlentities(trim($data["centreonbroker_cfg_path"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["centreonbroker_module_path"]) && $data["centreonbroker_module_path"] != null - ? $rq .= "'" . htmlentities(trim($data["centreonbroker_module_path"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["centreonconnector_path"]) && $data["centreonconnector_path"] != null - ? $rq .= "'" . htmlentities(trim($data["centreonconnector_path"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["ssh_private_key"]) && $data["ssh_private_key"] != null - ? $rq .= "'" . htmlentities(trim($data["ssh_private_key"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["is_default"]["is_default"]) && $data["is_default"]["is_default"] != null - ? $rq .= "'" . htmlentities(trim($data["is_default"]["is_default"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL, "; - isset($data["ns_activate"]["ns_activate"]) && $data["ns_activate"]["ns_activate"] != 2 - ? $rq .= "'" . $data["ns_activate"]["ns_activate"] . "', " - : $rq .= "NULL, "; - isset($data["centreonbroker_logs_path"]) && $data["centreonbroker_logs_path"] != null - ? $rq .= "'" . htmlentities(trim($data["centreonbroker_logs_path"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "NULL,"; - isset($data["remote_id"]) && $data["remote_id"] != null - ? $rq .= "'" . htmlentities(trim($data["remote_id"]), ENT_QUOTES, "UTF-8") . "' " - : $rq .= "NULL, "; - isset($data["remote_server_centcore_ssh_proxy"]["remote_server_centcore_ssh_proxy"]) - && $data["remote_server_centcore_ssh_proxy"]["remote_server_centcore_ssh_proxy"] != null - ? $rq .= "'" . htmlentities( - $data["remote_server_centcore_ssh_proxy"]["remote_server_centcore_ssh_proxy"], - ENT_QUOTES, - "UTF-8" - ) . "' " : $rq .= "NULL"; + + if (isset($data["name"]) && $data["name"] != null) { + $rq .= ':name, '; + $retValue[':name'] = htmlentities(trim($data["name"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["localhost"]["localhost"]) && $data["localhost"]["localhost"] != null) { + $rq .= ':localhost, '; + $retValue[':localhost'] = htmlentities($data["localhost"]["localhost"], ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["ns_ip_address"]) && $data["ns_ip_address"] != null) { + $rq .= ':ns_ip_address, '; + $retValue[':ns_ip_address'] = htmlentities(trim($data["ns_ip_address"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if ( + isset($data["gorgone_communication_type"]['gorgone_communication_type']) + && $data["gorgone_communication_type"]['gorgone_communication_type'] != null + ) { + $rq .= ':gorgone_communication_type, '; + $retValue[':gorgone_communication_type'] = + htmlentities(trim($data["gorgone_communication_type"]['gorgone_communication_type']), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "'1', "; + } + if (isset($data["gorgone_port"]) && $data["gorgone_port"] != null) { + $rq .= ':gorgone_port, '; + $retValue[':gorgone_port'] = (int)$data["gorgone_port"]; + } else { + $rq .= "5556, "; + } + if (isset($data["nagios_bin"]) && $data["nagios_bin"] != null) { + $rq .= ':nagios_bin, '; + $retValue[':nagios_bin'] = htmlentities(trim($data["nagios_bin"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["nagiostats_bin"]) && $data["nagiostats_bin"] != null) { + $rq .= ':nagiostats_bin, '; + $retValue[':nagiostats_bin'] = htmlentities(trim($data["nagiostats_bin"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["engine_start_command"]) && $data["engine_start_command"] != null) { + $rq .= ':engine_start_command, '; + $retValue[':engine_start_command'] = htmlentities(trim($data["engine_start_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["engine_stop_command"]) && $data["engine_stop_command"] != null) { + $rq .= ':engine_stop_command, '; + $retValue[':engine_stop_command'] = htmlentities(trim($data["engine_stop_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["engine_restart_command"]) && $data["engine_restart_command"] != null) { + $rq .= ':engine_restart_command, '; + $retValue[':engine_restart_command'] = htmlentities(trim($data["engine_restart_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["engine_reload_command"]) && $data["engine_reload_command"] != null) { + $rq .= ':engine_reload_command, '; + $retValue[':engine_reload_command'] = htmlentities(trim($data["engine_reload_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["init_script_centreontrapd"]) && $data["init_script_centreontrapd"] != null) { + $rq .= ':init_script_centreontrapd, '; + $retValue[':init_script_centreontrapd'] = + htmlentities(trim($data["init_script_centreontrapd"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["snmp_trapd_path_conf"]) && $data["snmp_trapd_path_conf"] != null) { + $rq .= ':snmp_trapd_path_conf, '; + $retValue[':snmp_trapd_path_conf'] = htmlentities(trim($data["snmp_trapd_path_conf"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["nagios_perfdata"]) && $data["nagios_perfdata"] != null) { + $rq .= ':nagios_perfdata, '; + $retValue[':nagios_perfdata'] = htmlentities(trim($data["nagios_perfdata"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["broker_reload_command"]) && $data["broker_reload_command"] != null) { + $rq .= ':broker_reload_command, '; + $retValue[':broker_reload_command'] = htmlentities(trim($data["broker_reload_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["centreonbroker_cfg_path"]) && $data["centreonbroker_cfg_path"] != null) { + $rq .= ':centreonbroker_cfg_path, '; + $retValue[':centreonbroker_cfg_path'] = + htmlentities(trim($data["centreonbroker_cfg_path"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["centreonbroker_module_path"]) && $data["centreonbroker_module_path"] != null) { + $rq .= ':centreonbroker_module_path, '; + $retValue[':centreonbroker_module_path'] = + htmlentities(trim($data["centreonbroker_module_path"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["centreonconnector_path"]) && $data["centreonconnector_path"] != null) { + $rq .= ':centreonconnector_path, '; + $retValue[':centreonconnector_path'] = htmlentities(trim($data["centreonconnector_path"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["is_default"]["is_default"]) && $data["is_default"]["is_default"] != null) { + $rq .= ':is_default, '; + $retValue[':is_default'] = htmlentities(trim($data["is_default"]["is_default"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["ns_activate"]["ns_activate"]) && $data["ns_activate"]["ns_activate"] != 2) { + $rq .= ':ns_activate, '; + $retValue[':ns_activate'] = $data["ns_activate"]["ns_activate"]; + } else { + $rq .= "NULL, "; + } + if (isset($data["centreonbroker_logs_path"]) && $data["centreonbroker_logs_path"] != null) { + $rq .= ':centreonbroker_logs_path, '; + $retValue[':centreonbroker_logs_path'] = + htmlentities(trim($data["centreonbroker_logs_path"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if (isset($data["remote_id"]) && $data["remote_id"] != null) { + $rq .= ':remote_id, '; + $retValue[':remote_id'] = htmlentities(trim($data["remote_id"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + if ( + isset($data["remote_server_use_as_proxy"]["remote_server_use_as_proxy"]) + && $data["remote_server_use_as_proxy"]["remote_server_use_as_proxy"] != null + ) { + $rq .= ':remote_server_use_as_proxy '; + $retValue[':remote_server_use_as_proxy'] = + htmlentities($data["remote_server_use_as_proxy"]["remote_server_use_as_proxy"], ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL "; + } $rq .= ")"; + $stmt = $pearDB->prepare($rq); + foreach ($retValue as $key => $value) { + $stmt->bindValue($key, $value); + } + $stmt->execute(); - $pearDB->query($rq); $result = $pearDB->query("SELECT MAX(id) as last_id FROM `nagios_server`"); $poller = $result->fetch(); $result->closeCursor(); @@ -544,14 +643,15 @@ function insertServer(array $data): int $fields ); - return (int) $poller["last_id"]; + return (int)$poller["last_id"]; } /** - * @param int $serverId Id of the server - * @global CentreonDB $pearDB DB connector - * global Centreon $centreon + * @param int $serverId Id of the server + * * @return bool Return true if ok + * @global CentreonDB $pearDB DB connector + * global Centreon $centreon */ function addUserRessource(int $serverId): bool { @@ -565,13 +665,13 @@ function addUserRessource(int $serverId): bool } catch (\PDOException $e) { return false; } - $isInsert = array(); + $isInsert = []; while ($resource = $res->fetch()) { if (!in_array($resource['resource_name'], $isInsert)) { $isInsert[] = $resource['resource_name']; $query = sprintf( $queryInsert, - (int) $resource['resource_id'], + (int)$resource['resource_id'], $serverId ); $pearDB->query($query); @@ -587,6 +687,7 @@ function addUserRessource(int $serverId): bool ); } } + return true; } @@ -600,18 +701,18 @@ function updateRemoteServerInformation(array $data) { global $pearDB, $centreon; - $res = $pearDB->query("SELECT * FROM `remote_servers` WHERE ip = '" . $data["ns_ip_address"] . "'"); + $res = $pearDB->query("SELECT * FROM `remote_servers` WHERE ip = '" . $data["ns_ip_address"] . "'"); $rows = $res->fetch(\PDO::FETCH_ASSOC); if ($rows > 1) { $rq = "UPDATE `remote_servers` SET "; $rq .= "http_method = '" . $data["http_method"] . "', "; isset($data["http_port"]) && !empty($data["http_port"]) - ? $rq .= "http_port = '" . $data["http_port"] . "', " + ? $rq .= "http_port = '" . $data["http_port"] . "', " : $rq .= "http_port = NULL, "; $rq .= "no_check_certificate = '" . $data["no_check_certificate"]["no_check_certificate"] . "', "; $rq .= "no_proxy = '" . $data["no_proxy"]["no_proxy"] . "' "; - $rq .= "WHERE ip = '" . $data["ns_ip_address"] . "'"; + $rq .= "WHERE ip = '" . $data["ns_ip_address"] . "'"; $pearDB->query($rq); } $res->closeCursor(); @@ -620,12 +721,12 @@ function updateRemoteServerInformation(array $data) /** * Update a server * - * @param int $id Id of the server - * @param array $data Data of server - * @global CentreonDB $pearDB DB connector - * @global Centreon $centreon + * @param int $id + * @param array $data + * + * @throws Exception */ -function updateServer(int $id, $data): void +function updateServer(int $id, array $data): void { global $pearDB, $centreon; @@ -635,120 +736,188 @@ function updateServer(int $id, $data): void if ($data["is_default"]["is_default"] == 1) { $pearDB->query("UPDATE `nagios_server` SET `is_default` = '0'"); } + $retValue = []; $rq = "UPDATE `nagios_server` SET "; - isset($data["name"]) && $data["name"] != null - ? $rq .= "name = '" . htmlentities($data["name"], ENT_QUOTES, "UTF-8") . "', " - : $rq .= "name = NULL, "; - isset($data["localhost"]["localhost"]) && $data["localhost"]["localhost"] != null - ? $rq .= "localhost = '" . htmlentities($data["localhost"]["localhost"], ENT_QUOTES, "UTF-8") . "', " - : $rq .= "localhost = NULL, "; - isset($data["ns_ip_address"]) && $data["ns_ip_address"] != null - ? $rq .= "ns_ip_address = '" . htmlentities(trim($data["ns_ip_address"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "ns_ip_address = NULL, "; - isset($data["ssh_port"]) && $data["ssh_port"] != null - ? $rq .= "ssh_port = '" . htmlentities(trim($data["ssh_port"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "ssh_port = '22', "; - isset($data["engine_start_command"]) && $data["engine_start_command"] != null - ? $rq .= "engine_start_command = '" . htmlentities( - trim($data["engine_start_command"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "engine_start_command = NULL, "; - isset($data["engine_stop_command"]) && $data["engine_stop_command"] != null - ? $rq .= "engine_stop_command = '" . htmlentities( - trim($data["engine_stop_command"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "engine_stop_command = NULL, "; - isset($data["engine_restart_command"]) && $data["engine_restart_command"] != null - ? $rq .= "engine_restart_command = '" . htmlentities( - trim($data["engine_restart_command"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "engine_restart_command = NULL, "; - isset($data["engine_reload_command"]) && $data["engine_reload_command"] != null - ? $rq .= "engine_reload_command = '" . htmlentities( - trim($data["engine_reload_command"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "engine_reload_command = NULL, "; - isset($data["init_script_centreontrapd"]) && $data["init_script_centreontrapd"] != null - ? $rq .= "init_script_centreontrapd = '" . htmlentities( - trim($data["init_script_centreontrapd"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "init_script_centreontrapd = NULL, "; - isset($data["snmp_trapd_path_conf"]) && $data["snmp_trapd_path_conf"] != null - ? $rq .= "snmp_trapd_path_conf = '" . htmlentities( - trim($data["snmp_trapd_path_conf"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "snmp_trapd_path_conf = NULL, "; - isset($data["nagios_bin"]) && $data["nagios_bin"] != null - ? $rq .= "nagios_bin = '" . htmlentities(trim($data["nagios_bin"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "nagios_bin = NULL, "; - isset($data["nagiostats_bin"]) && $data["nagiostats_bin"] != null - ? $rq .= "nagiostats_bin = '" . htmlentities(trim($data["nagiostats_bin"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "nagiostats_bin = NULL, "; - isset($data["nagios_perfdata"]) && $data["nagios_perfdata"] != null - ? $rq .= "nagios_perfdata = '" . htmlentities(trim($data["nagios_perfdata"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "nagios_perfdata = NULL, "; - isset($data["broker_reload_command"]) && $data["broker_reload_command"] != null - ? $rq .= "broker_reload_command = '" . htmlentities( - trim($data["broker_reload_command"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "broker_reload_command = NULL, "; - isset($data["centreonbroker_cfg_path"]) && $data["centreonbroker_cfg_path"] != null - ? $rq .= "centreonbroker_cfg_path = '" . htmlentities( - trim($data["centreonbroker_cfg_path"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "centreonbroker_cfg_path = NULL, "; - isset($data["centreonbroker_module_path"]) && $data["centreonbroker_module_path"] != null - ? $rq .= "centreonbroker_module_path = '" . htmlentities( - trim($data["centreonbroker_module_path"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "centreonbroker_module_path = NULL, "; - isset($data["centreonconnector_path"]) && $data["centreonconnector_path"] != null - ? $rq .= "centreonconnector_path = '" . htmlentities( - trim($data["centreonconnector_path"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "centreonconnector_path = NULL, "; - isset($data["ssh_private_key"]) && $data["ssh_private_key"] != null - ? $rq .= "ssh_private_key = '" . htmlentities(trim($data["ssh_private_key"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "ssh_private_key = NULL, "; - isset($data["is_default"]) && $data["is_default"] != null - ? $rq .= "is_default = '" . htmlentities(trim($data["is_default"]["is_default"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "is_default = NULL, "; - isset($data["centreonbroker_logs_path"]) && $data["centreonbroker_logs_path"] != null - ? $rq .= "centreonbroker_logs_path = '" . htmlentities( - trim($data["centreonbroker_logs_path"]), - ENT_QUOTES, - "UTF-8" - ) . "', " - : $rq .= "centreonbroker_logs_path = NULL, "; - isset($data["remote_id"]) && $data["remote_id"] != null - ? $rq .= "remote_id = '" . htmlentities(trim($data["remote_id"]), ENT_QUOTES, "UTF-8") . "', " - : $rq .= "remote_id = NULL, "; - $rq .= "ns_activate = '" . $data["ns_activate"]["ns_activate"] . "', "; - $rq .= "remote_server_centcore_ssh_proxy = '" - . $data["remote_server_centcore_ssh_proxy"]["remote_server_centcore_ssh_proxy"] . "' "; - $rq .= "WHERE id = '" . $id . "'"; - $pearDB->query($rq); + $rq .= "`name` = "; + if (isset($data["name"]) && $data["name"] != null) { + $rq .= ':name, '; + $retValue[':name'] = $data["name"]; + } else { + $rq .= "NULL, "; + } + $rq .= "`localhost` = "; + if (isset($data["localhost"]["localhost"]) && $data["localhost"]["localhost"] != null) { + $rq .= ':localhost, '; + $retValue[':localhost'] = htmlentities($data["localhost"]["localhost"], ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`ns_ip_address` = "; + if (isset($data["ns_ip_address"]) && $data["ns_ip_address"] != null) { + $rq .= ':ns_ip_address, '; + $retValue[':ns_ip_address'] = htmlentities(trim($data["ns_ip_address"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`gorgone_communication_type` = "; + if ( + isset($data["gorgone_communication_type"]['gorgone_communication_type']) + && $data["gorgone_communication_type"]['gorgone_communication_type'] != null + ) { + $rq .= ':gorgone_communication_type, '; + $retValue[':gorgone_communication_type'] = + htmlentities(trim($data["gorgone_communication_type"]['gorgone_communication_type']), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "'1', "; + } + $rq .= "`gorgone_port` = "; + if (isset($data["gorgone_port"]) && $data["gorgone_port"] != null) { + $rq .= ':gorgone_port, '; + $retValue[':gorgone_port'] = (int)$data["gorgone_port"]; + } else { + $rq .= "5556, "; + } + $rq .= "`engine_start_command` = "; + if (isset($data["engine_start_command"]) && $data["engine_start_command"] != null) { + $rq .= ':engine_start_command, '; + $retValue[':engine_start_command'] = htmlentities(trim($data["engine_start_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`engine_stop_command` = "; + if (isset($data["engine_stop_command"]) && $data["engine_stop_command"] != null) { + $rq .= ':engine_stop_command, '; + $retValue[':engine_stop_command'] = htmlentities(trim($data["engine_stop_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`engine_restart_command` = "; + if (isset($data["engine_restart_command"]) && $data["engine_restart_command"] != null) { + $rq .= ':engine_restart_command, '; + $retValue[':engine_restart_command'] = htmlentities(trim($data["engine_restart_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`engine_reload_command` = "; + if (isset($data["engine_reload_command"]) && $data["engine_reload_command"] != null) { + $rq .= ':engine_reload_command, '; + $retValue[':engine_reload_command'] = htmlentities(trim($data["engine_reload_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`init_script_centreontrapd` = "; + if (isset($data["init_script_centreontrapd"]) && $data["init_script_centreontrapd"] != null) { + $rq .= ':init_script_centreontrapd, '; + $retValue[':init_script_centreontrapd'] = + htmlentities(trim($data["init_script_centreontrapd"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`snmp_trapd_path_conf` = "; + if (isset($data["snmp_trapd_path_conf"]) && $data["snmp_trapd_path_conf"] != null) { + $rq .= ':snmp_trapd_path_conf, '; + $retValue[':snmp_trapd_path_conf'] = htmlentities(trim($data["snmp_trapd_path_conf"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`nagios_bin` = "; + if (isset($data["nagios_bin"]) && $data["nagios_bin"] != null) { + $rq .= ':nagios_bin, '; + $retValue[':nagios_bin'] = htmlentities(trim($data["nagios_bin"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`nagiostats_bin` = "; + if (isset($data["nagiostats_bin"]) && $data["nagiostats_bin"] != null) { + $rq .= ':nagiostats_bin, '; + $retValue[':nagiostats_bin'] = htmlentities(trim($data["nagiostats_bin"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`nagios_perfdata` = "; + if (isset($data["nagios_perfdata"]) && $data["nagios_perfdata"] != null) { + $rq .= ':nagios_perfdata, '; + $retValue[':nagios_perfdata'] = htmlentities(trim($data["nagios_perfdata"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`broker_reload_command` = "; + if (isset($data["broker_reload_command"]) && $data["broker_reload_command"] != null) { + $rq .= ':broker_reload_command, '; + $retValue[':broker_reload_command'] = htmlentities(trim($data["broker_reload_command"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`centreonbroker_cfg_path` = "; + if (isset($data["centreonbroker_cfg_path"]) && $data["centreonbroker_cfg_path"] != null) { + $rq .= ':centreonbroker_cfg_path, '; + $retValue[':centreonbroker_cfg_path'] = + htmlentities(trim($data["centreonbroker_cfg_path"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`centreonbroker_module_path` = "; + if (isset($data["centreonbroker_module_path"]) && $data["centreonbroker_module_path"] != null) { + $rq .= ':centreonbroker_module_path, '; + $retValue[':centreonbroker_module_path'] = + htmlentities(trim($data["centreonbroker_module_path"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`centreonconnector_path` = "; + if (isset($data["centreonconnector_path"]) && $data["centreonconnector_path"] != null) { + $rq .= ':centreonconnector_path, '; + $retValue[':centreonconnector_path'] = htmlentities(trim($data["centreonconnector_path"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`is_default` = "; + if (isset($data["is_default"]) && $data["is_default"] != null) { + $rq .= ':is_default, '; + $retValue[':is_default'] = (int)$data["is_default"]; + } else { + $rq .= "0, "; + } + $rq .= "`centreonbroker_logs_path` = "; + if (isset($data["centreonbroker_logs_path"]) && $data["centreonbroker_logs_path"] != null) { + $rq .= ':centreonbroker_logs_path, '; + $retValue[':centreonbroker_logs_path'] = + htmlentities(trim($data["centreonbroker_logs_path"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`remote_id` = "; + if (isset($data["remote_id"]) && $data["remote_id"] != null) { + $rq .= ':remote_id, '; + $retValue[':remote_id'] = htmlentities(trim($data["remote_id"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "NULL, "; + } + $rq .= "`ns_activate` = "; + if (isset($data["ns_activate"]["ns_activate"]) && $data["ns_activate"]["ns_activate"] != null) { + $rq .= ':ns_activate, '; + $retValue[':ns_activate'] = htmlentities(trim($data["ns_activate"]["ns_activate"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "'1', "; + } + $rq .= "`remote_server_use_as_proxy` = "; + if ( + isset($data["remote_server_use_as_proxy"]["remote_server_use_as_proxy"]) + && $data["remote_server_use_as_proxy"]["remote_server_use_as_proxy"] != null + ) { + $rq .= ':remote_server_use_as_proxy '; + $retValue[':remote_server_use_as_proxy'] = + htmlentities(trim($data["remote_server_use_as_proxy"]["remote_server_use_as_proxy"]), ENT_QUOTES, "UTF-8"); + } else { + $rq .= "'1' "; + } + $rq .= "WHERE id = " . (int)$id; + $stmt = $pearDB->prepare($rq); + foreach ($retValue as $key => $value) { + $stmt->bindValue($key, $value); + } + $stmt->execute(); updateRemoteServerInformation($data); additionnalRemoteServersByPollerId($id, $data["remote_additional_id"]); @@ -766,11 +935,12 @@ function updateServer(int $id, $data): void /** * Check if a service or an host has been changed for a specific poller. * - * @param int $poller_id Id of the poller - * @param int $last_restart Timestamp of the last restart - * @global CentreonDB $pearDBO DB connector for centreon_storage database - * @global array $conf_centreon Database configuration + * @param int $poller_id Id of the poller + * @param int $last_restart Timestamp of the last restart + * * @return bool Return true if the configuration has changed + * @global array $conf_centreon Database configuration + * @global CentreonDB $pearDBO DB connector for centreon_storage database */ function checkChangeState(int $poller_id, int $last_restart): bool { diff --git a/www/include/configuration/configServers/formServers.ihtml b/www/include/configuration/configServers/formServers.ihtml index c9aef559ddd..8ab20833561 100644 --- a/www/include/configuration/configServers/formServers.ihtml +++ b/www/include/configuration/configServers/formServers.ihtml @@ -1,129 +1,137 @@ {$form.javascript}
-
- {if $o == "a" || $o == "c"} -

{$form.submitC.html}{$form.submitA.html}   {$form.reset.html}

- {else if $o == "w"} -

{$form.change.html}

- {/if} -
-
- - - - +
+ {if $o == "a" || $o == "c"} +

{$form.submitC.html}{$form.submitA.html}   {$form.reset.html}

+ {else if $o == "w"} +

{$form.change.html}

+ {/if} +
+
+
-

| {$form.header.title}

-
+ + + - - - - - - - {if $form.remote_id.label} - - + + + + + + + {if $form.remote_id.label} + + - {/if} - {if $form.header.Remote_Configuration.label} - - - - - - - - {/if} - - - - - {if $form.remote_server_centcore_ssh_proxy.label} + {/if} + {if $form.header.Remote_Configuration.label} + + + + + + + + {/if} + + + + + + + + + + + + + + + {if $form.remote_server_use_as_proxy.label} + + + + + {/if} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - {/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + {if $o == "a" || $o == "c"} - + {/if} -
+

| {$form.header.title}

+
-

{$form.header.Server_Informations}

-
{$form.name.label}{$form.name.html}
{$form.ns_ip_address.label}{$form.ns_ip_address.html}
{$form.localhost.label}{$form.localhost.html}
{$form.is_default.label}{$form.is_default.html}
{$form.remote_id.label}{$form.remote_id.html}
+

{$form.header.Server_Informations}

+
{$form.name.label}{$form.name.html}
{$form.ns_ip_address.label}{$form.ns_ip_address.html}
{$form.localhost.label}{$form.localhost.html}
{$form.is_default.label}{$form.is_default.html}
{$form.remote_id.label}{$form.remote_id.html}
{$form.remote_additional_id.label} {$form.remote_additional_id.html}
-

{$form.header.Remote_Configuration}

-
{$form.http_method.label}{$form.http_method.html}
{$form.http_port.label}{$form.http_port.html}
{$form.no_check_certificate.label}{$form.no_check_certificate.html}
{$form.no_proxy.label}{$form.no_proxy.html}
-

{$form.header.SSH_Informations}

-
{$form.ssh_port.label}{$form.ssh_port.html}
+

{$form.header.Remote_Configuration}

+
{$form.http_method.label}{$form.http_method.html}
{$form.http_port.label}{$form.http_port.html}
{$form.no_check_certificate.label}{$form.no_check_certificate.html}
{$form.no_proxy.label}{$form.no_proxy.html}

{$form.header.gorgone_Informations}

{$form.gorgone_communication_type.label}{$form.gorgone_communication_type.html}
{$form.gorgone_port.label}{$form.gorgone_port.html}
{$form.remote_server_use_as_proxy.label}{$form.remote_server_use_as_proxy.html}

{$form.header.Nagios_Informations}

{$form.engine_start_command.label}{$form.engine_start_command.html}
{$form.engine_stop_command.label}{$form.engine_stop_command.html}
{$form.engine_restart_command.label}{$form.engine_restart_command.html}
{$form.engine_reload_command.label}{$form.engine_reload_command.html}
{$form.nagios_bin.label}{$form.nagios_bin.html}
{$form.nagiostats_bin.label}{$form.nagiostats_bin.html}
{$form.nagios_perfdata.label}{$form.nagios_perfdata.html}
+

{$form.header.CentreonBroker}

+
{$form.broker_reload_command.label}{$form.broker_reload_command.html}
{$form.centreonbroker_cfg_path.label}{$form.centreonbroker_cfg_path.html}
{$form.centreonbroker_module_path.label}{$form.centreonbroker_module_path.html}
{$form.centreonbroker_logs_path.label}{$form.centreonbroker_logs_path.html}
+

{$form.header.CentreonConnector}

+
{$form.centreonconnector_path.label}{$form.centreonconnector_path.html}
+

{$form.header.Centreontrapd}

+
{$form.init_script_centreontrapd.label}{$form.init_script_centreontrapd.html}
{$form.snmp_trapd_path_conf.label}{$form.snmp_trapd_path_conf.html}
+

{$form.header.Misc}

+
{$form.remote_server_centcore_ssh_proxy.label}{$form.remote_server_centcore_ssh_proxy.html}
-

{$form.header.Nagios_Informations}

-
{$form.engine_start_command.label}{$form.engine_start_command.html}
{$form.engine_stop_command.label}{$form.engine_stop_command.html}
{$form.engine_restart_command.label}{$form.engine_restart_command.html}
{$form.engine_reload_command.label}{$form.engine_reload_command.html}
{$form.nagios_bin.label}{$form.nagios_bin.html}
{$form.nagiostats_bin.label}{$form.nagiostats_bin.html}
{$form.nagios_perfdata.label}{$form.nagios_perfdata.html}
-

{$form.header.CentreonBroker}

-
{$form.broker_reload_command.label}{$form.broker_reload_command.html}
{$form.centreonbroker_cfg_path.label}{$form.centreonbroker_cfg_path.html}
{$form.centreonbroker_module_path.label}{$form.centreonbroker_module_path.html}
{$form.centreonbroker_logs_path.label}{$form.centreonbroker_logs_path.html}
-

{$form.header.CentreonConnector}

-
{$form.centreonconnector_path.label}{$form.centreonconnector_path.html}
-

{$form.header.Centreontrapd}

-
{$form.init_script_centreontrapd.label}{$form.init_script_centreontrapd.html}
{$form.snmp_trapd_path_conf.label}{$form.snmp_trapd_path_conf.html}
-

{$form.header.Misc}

-
- {t}Post-Restart command{/t} - - {include file="file:$centreon_path/www/include/common/templates/clone.ihtml" cloneId="pollercmd" cloneSet=$cloneSetCmd} -
{$form.ns_activate.label}{$form.ns_activate.html}
+ {t}Post-Restart command{/t} + + {include file="file:$centreon_path/www/include/common/templates/clone.ihtml" cloneId="pollercmd" cloneSet=$cloneSetCmd} +
{$form.ns_activate.label}{$form.ns_activate.html}
{$form.required_note}
{$form.required_note}
-
-
- {if $o == "a" || $o == "c"} -

{$form.submitC.html}{$form.submitA.html}   {$form.reset.html}

- {else if $o == "w"} -

{$form.change.html}

- {/if} -
- {$form.hidden} + + +
+ {if $o == "a" || $o == "c"} +

{$form.submitC.html}{$form.submitA.html}   {$form.reset.html}

+ {else if $o == "w"} +

{$form.change.html}

+ {/if} +
+ {$form.hidden}
{$helptext} diff --git a/www/include/configuration/configServers/formServers.php b/www/include/configuration/configServers/formServers.php index c12885ba566..aeb4b688235 100644 --- a/www/include/configuration/configServers/formServers.php +++ b/www/include/configuration/configServers/formServers.php @@ -37,6 +37,9 @@ exit(); } +const ZMQ = 1; +const SSH = 2; + require_once _CENTREON_PATH_ . "www/class/centreon-config/centreonMainCfg.class.php"; $objMain = new CentreonMainCfg(); @@ -59,14 +62,14 @@ $selectedAdditionnalRS = null; $serverType = "poller"; if (($o == SERVER_MODIFY || $o == SERVER_WATCH) && $server_id) { - $DBRESULT = $pearDB->query("SELECT * FROM `nagios_server` WHERE `id` = '$server_id' LIMIT 1"); - $cfg_server = array_map("myDecode", $DBRESULT->fetchRow()); - $DBRESULT->closeCursor(); + $dbResult = $pearDB->query("SELECT * FROM `nagios_server` WHERE `id` = '$server_id' LIMIT 1"); + $cfg_server = array_map("myDecode", $dbResult->fetch()); + $dbResult->closeCursor(); $query = 'SELECT ip FROM remote_servers'; - $DBRESULT = $pearDB->query($query); - $remotesServerIPs = $DBRESULT->fetchAll(PDO::FETCH_COLUMN); - $DBRESULT->closeCursor(); + $dbResult = $pearDB->query($query); + $remotesServerIPs = $dbResult->fetchAll(PDO::FETCH_COLUMN); + $dbResult->closeCursor(); if ($cfg_server['localhost']) { $serverType = "central"; @@ -75,9 +78,11 @@ } if ($serverType === "remote") { - $statement = $pearDB->prepare("SELECT http_method, http_port, no_check_certificate, no_proxy + $statement = $pearDB->prepare( + "SELECT http_method, http_port, no_check_certificate, no_proxy FROM `remote_servers` - WHERE `ip` = :ns_ip_address LIMIT 1"); + WHERE `ip` = :ns_ip_address LIMIT 1" + ); $statement->bindParam(':ns_ip_address', $cfg_server['ns_ip_address'], \PDO::PARAM_STR); $statement->execute(); @@ -86,11 +91,13 @@ } if ($serverType === "poller") { - // Select additionnal Remote Servers - $statement = $pearDB->prepare("SELECT remote_server_id, name + // Select additional Remote Servers + $statement = $pearDB->prepare( + "SELECT remote_server_id, name FROM rs_poller_relation AS rspr LEFT JOIN nagios_server AS ns ON (rspr.remote_server_id = ns.id) - WHERE poller_server_id = :poller_server_id"); + WHERE poller_server_id = :poller_server_id" + ); $statement->bindParam(':poller_server_id', $cfg_server['id'], \PDO::PARAM_INT); $statement->execute(); @@ -110,7 +117,7 @@ * Preset values of misc commands */ $cdata = CentreonData::getInstance(); -$cmdArray = $instanceObj->getCommandsFromPollerId(isset($server_id) ? $server_id : null); +$cmdArray = $instanceObj->getCommandsFromPollerId($server_id ?? null); $cdata->addJsData('clone-values-pollercmd', htmlspecialchars( json_encode($cmdArray), ENT_QUOTES @@ -121,11 +128,11 @@ * nagios servers comes from DB */ $nagios_servers = array(); -$DBRESULT = $pearDB->query("SELECT * FROM `nagios_server` ORDER BY name"); -while ($nagios_server = $DBRESULT->fetchRow()) { +$dbResult = $pearDB->query("SELECT * FROM `nagios_server` ORDER BY name"); +while ($nagios_server = $dbResult->fetch()) { $nagios_servers[$nagios_server["id"]] = $nagios_server["name"]; } -$DBRESULT->closeCursor(); +$dbResult->closeCursor(); $attrsText = array("size" => "30"); $attrsText2 = array("size" => "50"); @@ -170,7 +177,7 @@ * Headers */ $form->addElement('header', 'Server_Informations', _("Server Information")); -$form->addElement('header', 'SSH_Informations', _("SSH Information")); +$form->addElement('header', 'gorgone_Informations', _("Gorgone Information")); $form->addElement('header', 'Nagios_Informations', _("Monitoring Engine Information")); $form->addElement('header', 'Misc', _("Miscelleneous")); $form->addElement('header', 'Centreontrapd', _("Centreon Trap Collector")); @@ -216,19 +223,37 @@ ); $form->addElement('select2', 'remote_additional_id', _('Attach additional Remote Servers'), array(), $attrPoller2); $tab = []; - $tab[] = $form->createElement('radio', 'remote_server_centcore_ssh_proxy', null, _("Yes"), '1'); - $tab[] = $form->createElement('radio', 'remote_server_centcore_ssh_proxy', null, _("No"), '0'); - $form->addGroup($tab, 'remote_server_centcore_ssh_proxy', _("Use the Remote Server as a proxy for SSH"), ' '); + $tab[] = $form->createElement('radio', 'remote_server_use_as_proxy', null, _("Yes"), '1'); + $tab[] = $form->createElement('radio', 'remote_server_use_as_proxy', null, _("No"), '0'); + $form->addGroup($tab, 'remote_server_use_as_proxy', _("Use the Remote Server as a proxy"), ' '); } $form->addElement('text', 'nagios_bin', _("Monitoring Engine Binary"), $attrsText2); $form->addElement('text', 'nagiostats_bin', _("Monitoring Engine Statistics Binary"), $attrsText2); $form->addElement('text', 'nagios_perfdata', _("Perfdata file"), $attrsText2); -$form->addElement('text', 'ssh_port', _("SSH port"), $attrsText3); +$tab = array(); +$tab[] = $form->createElement('radio', 'gorgone_communication_type', null, _("ZMQ"), ZMQ); +$tab[] = $form->createElement('radio', 'gorgone_communication_type', null, _("SSH"), SSH); +$form->addGroup($tab, 'gorgone_communication_type', _("Gorgone connection protocol"), ' '); +$form->addElement('text', 'gorgone_port', _("Gorgone connection port"), $attrsText3); $tab = array(); -$tab[] = $form->createElement('radio', 'localhost', null, _("Yes"), '1'); -$tab[] = $form->createElement('radio', 'localhost', null, _("No"), '0'); +$tab[] = $form->createElement( + 'radio', + 'localhost', + null, + _("Yes"), + '1', + array('onclick' => "displayGorgoneParam(false);") +); +$tab[] = $form->createElement( + 'radio', + 'localhost', + null, + _("No"), + '0', + array('onclick' => "displayGorgoneParam(true);") +); $form->addGroup($tab, 'localhost', _("Localhost ?"), ' '); $tab = array(); @@ -305,17 +330,17 @@ "engine_restart_command" => $monitoring_engines["engine_restart_command"], "engine_reload_command" => $monitoring_engines["engine_reload_command"], "ns_activate" => '1', - "is_default" => '0', - "ssh_port" => '22', - "ssh_private_key" => '~/.ssh/rsa.id', - "nagios_perfdata" => $monitoring_engines["nagios_perfdata"], + "is_default" => '0', + "gorgone_communication_type" => ZMQ, + "gorgone_port" => 5556, + "nagios_perfdata" => $monitoring_engines["nagios_perfdata"], "broker_reload_command" => "service cbd reload", "centreonbroker_cfg_path" => "/etc/centreon-broker", "centreonbroker_module_path" => "/usr/share/centreon/lib/centreon-broker", "centreonbroker_logs_path" => "/var/log/centreon-broker", "init_script_centreontrapd" => "centreontrapd", "snmp_trapd_path_conf" => "/etc/snmp/centreon_traps/", - "remote_server_centcore_ssh_proxy" => '1' + "remote_server_use_as_proxy" => '1' ] ); } else { @@ -419,6 +444,17 @@ ?> diff --git a/www/include/configuration/configServers/listServers.php b/www/include/configuration/configServers/listServers.php index 7c55f06dfd6..3c001688bde 100644 --- a/www/include/configuration/configServers/listServers.php +++ b/www/include/configuration/configServers/listServers.php @@ -146,7 +146,7 @@ $ACLString = $centreon->user->access->queryBuilder('WHERE', 'id', $pollerstring); $query = "SELECT SQL_CALC_FOUND_ROWS id, name, ns_activate, ns_ip_address, localhost, is_default " . - "FROM `nagios_server` " . $ACLString . " " . + ", gorgone_communication_type FROM `nagios_server` " . $ACLString . " " . ($LCASearch != '' ? ($ACLString != "" ? "AND " : "WHERE ") . $LCASearch : "") . " ORDER BY name LIMIT " . $num * $limit . ", " . $limit; $dbResult = $pearDB->query($query); @@ -257,27 +257,29 @@ $style = ($i % 2) ? "two" : "one"; $elemArr[$i] = [ - 'MenuClass' => "list_{$style}", - 'RowMenu_select' => $selectedElements->toHtml(), - 'RowMenu_name' => $config['name'], - 'RowMenu_ip_address' => $config['ns_ip_address'], - 'RowMenu_link' => "main.php?p={$p}&o=c&server_id={$config['id']}", - 'RowMenu_type' => $serverType, - 'RowMenu_is_running' => $isRunning ? _('Yes') : _('No'), - 'RowMenu_is_runningFlag' => $nagiosInfo[$config['id']]['is_currently_running'], - 'RowMenu_is_default' => $config['is_default'] ? _('Yes') : _('No'), - 'RowMenu_hasChanged' => $confChangedMessage, - "RowMenu_pid" => $pollerProcessId, - 'RowMenu_hasChangedFlag' => $hasChanged, - 'RowMenu_version' => $version, - 'RowMenu_uptime' => $uptime, - 'RowMenu_lastUpdateTime' => $updateTime, + 'MenuClass' => "list_{$style}", + 'RowMenu_select' => $selectedElements->toHtml(), + 'RowMenu_name' => $config['name'], + 'RowMenu_ip_address' => $config['ns_ip_address'], + 'RowMenu_server_id' => $config['id'], + 'RowMenu_gorgone_protocol' => $config['gorgone_communication_type'], + 'RowMenu_link' => "main.php?p={$p}&o=c&server_id={$config['id']}", + 'RowMenu_type' => $serverType, + 'RowMenu_is_running' => $isRunning ? _('Yes') : _('No'), + 'RowMenu_is_runningFlag' => $nagiosInfo[$config['id']]['is_currently_running'], + 'RowMenu_is_default' => $config['is_default'] ? _('Yes') : _('No'), + 'RowMenu_hasChanged' => $confChangedMessage, + "RowMenu_pid" => $pollerProcessId, + 'RowMenu_hasChangedFlag' => $hasChanged, + 'RowMenu_version' => $version, + 'RowMenu_uptime' => $uptime, + 'RowMenu_lastUpdateTime' => $updateTime, 'RowMenu_lastUpdateTimeFlag' => $lastUpdateTimeFlag, - 'RowMenu_status' => $config['ns_activate'] ? _('Enabled') : _('Disabled'), - 'RowMenu_badge' => $config['ns_activate'] ? 'service_ok' : 'service_critical', - 'RowMenu_statusVal' => $config['ns_activate'], - 'RowMenu_cfg_id' => ($cfg_id == -1) ? '' : $cfg_id['nagios_id'], - 'RowMenu_options' => $moptions + 'RowMenu_status' => $config['ns_activate'] ? _('Enabled') : _('Disabled'), + 'RowMenu_badge' => $config['ns_activate'] ? 'service_ok' : 'service_critical', + 'RowMenu_statusVal' => $config['ns_activate'], + 'RowMenu_cfg_id' => ($cfg_id == -1) ? '' : $cfg_id['nagios_id'], + 'RowMenu_options' => $moptions ]; } $tpl->assign("elemArr", $elemArr); diff --git a/www/include/configuration/configServers/popup/poller.yaml b/www/include/configuration/configServers/popup/poller.yaml new file mode 100644 index 00000000000..a21f27aa370 --- /dev/null +++ b/www/include/configuration/configServers/popup/poller.yaml @@ -0,0 +1,19 @@ +name: gorgoned-__SERVERNAME__ +description: Configuration for poller __SERVERNAME__ +gorgone: + gorgonecore: + id: __SERVERID__ + external_com_type: tcp + external_com_path: "*:__GORGONEPORT__" + authorized_clients: __THUMBPRINT__ + privkey: "/var/lib/centreon-gorgone/.keys/rsakey.priv.pem" + pubkey: "/var/lib/centreon-gorgone/.keys/rsakey.pub.pem" + modules: + - name: action + package: gorgone::modules::core::action::hooks + enable: true + + - name: engine + package: gorgone::modules::centreon::engine::hooks + enable: true + command_file: "__COMMAND__" diff --git a/www/include/configuration/configServers/popup/popup.ihtml b/www/include/configuration/configServers/popup/popup.ihtml new file mode 100644 index 00000000000..56c208bf58d --- /dev/null +++ b/www/include/configuration/configServers/popup/popup.ihtml @@ -0,0 +1,32 @@ +

Gorgone configuration file :

+
+
+
{$args}
+
+ + {if $gorgoneError == '0'} +
+ +
+ {/if} +
+ +{literal} + +{/literal} diff --git a/www/include/configuration/configServers/popup/popup.php b/www/include/configuration/configServers/popup/popup.php new file mode 100644 index 00000000000..5fdac3f6ba5 --- /dev/null +++ b/www/include/configuration/configServers/popup/popup.php @@ -0,0 +1,179 @@ +query($query); +$remotesServerIPs = $dbResult->fetchAll(PDO::FETCH_COLUMN); +$dbResult->closeCursor(); + +//get poller informations +$query = " +SELECT ns.`id`, ns.`name`, ns.`gorgone_port`, ns.`ns_ip_address`, ns.`localhost`,ns.remote_id, +cn.`command_file`, GROUP_CONCAT( pr.`remote_server_id` ) AS list_remote_server_id , +CASE + WHEN (ns.localhost = '1') THEN 'central' + WHEN (rs.id > '0') THEN 'remote' + ELSE 'poller' +END AS poller_type +FROM nagios_server AS ns +LEFT JOIN remote_servers AS rs ON (rs.ip = ns.ns_ip_address) +LEFT JOIN cfg_nagios AS cn ON (cn.`nagios_id` = ns.`id` ) +LEFT JOIN rs_poller_relation AS pr ON (pr.`poller_server_id` = ns.`id` ) +WHERE ns.ns_activate = '1' +AND ns.`id` =" . (int)$_GET['id']; + +$dbResult = $pearDB->query($query); +$server = $dbResult->fetch(); + +//get gorgone api informations +$gorgoneApi = []; +$dbResult = $pearDB->query('SELECT * from options WHERE `key` LIKE "gorgone%"'); +while ($row = $dbResult->fetch()) { + $gorgoneApi[$row['key']] = $row['value']; +} + +$tpl->assign('serverIp', $server['ns_ip_address']); +if (empty($server['remote_id']) && empty($server['list_remote_server_id'])) { + //parent is the central + $query = "SELECT `id` FROM nagios_server WHERE ns_activate = '1' AND localhost = '1'"; + $dbResult = $pearDB->query($query); + $parents = $dbResult->fetchAll(\PDO::FETCH_COLUMN); +} else { + $dbResult = $pearDB->query($query); + $parents = [$server['remote_id']]; + if (!empty($server['list_remote_server_id'])) { + $remote = explode(',', $server['list_remote_server_id']); + $parents = array_merge($parents, $remote); + } + $query = 'SELECT `id` FROM nagios_server WHERE `ns_activate` = "1" AND `id` IN (' . implode(',', $parents) . ')'; + $dbResult = $pearDB->query($query); + $parents = $dbResult->fetchAll(\PDO::FETCH_COLUMN); +} + +$kernel = App\Kernel::createForWeb(); +/** + * @var $gorgoneService \Centreon\Domain\Gorgone\Interfaces\GorgoneServiceInterface + */ +$gorgoneService = $kernel->getContainer()->get(\Centreon\Domain\Gorgone\Interfaces\GorgoneServiceInterface::class); +$thumbprints = ''; +$dataError = ''; +$gorgoneError = false; +$timeout = 0; + +try { + foreach ($parents as $serverId) { + $lastActionLog = null; + $thumbprintCommand = new \Centreon\Domain\Gorgone\Command\Internal\ThumbprintCommand($serverId); + $gorgoneResponse = $gorgoneService->send($thumbprintCommand); + // check if we have log for 30 s every 2s + do { + $lastActionLog = $gorgoneResponse->getLastActionLog(); + sleep(2); + $timeout += 2; + } while ( + ($lastActionLog == null || $lastActionLog->getCode() === \Centreon\Domain\Gorgone\Response::STATUS_BEGIN) && + $timeout <= 30 + ); + + if ($timeout > 30) { + // add 10 s for the next server + $timeout -= 10; + $gorgoneError = true; + $dataError .= ' + - error : TimeOut error for poller ' . $serverId . ' We can\'t get log'; + continue; + } + + $thummprintReponse = json_decode($lastActionLog->getData(), true); + if ($lastActionLog->getCode() === \Centreon\Domain\Gorgone\Response::STATUS_OK) { + $thumbprints .= ' + - key: ' . $thummprintReponse['data']['thumbprint']; + } else { + $gorgoneError = true; + $dataError .= ' + - error : Poller ' . $serverId . ' : ' . $thummprintReponse['message']; + } + } +} catch (\Exception $ex) { + $gorgoneError = true; + $dataError = $ex->getMessage(); +} + +if (!empty($dataError)) { + $config = $dataError; +} elseif (in_array($server['ns_ip_address'], $remotesServerIPs)) { + //config for remote + $config = file_get_contents('./remote.yaml'); + $config = str_replace( + [ + '__SERVERNAME__', + '__SERVERID__', + '__GORGONEPORT__', + '__THUMBPRINT__', + '__COMMAND__', + ], + [ + $server['name'], + $server['id'], + $server['gorgone_port'], + $thumbprints, + $server['command_file'], + ], + $config + ); +} else { + //config for poller + $config = file_get_contents('./poller.yaml'); + $config = str_replace( + [ + '__SERVERNAME__', + '__SERVERID__', + '__GORGONEPORT__', + '__THUMBPRINT__', + '__COMMAND__', + ], + [ + $server['name'], + $server['id'], + $server['gorgone_port'], + $thumbprints, + $server['command_file'], + ], + $config + ); +} + +$tpl->assign('args', $config); +$tpl->assign('gorgoneError', $gorgoneError); +$tpl->display("popup.ihtml"); diff --git a/www/include/configuration/configServers/popup/remote.yaml b/www/include/configuration/configServers/popup/remote.yaml new file mode 100644 index 00000000000..f648e25102e --- /dev/null +++ b/www/include/configuration/configServers/popup/remote.yaml @@ -0,0 +1,35 @@ +name: gorgoned-__SERVERNAME__ +description: Configuration for remote server __SERVERNAME__ +gorgone: + gorgonecore: + id: __SERVERID__ + external_com_type: tcp + external_com_path: "*:__GORGONEPORT__" + authorized_clients: __THUMBPRINT__ + privkey: "/var/lib/centreon-gorgone/.keys/rsakey.priv.pem" + pubkey: "/var/lib/centreon-gorgone/.keys/rsakey.pub.pem" + modules: + - name: action + package: gorgone::modules::core::action::hooks + enable: true + + - name: nodes + package: gorgone::modules::centreon::nodes::hooks + enable: true + + - name: proxy + package: gorgone::modules::core::proxy::hooks + enable: true + + - name: legacycmd + package: gorgone::modules::centreon::legacycmd::hooks + enable: true + cmd_file: "/var/lib/centreon/centcore.cmd" + cache_dir: "/var/cache/centreon/" + cache_dir_trap: "/etc/snmp/centreon_traps/" + remote_dir: "/var/cache/centreon/config/remote-data/" + + - name: engine + package: gorgone::modules::centreon::engine::hooks + enable: true + command_file: "__COMMAND__" diff --git a/www/include/configuration/configServers/servers.php b/www/include/configuration/configServers/servers.php index bdb83d74b7e..9368422d3e2 100644 --- a/www/include/configuration/configServers/servers.php +++ b/www/include/configuration/configServers/servers.php @@ -1,7 +1,8 @@ user->access->getPollerAclConf( - array( - 'fields' => array('id', 'name', 'last_restart'), - 'order' => array('name'), - 'keys' => array('id') - ) + [ + 'fields' => ['id', 'name', 'last_restart'], + 'order' => ['name'], + 'keys' => ['id'], + ] ); $instanceObj = new CentreonInstance($pearDB); @@ -93,11 +94,7 @@ switch ($o) { case SERVER_ADD: - require_once($path . "formServers.php"); - break; case SERVER_WATCH: - require_once($path . "formServers.php"); - break; case SERVER_MODIFY: require_once($path . "formServers.php"); break; @@ -123,8 +120,7 @@ if (!in_array(false, $select)) { deleteServerInDB($select); } - require_once($path . "listServers.php"); - break; + //then require the same file than default default: require_once($path . "listServers.php"); break; diff --git a/www/install/createTables.sql b/www/install/createTables.sql index fce83e7c853..4f1d73baa47 100644 --- a/www/install/createTables.sql +++ b/www/install/createTables.sql @@ -1623,15 +1623,15 @@ CREATE TABLE `nagios_server` ( `centreonbroker_cfg_path` varchar(255) DEFAULT NULL, `centreonbroker_module_path` varchar(255) DEFAULT NULL, `centreonconnector_path` varchar(255) DEFAULT NULL, - `ssh_port` int(11) DEFAULT NULL, - `ssh_private_key` varchar(255) DEFAULT NULL, + `gorgone_communication_type` enum('1', '2') NOT NULL DEFAULT '1', + `gorgone_port` int(11) DEFAULT NULL, `init_script_centreontrapd` varchar(255) DEFAULT NULL, `snmp_trapd_path_conf` varchar(255) DEFAULT NULL, `engine_name` varchar(255) DEFAULT NULL, `engine_version` varchar(255) DEFAULT NULL, `centreonbroker_logs_path` VARCHAR(255), `remote_id` int(11) NULL, - `remote_server_centcore_ssh_proxy` enum('0','1') NOT NULL DEFAULT '1', + `remote_server_use_as_proxy` enum('0','1') NOT NULL DEFAULT '1', `updated` enum('1','0') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), CONSTRAINT `nagios_server_remote_id_id` FOREIGN KEY (`remote_id`) REFERENCES `nagios_server` (`id`) ON DELETE SET NULL ON UPDATE CASCADE diff --git a/www/install/insertBaseConf.sql b/www/install/insertBaseConf.sql index 6ea5d465c20..fc9aaef62eb 100644 --- a/www/install/insertBaseConf.sql +++ b/www/install/insertBaseConf.sql @@ -140,8 +140,12 @@ INSERT INTO `options` (`key`, `value`) VALUES ('selectPaginationSize', 60), ('display_downtime_chart','0'), ('display_comment_chart','0'), -('centcore_illegal_characters', '`'), -('inheritance_mode', '3'); +('gorgone_illegal_characters', '`'), +('inheritance_mode', '3'), +('gorgone_api_address', '127.0.0.1'), +('gorgone_api_port', '8085'), +('gorgone_api_ssl', '0'), +('gorgone_api_allow_self_signed', '1'); -- -- Contenu de la table `giv_components_template` diff --git a/www/install/insertTopology.sql b/www/install/insertTopology.sql index 09acf813ce9..a3a008ca489 100644 --- a/www/install/insertTopology.sql +++ b/www/install/insertTopology.sql @@ -79,7 +79,7 @@ INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_parent`, `topo INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`, `topology_style_class`, `topology_style_id`, `topology_OnClick`, `readonly`) VALUES (124,'LDAP',501,50113,50,1,'./include/Administration/parameters/parameters.php','&o=ldap','0','0','1',NULL,NULL,NULL,'1'); INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`, `topology_style_class`, `topology_style_id`, `topology_OnClick`, `readonly`) VALUES (125,'RRDTool',501,50114,60,1,'./include/Administration/parameters/parameters.php','&o=rrdtool','0','0','1',NULL,NULL,NULL,'1'); INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`, `topology_style_class`, `topology_style_id`, `topology_OnClick`, `readonly`) VALUES (126,'Debug',501,50115,70,1,'./include/Administration/parameters/parameters.php','&o=debug','0','0','1',NULL,NULL,NULL,'1'); -INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`, `topology_style_class`, `topology_style_id`, `topology_OnClick`, `readonly`) VALUES (128,'CentCore',501,50117,25,1,'./include/Administration/parameters/parameters.php','&o=centcore','0','0','1',NULL,NULL,NULL,'1'); +INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`, `topology_style_class`, `topology_style_id`, `topology_OnClick`, `readonly`) VALUES (128,'Gorgone',501,50117,25,1,'./include/Administration/parameters/parameters.php','&o=gorgone','0','0','1',NULL,NULL,NULL,'1'); INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`, `topology_style_class`, `topology_style_id`, `topology_OnClick`, `readonly`) VALUES (97,'Performance Management',501,NULL,20,10,NULL,NULL,'0','0','1',NULL,NULL,NULL,'1'); INSERT INTO `topology` (`topology_id`, `topology_name`, `topology_parent`, `topology_page`, `topology_order`, `topology_group`, `topology_url`, `topology_url_opt`, `topology_popup`, `topology_modules`, `topology_show`, `topology_style_class`, `topology_style_id`, `topology_OnClick`, `readonly`) VALUES (129,'Options',501,50118,15,10,'./include/Administration/parameters/parameters.php','&o=storage','0','0','1',NULL,NULL,NULL,'1'); @@ -281,4 +281,3 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - diff --git a/www/install/php/Update-20.04.0-beta.1.php b/www/install/php/Update-20.04.0-beta.1.php index 978ecc3e6c6..fe0fdfb6086 100644 --- a/www/install/php/Update-20.04.0-beta.1.php +++ b/www/install/php/Update-20.04.0-beta.1.php @@ -1,6 +1,6 @@ beginTransaction(); + /* + * Get user data to generate a new config file for the gorgone daemon module + */ + + //set a pattern for values to get from file + $patterns = [ + 'instance_mode' => '/--INSTANCEMODE--/', + 'db_host' => '/--ADDRESS--:--DBPORT--/', + 'db_user' => '/--DBUSER--/', + 'db_passwd' => '/--DBPASS--/', + 'centreon_db' => '/--CONFDB--/', + 'centstorage_db' => '/--STORAGEDB--/', + 'VarLib' => '/--CENTREON_VARLIB--/' + ]; + + //set new mandatory parameters pattern used by gorgone + $pattern = [ + '/--CENTREON_SPOOL--/', + '/--CENTREON_TRAPDIR--/', + '/--HTTPSERVERADDRESS--/', + '/--HTTPSERVERPORT--/', + '/--SSLMODE--/' + ]; + + //set default values for these parameters + $userValues = [ + '/var/spool/centreon', + '/etc/snmp/centreon_traps', + '0.0.0.0', + '8085', + 'false' + ]; + + $isACentral = false; + + // get user's centreon cache folder path + $fileToOpen = _CENTREON_ETC_ . '/instCentWeb.conf'; + $errorMessage = 'Missing or empty \'instCentWeb.conf\' file'; + if (!file_exists($fileToOpen) || 0 === filesize($fileToOpen)) { + throw new \InvalidArgumentException($errorMessage); + } + $file = fopen($fileToOpen, 'r'); + + while (!feof($file)) { + $line = fgets($file); + if (strpos($line, "CENTREON_CACHEDIR") !== false) { + //remove superfluous carriage return + $line = preg_replace("/\r|\n/", "", $line); + $line = explode("=", $line); + $pattern[] = '/--CENTREON_CACHEDIR--/'; + // if no value is found, a default value is required + $userValues[] = $line[1] ?? '/var/cache/centreon'; + } + } + fclose($file); + + // get user's values from conf.pm + $fileToOpen = _CENTREON_ETC_ . '/conf.pm'; + $errorMessage = 'Missing or empty centreon \'conf.pm\' file'; + if (!file_exists($fileToOpen) || 0 === filesize($fileToOpen)) { + throw new \InvalidArgumentException($errorMessage); + } + $start = false; + $stop = false; + $file = fopen($fileToOpen, 'r'); + + while (!feof($file) && $stop === false) { + // removing indentation and carriage return + $line = rtrim(ltrim(fgets($file), " "), ",\n"); + + // getting only line in a specific array + if (strpos($line, '$centreon_config = {') !== false) { + $start = true; + continue; + } elseif ($start === true + && strpos($line, '$instance_mode =') !== false + ) { + $stop = true; + $isACentral = strpos($line, 'central') ? true : false; + continue; + } elseif ($start === true + && strlen($line) > 5 + && substr($line, 0, 1) !== "#" + && strpos($line, ' => ') !== false + ) { + $line = explode(' => ', $line); + if (!isset($line[1])) { + continue; + } + + list($currentLine, $currentValue) = $line; + $currentLine = trim($currentLine, '"'); + if ($currentLine === 'db_passwd') { + $currentValue = trim($currentValue, '\''); + } else { + $currentValue = trim($currentValue, '"'); + } + + if (array_key_exists($currentLine, $patterns)) { + $pattern[] = $patterns[$currentLine]; + $userValues[] = $currentValue; + } + } + } + fclose($file); + + // checking if the instance is a central and generating configuration files + if ($isACentral === true) { + // database configuration file + $fileTpl = __DIR__ . '/../var/databaseTemplate.yaml'; + if (!file_exists($fileTpl) || 0 === filesize($fileTpl)) { + $errorMessage = 'Database configuration template is empty or missing'; + throw new \InvalidArgumentException($errorMessage); + } + $content = file_get_contents($fileTpl); + $content = preg_replace($pattern, $userValues, $content); + $finalFile = _CENTREON_ETC_ . '/config.d/10-database.yaml'; + file_put_contents($finalFile, $content); + + if (!file_exists($finalFile) || 0 === filesize($finalFile)) { + $errorMessage = 'Database configuration file is not created properly'; + throw new \InvalidArgumentException($errorMessage); + } + + // gorgone configuration file for centreon. Created in the centreon-gorgone folder + $fileTpl = __DIR__ . '/../var/gorgone/gorgoneCoreTemplate.yaml'; + if (!file_exists($fileTpl) || 0 === filesize($fileTpl)) { + $errorMessage = 'Gorgone configuration template is empty or missing'; + throw new \InvalidArgumentException($errorMessage); + } + $content = file_get_contents($fileTpl); + $content = preg_replace($pattern, $userValues, $content); + $finalFile = _CENTREON_ETC_ . '/../centreon-gorgone/config.d/40-gorgoned.yaml'; + if (!file_exists(_CENTREON_ETC_ . '/../centreon-gorgone')) { + $errorMessage = 'Gorgone configuration folder does not exist. ' . + 'Please reinstall the centreon-gorgone package and retry'; + throw new \InvalidArgumentException($errorMessage); + } + file_put_contents($finalFile, $content); + + if (!file_exists($finalFile) || 0 === filesize($finalFile)) { + $errorMessage = 'Gorgone configuration file is not created properly'; + throw new \InvalidArgumentException($errorMessage); + } + } + /* * Move broker xml files to json format */ diff --git a/www/install/sql/centreon/Update-DB-20.04.0-beta.1.sql b/www/install/sql/centreon/Update-DB-20.04.0-beta.1.sql index 1dad025e6dd..f59679c4907 100644 --- a/www/install/sql/centreon/Update-DB-20.04.0-beta.1.sql +++ b/www/install/sql/centreon/Update-DB-20.04.0-beta.1.sql @@ -18,3 +18,22 @@ INSERT INTO `topology` (`topology_name`, `topology_url`, `readonly`, `is_react`, ALTER TABLE `cfg_nagios` DROP COLUMN `check_result_path`; ALTER TABLE `cfg_nagios` DROP COLUMN `use_check_result_path`; ALTER TABLE `cfg_nagios` DROP COLUMN `max_check_result_file_age`; + +-- Update nagios_server to add gorgone connection +ALTER TABLE `nagios_server` ADD `gorgone_communication_type` enum('1','2') NOT NULL DEFAULT '1' AFTER `centreonconnector_path`; +ALTER TABLE `nagios_server` CHANGE `ssh_port` `gorgone_port` INT(11) NULL; +ALTER TABLE `nagios_server` CHANGE `remote_server_centcore_ssh_proxy` `remote_server_use_as_proxy` enum('0','1') NOT NULL DEFAULT '1'; +ALTER TABLE `nagios_server` DROP COLUMN `ssh_private_key`; +UPDATE `nagios_server` SET `gorgone_communication_type` = '2'; +-- Update options for gorgone +UPDATE options SET `key` = 'gorgone_illegal_characters' WHERE `key` = 'centcore_illegal_characters'; +UPDATE options SET `key` = 'gorgone_cmd_timeout' WHERE `key` = 'centcore_cmd_timeout'; +UPDATE topology SET topology_url_opt = '&o=gorgone', topology_name = 'Gorgone' WHERE topology_page = 50117; +UPDATE options SET `key` = 'debug_gorgone' WHERE `key` = 'debug_centcore'; +DELETE FROM `options` WHERE `key` = 'enable_perfdata_sync'; +DELETE FROM `options` WHERE `key` = 'enable_logs_sync'; +-- gorgone API default +INSERT INTO `options` (`key`, `value`) VALUES ('gorgone_api_address', '127.0.0.1'); +INSERT INTO `options` (`key`, `value`) VALUES ('gorgone_api_port', '8085'); +INSERT INTO `options` (`key`, `value`) VALUES ('gorgone_api_ssl', '0'); +INSERT INTO `options` (`key`, `value`) VALUES ('gorgone_api_allow_self_signed', '1'); diff --git a/www/install/steps/process/configFileSetup.php b/www/install/steps/process/configFileSetup.php index caebd3bb68b..dffe41ff160 100644 --- a/www/install/steps/process/configFileSetup.php +++ b/www/install/steps/process/configFileSetup.php @@ -1,7 +1,8 @@ 'configfile', 'result' => 1, - 'msg' => '' -); + 'msg' => '', +]; $step = new \CentreonLegacy\Core\Install\Step\Step6($dependencyInjector); $parameters = $step->getDatabaseConfiguration(); @@ -53,7 +54,8 @@ $host = 'localhost'; } -$patterns = array( +// mandatory parameters used by centCore or Gorgone.d in the legacy SSH mode +$patterns = [ '/--ADDRESS--/', '/--DBUSER--/', '/--DBPASS--/', @@ -63,10 +65,10 @@ '/--CENTREON_CACHEDIR--/', '/--DBPORT--/', '/--INSTANCEMODE--/', - '/--CENTREON_VARLIB--/' -); + '/--CENTREON_VARLIB--/', +]; -$replacements = array( +$replacements = [ $host, $parameters['db_user'], $parameters['db_password'], @@ -76,13 +78,15 @@ $configuration['centreon_cachedir'], $parameters['port'], "central", - $configuration['centreon_varlib'] -); + $configuration['centreon_varlib'], +]; + +$centreonEtcPath = rtrim($configuration['centreon_etc'], '/'); /** * centreon.conf.php */ -$centreonConfFile = rtrim($configuration['centreon_etc'], '/') . '/centreon.conf.php'; +$centreonConfFile = $centreonEtcPath . '/centreon.conf.php'; $contents = file_get_contents('../../var/configFileTemplate'); $contents = preg_replace($patterns, $replacements, $contents); file_put_contents($centreonConfFile, $contents); @@ -90,11 +94,46 @@ /** * conf.pm */ -$centreonConfPmFile = rtrim($configuration['centreon_etc'], '/') . '/conf.pm'; +$centreonConfPmFile = $centreonEtcPath . '/conf.pm'; $contents = file_get_contents('../../var/configFilePmTemplate'); $contents = preg_replace($patterns, $replacements, $contents); file_put_contents($centreonConfPmFile, $contents); +// specific additional mandatory parameters used by Gorgone.d in a full ZMQ mode +array_push( + $patterns, + '/--CENTREON_SPOOL--/', + '/--HTTPSERVERADDRESS--/', + '/--HTTPSERVERPORT--/', + '/--SSLMODE--/', + '/--CENTREON_TRAPDIR--/' +); + +array_push( + $replacements, + "/var/spool/centreon", + "0.0.0.0", + "8085", + "false", + "/etc/snmp/centreon_traps" +); + +/** + * Database configuration file + */ +$gorgoneDatabaseFile = $centreonEtcPath . '/config.d/10-database.yaml'; +$contents = file_get_contents('../../var/databaseTemplate.yaml'); +$contents = preg_replace($patterns, $replacements, $contents); +file_put_contents($gorgoneDatabaseFile, $contents); + +/** + * Gorgone daemon configuration file for a central + */ +$gorgoneCoreFileForCentral = $centreonEtcPath . '/../centreon-gorgone/config.d/40-gorgoned.yaml'; +$contents = file_get_contents('../../var/gorgone/gorgoneCoreTemplate.yaml'); +$contents = preg_replace($patterns, $replacements, $contents); +file_put_contents($gorgoneCoreFileForCentral, $contents); + $return['result'] = 0; echo json_encode($return); exit; diff --git a/www/install/var/baseconf/centreon-broker.sql b/www/install/var/baseconf/centreon-broker.sql index 81e1fceaf63..c4beeb75279 100644 --- a/www/install/var/baseconf/centreon-broker.sql +++ b/www/install/var/baseconf/centreon-broker.sql @@ -153,9 +153,6 @@ INSERT INTO `cfg_centreonbroker_info` (`config_id`, `config_key`, `config_value` INSERT INTO `cfg_centreonbroker_info` (`config_id`, `config_key`, `config_value`, `config_group`, `config_group_id`) VALUES (3,'type','ipv4','output',1); INSERT INTO `cfg_centreonbroker_info` (`config_id`, `config_key`, `config_value`, `config_group`, `config_group_id`) VALUES (3,'blockId','1_3','output',1); -INSERT INTO `options` (`key`, `value`) VALUES ('enable_perfdata_sync', '0'); -INSERT INTO `options` (`key`, `value`) VALUES ('enable_logs_sync', '0'); - UPDATE `nagios_server` SET `centreonbroker_cfg_path` = '@broker_etc@' WHERE `id` = 1; UPDATE `nagios_server` SET `centreonbroker_module_path` = '@centreonbroker_lib@' WHERE `id` = 1; diff --git a/www/install/var/baseconf/centreon-engine.sql b/www/install/var/baseconf/centreon-engine.sql index aae88aadba6..a342b86bef5 100644 --- a/www/install/var/baseconf/centreon-engine.sql +++ b/www/install/var/baseconf/centreon-engine.sql @@ -1,5 +1,5 @@ -INSERT INTO `nagios_server` (`id`, `name`, `localhost`, `is_default`, `last_restart`, `ns_ip_address`, `ns_activate`, `ns_status`, `engine_start_command`, `engine_stop_command`, `engine_restart_command`, `engine_reload_command`, `broker_reload_command`, `nagios_bin`, `nagiostats_bin`, `nagios_perfdata`, `centreonbroker_cfg_path`, `centreonbroker_module_path`, `centreonconnector_path`, `ssh_port`, `ssh_private_key`, `init_script_centreontrapd`, `snmp_trapd_path_conf`) VALUES -(1, 'Central', '1', 1, 0, '127.0.0.1', '1', '0', 'service centengine start', 'service centengine stop', 'service centengine restart', 'service centengine reload', 'service cbd reload', '@monitoring_binary@', '@centreon_engine_stats_binary@', '@monitoring_varlog@/service-perfdata', '', NULL, '@centreon_engine_connectors@', 22, NULL, 'centreontrapd', '/etc/snmp/centreon_traps/'); +INSERT INTO `nagios_server` (`id`, `name`, `localhost`, `is_default`, `last_restart`, `ns_ip_address`, `ns_activate`, `ns_status`, `engine_start_command`, `engine_stop_command`, `engine_restart_command`, `engine_reload_command`, `broker_reload_command`, `nagios_bin`, `nagiostats_bin`, `nagios_perfdata`, `centreonbroker_cfg_path`, `centreonbroker_module_path`, `centreonconnector_path`, `gorgone_communication_type`, `gorgone_port`, `init_script_centreontrapd`, `snmp_trapd_path_conf`) VALUES +(1, 'Central', '1', 1, 0, '127.0.0.1', '1', '0', 'service centengine start', 'service centengine stop', 'service centengine restart', 'service centengine reload', 'service cbd reload', '@monitoring_binary@', '@centreon_engine_stats_binary@', '@monitoring_varlog@/service-perfdata', '', NULL, '@centreon_engine_connectors@', '1', 5556, 'centreontrapd', '/etc/snmp/centreon_traps/'); INSERT INTO `cfg_nagios` (`nagios_id`, `nagios_name`, `log_file`, `cfg_dir`, `temp_file`, `status_file`, `status_update_interval`, `nagios_user`, `nagios_group`, `enable_notifications`, `execute_service_checks`, `accept_passive_service_checks`, `execute_host_checks`, `accept_passive_host_checks`, `enable_event_handlers`, `log_rotation_method`, `log_archive_path`, `check_external_commands`, `external_command_buffer_slots`, `command_check_interval`, `command_file`, `downtime_file`, `comment_file`, `lock_file`, `retain_state_information`, `state_retention_file`, `retention_update_interval`, `use_retained_program_state`, `use_retained_scheduling_info`, `retained_contact_host_attribute_mask`, `retained_contact_service_attribute_mask`, `retained_process_host_attribute_mask`, `retained_process_service_attribute_mask`, `retained_host_attribute_mask`, `retained_service_attribute_mask`, `use_syslog`, `log_notifications`, `log_service_retries`, `log_host_retries`, `log_event_handlers`, `log_external_commands`, `log_passive_checks`, `global_host_event_handler`, `global_service_event_handler`, `sleep_time`, `service_inter_check_delay_method`, `host_inter_check_delay_method`, `service_interleave_factor`, `max_concurrent_checks`, `max_service_check_spread`, `max_host_check_spread`, `check_result_reaper_frequency`, `max_check_result_reaper_time`, `interval_length`, `auto_reschedule_checks`, `auto_rescheduling_interval`, `auto_rescheduling_window`, `use_aggressive_host_checking`, `enable_flap_detection`, `low_service_flap_threshold`, `high_service_flap_threshold`, `low_host_flap_threshold`, `high_host_flap_threshold`, `soft_state_dependencies`, `service_check_timeout`, `host_check_timeout`, `event_handler_timeout`, `notification_timeout`, `ocsp_timeout`, `ochp_timeout`, `perfdata_timeout`, `obsess_over_services`, `ocsp_command`, `obsess_over_hosts`, `ochp_command`, `process_performance_data`, `host_perfdata_command`, `service_perfdata_command`, `host_perfdata_file`, `service_perfdata_file`, `host_perfdata_file_template`, `service_perfdata_file_template`, `host_perfdata_file_mode`, `service_perfdata_file_mode`, `host_perfdata_file_processing_interval`, `service_perfdata_file_processing_interval`, `host_perfdata_file_processing_command`, `service_perfdata_file_processing_command`, `check_for_orphaned_services`, `check_for_orphaned_hosts`, `check_service_freshness`, `service_freshness_check_interval`, `freshness_check_interval`, `check_host_freshness`, `host_freshness_check_interval`, `date_format`, `illegal_object_name_chars`, `illegal_macro_output_chars`, `use_regexp_matching`, `use_true_regexp_matching`, `admin_email`, `admin_pager`, `nagios_comment`, `nagios_activate`, `event_broker_options`, `translate_passive_host_checks`, `nagios_server_id`, `enable_predictive_host_dependency_checks`, `enable_predictive_service_dependency_checks`, `cached_host_check_horizon`, `cached_service_check_horizon`, `passive_host_checks_are_soft`, `use_large_installation_tweaks`, `enable_environment_macros`, `additional_freshness_latency`, `debug_file`, `debug_level`, `debug_level_opt`, `debug_verbosity`, `max_debug_file_size`, `cfg_file`) VALUES (1, 'Centreon Engine Central', '@monitoring_varlog@/centengine.log', '@monitoring_etc@', '@monitoring_varlog@/centengine.tmp', '@monitoring_varlog@/status.dat', NULL, '@monitoring_user@', '@monitoring_group@', '1', '1', '1', '2', '2', '1', 'd', '@monitoring_varlog@/archives/', '1', NULL, '1s', '@monitoring_var_lib@/rw/centengine.cmd', NULL, NULL, '/var/lock/subsys/centengine.lock', '1', '@monitoring_varlog@/retention.dat', 60, '1', '1', NULL, NULL, NULL, NULL, NULL, NULL, '0', '1', '1', '1', '1', '1', '2', NULL, NULL, '0.2', 's', NULL, 's', 400, 5, NULL, 5, NULL, 60, '2', NULL, NULL, '1', '0', '25.0', '50.0', '25.0', '50.0', '0', 60, 12, 30, 30, 5, 5, 5, '0', NULL, '2', NULL, '0', NULL, NULL, NULL, NULL, NULL, NULL, '2', '2', NULL, NULL, NULL, NULL, '0', '0', '1', NULL, NULL, '2', NULL, 'euro', '~!$%^&*"|'<>?,()=', '`~$^&"|'<>', '2', '2', 'admin@localhost', 'admin', 'Centreon Engine', '1', '-1', NULL, 1, '2', '2', 60, NULL, NULL, '2', '2', NULL, '@monitoring_varlog@/centengine.debug', 0, '0', '2', NULL, 'centengine.cfg'); diff --git a/www/install/var/config.yaml b/www/install/var/config.yaml new file mode 100644 index 00000000000..41be72ba2b1 --- /dev/null +++ b/www/install/var/config.yaml @@ -0,0 +1,3 @@ +name: config.yaml +description: Configuration for Central server +configuration: !include config.d/*.yaml \ No newline at end of file diff --git a/www/install/var/databaseTemplate.yaml b/www/install/var/databaseTemplate.yaml new file mode 100644 index 00000000000..a98f04798c7 --- /dev/null +++ b/www/install/var/databaseTemplate.yaml @@ -0,0 +1,9 @@ +database: + db_configuration: + dsn: "mysql:host=--ADDRESS--:--DBPORT--;dbname=--CONFDB--" + username: "--DBUSER--" + password: "--DBPASS--" + db_realtime: + dsn: "mysql:host=--ADDRESS--:--DBPORT--;dbname=--STORAGEDB--" + username: "--DBUSER--" + password: "--DBPASS--" diff --git a/www/install/var/gorgone/gorgoneCoreTemplate.yaml b/www/install/var/gorgone/gorgoneCoreTemplate.yaml new file mode 100644 index 00000000000..e25d8d56da0 --- /dev/null +++ b/www/install/var/gorgone/gorgoneCoreTemplate.yaml @@ -0,0 +1,59 @@ +gorgone: + gorgonecore: + privkey: "--CENTREON_VARLIB---gorgone/.keys/rsakey.priv.pem" + pubkey: "--CENTREON_VARLIB---gorgone/.keys/rsakey.pub.pem" + + modules: + - name: httpserver + package: "gorgone::modules::core::httpserver::hooks" + enable: true + address: "--HTTPSERVERADDRESS--" + port: "--HTTPSERVERPORT--" + ssl: --SSLMODE-- + auth: + enabled: false + allowed_hosts: + enabled: true + subnets: + - 127.0.0.1/32 + + - name: action + package: "gorgone::modules::core::action::hooks" + enable: true + + - name: cron + package: "gorgone::modules::core::cron::hooks" + enable: true + cron: !include cron.d/*.yaml + + - name: nodes + package: "gorgone::modules::centreon::nodes::hooks" + enable: true + + - name: proxy + package: "gorgone::modules::core::proxy::hooks" + enable: true + + - name: legacycmd + package: "gorgone::modules::centreon::legacycmd::hooks" + enable: true + cmd_file: "--CENTREON_VARLIB--/centcore.cmd" + cache_dir: "--CENTREON_CACHEDIR--" + cache_dir_trap: "--CENTREON_TRAPDIR--" + remote_dir: "--CENTREON_CACHEDIR--/config/remote-data/" + + - name: engine + package: "gorgone::modules::centreon::engine::hooks" + enable: true + command_file: "--CENTREON_VARLIB---engine/rw/centengine.cmd" + + - name: broker + package: "gorgone::modules::centreon::broker::hooks" + enable: true + cache_dir: "--CENTREON_CACHEDIR--/broker-stats/" + cron: + - id: broker_stats + timespec: "*/2 * * * *" + action: BROKERSTATS + parameters: + timeout: 10