diff --git a/behat.yml b/behat.yml index 473b79aaf68..07aa089297f 100644 --- a/behat.yml +++ b/behat.yml @@ -361,17 +361,16 @@ default: paths: [ "%paths.base%/features/CentreonModuleAPI.feature" ] contexts: [ CentreonModuleAPIContext ] - contact_groups_api: - paths: [ "%paths.base%/features/ContactGroupsApi.feature" ] - contexts: [ ContactGroupsApiContext ] - - timeperiods_api: - paths: [ "%paths.base%/features/TimeperiodsApi.feature" ] - contexts: [ TimeperiodsApiContext ] - - images_api: - paths: [ "%paths.base%/features/ImagesApi.feature" ] - contexts: [ ImagesApiContext ] + api_v1: + paths: + - "%paths.base%/features/APIv1/AclGroupsApi.feature" + - "%paths.base%/features/APIv1/CommandsApi.feature" + - "%paths.base%/features/APIv1/ContactGroupsApi.feature" + - "%paths.base%/features/APIv1/EscalationsApi.feature" + - "%paths.base%/features/APIv1/ImagesApi.feature" + - "%paths.base%/features/APIv1/TimeperiodsApi.feature" + contexts: + - \Centreon\Test\Behat\CentreonAPIContext api_v2_monitoring: paths: 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/bootstrap.php b/bootstrap.php index ee699bc4699..06953194e7e 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -60,6 +60,8 @@ function loadDependencyInjector() } // require composer file -require __DIR__ . '/vendor/autoload.php'; +$loader = require __DIR__ . '/vendor/autoload.php'; + +Doctrine\Common\Annotations\AnnotationRegistry::registerLoader([$loader, 'loadClass']); require_once __DIR__ . "/container.php"; diff --git a/composer.lock b/composer.lock index f62d7356020..76aeee068c0 100644 --- a/composer.lock +++ b/composer.lock @@ -888,16 +888,16 @@ }, { "name": "pear/console_getopt", - "version": "v1.4.2", + "version": "v1.4.3", "source": { "type": "git", "url": "https://github.com/pear/Console_Getopt.git", - "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0" + "reference": "a41f8d3e668987609178c7c4a9fe48fecac53fa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Console_Getopt/zipball/6c77aeb625b32bd752e89ee17972d103588b90c0", - "reference": "6c77aeb625b32bd752e89ee17972d103588b90c0", + "url": "https://api.github.com/repos/pear/Console_Getopt/zipball/a41f8d3e668987609178c7c4a9fe48fecac53fa0", + "reference": "a41f8d3e668987609178c7c4a9fe48fecac53fa0", "shasum": "" }, "type": "library", @@ -914,11 +914,6 @@ "BSD-2-Clause" ], "authors": [ - { - "name": "Greg Beaver", - "email": "cellog@php.net", - "role": "Helper" - }, { "name": "Andrei Zmievski", "email": "andrei@php.net", @@ -928,23 +923,28 @@ "name": "Stig Bakken", "email": "stig@php.net", "role": "Developer" + }, + { + "name": "Greg Beaver", + "email": "cellog@php.net", + "role": "Helper" } ], "description": "More info available on: http://pear.php.net/package/Console_Getopt", - "time": "2019-02-06T16:52:33+00:00" + "time": "2019-11-20T18:27:48+00:00" }, { "name": "pear/pear-core-minimal", - "version": "v1.10.9", + "version": "v1.10.10", "source": { "type": "git", "url": "https://github.com/pear/pear-core-minimal.git", - "reference": "742be8dd68c746a01e4b0a422258e9c9cae1c37f" + "reference": "625a3c429d9b2c1546438679074cac1b089116a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/742be8dd68c746a01e4b0a422258e9c9cae1c37f", - "reference": "742be8dd68c746a01e4b0a422258e9c9cae1c37f", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/625a3c429d9b2c1546438679074cac1b089116a7", + "reference": "625a3c429d9b2c1546438679074cac1b089116a7", "shasum": "" }, "require": { @@ -975,7 +975,7 @@ } ], "description": "Minimal set of PEAR core files to be used as composer dependency", - "time": "2019-03-13T18:15:44+00:00" + "time": "2019-11-19T19:00:24+00:00" }, { "name": "pear/pear_exception", @@ -4200,31 +4200,29 @@ }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -4246,7 +4244,7 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2019-11-24T13:36:37+00:00" }, { "name": "willdurand/jsonp-callback-validator", @@ -6035,16 +6033,16 @@ }, { "name": "sebastian/environment", - "version": "4.2.2", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { @@ -6084,7 +6082,7 @@ "environment", "hhvm" ], - "time": "2019-05-05T09:05:15+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", @@ -6623,16 +6621,16 @@ }, { "name": "symfony/phpunit-bridge", - "version": "v4.3.8", + "version": "v4.4.0", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "c216b32261358a820bb4217eb3a20e3f437a484e" + "reference": "7daa9d4a2f457f9cae32f1c2406de1921dc86a79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/c216b32261358a820bb4217eb3a20e3f437a484e", - "reference": "c216b32261358a820bb4217eb3a20e3f437a484e", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/7daa9d4a2f457f9cae32f1c2406de1921dc86a79", + "reference": "7daa9d4a2f457f9cae32f1c2406de1921dc86a79", "shasum": "" }, "require": { @@ -6642,7 +6640,7 @@ "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" }, "suggest": { - "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" + "symfony/error-handler": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" }, "bin": [ "bin/simple-phpunit" @@ -6650,7 +6648,7 @@ "type": "symfony-bridge", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.4-dev" }, "thanks": { "name": "phpunit/phpunit", @@ -6684,7 +6682,7 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2019-10-30T12:58:49+00:00" + "time": "2019-11-08T15:59:14+00:00" }, { "name": "theseer/tokenizer", diff --git a/config/Modules/Centreon.yaml b/config/Modules/Centreon.yaml index 10e72e5296a..09b4efa20a8 100644 --- a/config/Modules/Centreon.yaml +++ b/config/Modules/Centreon.yaml @@ -57,6 +57,16 @@ services: Centreon\Domain\RequestParameters\Interfaces\RequestParametersInterface: class: Centreon\Domain\RequestParameters\RequestParameters + # Poller configuration + Centreon\Domain\MonitoringServer\Interfaces\MonitoringServerServiceInterface: + class: Centreon\Domain\MonitoringServer\MonitoringServerService + + Centreon\Domain\MonitoringServer\Interfaces\MonitoringServerRepositoryInterface: + class: Centreon\Infrastructure\MonitoringServer\MonitoringServerRepositoryRDB + calls: + - method: setSqlRequestTranslator + arguments: ['@sqlRequestTranslator'] + # Real time monitoring sqlRequestTranslator: class: Centreon\Infrastructure\RequestParameters\SqlRequestParametersTranslator diff --git a/doc/API/centreon-api-v2.html b/doc/API/centreon-api-v2.html index eb230ebd078..bb992253bc2 100644 --- a/doc/API/centreon-api-v2.html +++ b/doc/API/centreon-api-v2.html @@ -308,7 +308,7 @@ -

Information

All dates are in ISO 8601 format

Authentication

There are two modes of authentication:

@@ -356,7 +357,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /acknowledgements/hosts
http://localhost/centreon/api/beta/acknowledgements/hosts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Adds an acknowledgement on host

Authorizations:
Request Body schema: application/json

Acknowledgment

+
get /acknowledgements/hosts
http://localhost/centreon/api/beta/acknowledgements/hosts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Adds an acknowledgement on host

Authorizations:
Request Body schema: application/json

Acknowledgment

comment
string

Short description of the acknowledgement

host_id
integer <int64>

Unique id of the host

is_notify_contacts
boolean

Indicates whether notification is send to the contacts linked to the host or service

@@ -376,7 +377,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /acknowledgements/services
http://localhost/centreon/api/beta/acknowledgements/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Adds an acknowledgement on service

Authorizations:
Request Body schema: application/json

Acknowledgment

+
get /acknowledgements/services
http://localhost/centreon/api/beta/acknowledgements/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Adds an acknowledgement on service

Authorizations:
Request Body schema: application/json

Acknowledgment

comment
string

Short description of the acknowledgement

host_id
integer <int64>

Unique id of the host

is_notify_contacts
boolean

Indicates whether notification is send to the contacts linked to the host or service

@@ -398,7 +399,27 @@
post /login
http://localhost/centreon/api/beta/login

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "contact":
    {
    },
  • "security":
    {
    }
}

Logout

Entry point to delete an existing authentication token.

Authorizations:

Responses

200

successful operation

403

Forbidden

-
get /logout
http://localhost/centreon/api/beta/logout

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Downtime

This API allow to:

+
get /logout
http://localhost/centreon/api/beta/logout

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

MonitoringServer

This API allow to:

+
    +
  • Show the monitoring server configurations
  • +
+

List all monitoring server configurations

List all monitoring server configurations

+

The available parameters to search / sort_by are:

+
    +
  • id
  • +
  • name
  • +
  • is_localhost
  • +
  • address
  • +
  • is_activate
  • +
+
Authorizations:
query Parameters
limit
integer (RequestParameters.limit) >= 1
Example: limit=20

Max items per pages

+
page
integer (RequestParameters.page) >= 1
Example: page=1

Number of the page requested

+
sort_by
any

Used to sort the request

+
search
any

Used to search with specifics parameters

+

Responses

200

successful operation

+
403

Forbidden

+
500

Internal Server Error

+
get /configuration/monitoring-servers
http://localhost/centreon/api/beta/configuration/monitoring-servers

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Downtime

This API allow to:

  • Show hosts and services downtimes
  • Add a downtime on host or service
  • @@ -433,7 +454,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hosts/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all downtimes of one host

List all downtimes of one host

+
get /monitoring/hosts/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all downtimes of one host

List all downtimes of one host

The available parameters to search / sort_by are:

  • id
  • @@ -459,7 +480,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hosts/{host_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Add a downtimes of one host

Authorizations:
path Parameters
host_id
required
integer <int64>

ID of host

+
get /monitoring/hosts/{host_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Add a downtimes of one host

Authorizations:
path Parameters
host_id
required
integer <int64>

ID of host

Request Body schema: application/json

Downtime

start_time
string <date-time>

Scheduled start date of the downtime (ISO8601)

end_time
string <date-time>

Scheduled end date of the downtime (ISO8601)

@@ -471,7 +492,7 @@

Responses

204

Command sent

403

Forbidden

500

Internal Server Error

-
post /monitoring/hosts/{host_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/downtimes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "start_time": "2019-11-21T09:30:06Z",
  • "end_time": "2019-11-21T09:30:06Z",
  • "is_fixed": true,
  • "duration": 0,
  • "author_id": 0,
  • "comment": "string",
  • "with_services": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List all services downtimes

List all downtimes of services

+
post /monitoring/hosts/{host_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/downtimes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "start_time": "2019-12-10T12:19:38Z",
  • "end_time": "2019-12-10T12:19:38Z",
  • "is_fixed": true,
  • "duration": 0,
  • "author_id": 0,
  • "comment": "string",
  • "with_services": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List all services downtimes

List all downtimes of services

The available parameters to search / sort_by are:

  • id
  • @@ -500,7 +521,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/services/downtimes
http://localhost/centreon/api/beta/monitoring/services/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all downtimes of one host-related service

List all downtimes of one host-related service

+
get /monitoring/services/downtimes
http://localhost/centreon/api/beta/monitoring/services/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all downtimes of one host-related service

List all downtimes of one host-related service

The available parameters to search / sort_by are:

  • id
  • @@ -524,7 +545,7 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hosts/{host_id}/services/{service_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/services/{service_id}/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Add a downtime of one host-related service

Authorizations:
path Parameters
host_id
required
integer <int64>

ID of host

+
get /monitoring/hosts/{host_id}/services/{service_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/services/{service_id}/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Add a downtime of one host-related service

Authorizations:
path Parameters
host_id
required
integer <int64>

ID of host

service_id
required
integer <int64>

ID of service linked to the host

Request Body schema: application/json

Downtime

start_time
string <date-time>

Scheduled start date of the downtime (ISO8601)

@@ -536,7 +557,7 @@

Responses

204

Command sent

403

Forbidden

500

Internal Server Error

-
post /monitoring/hosts/{host_id}/services/{service_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/services/{service_id}/downtimes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "start_time": "2019-11-21T09:30:06Z",
  • "end_time": "2019-11-21T09:30:06Z",
  • "is_fixed": true,
  • "duration": 0,
  • "author_id": 0,
  • "comment": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List all downtimes

List all downtimes

+
post /monitoring/hosts/{host_id}/services/{service_id}/downtimes
http://localhost/centreon/api/beta/monitoring/hosts/{host_id}/services/{service_id}/downtimes

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "start_time": "2019-12-10T12:19:38Z",
  • "end_time": "2019-12-10T12:19:38Z",
  • "is_fixed": true,
  • "duration": 0,
  • "author_id": 0,
  • "comment": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List all downtimes

List all downtimes

The available parameters to search / sort_by are:

  • id
  • @@ -565,15 +586,15 @@

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/downtimes
http://localhost/centreon/api/beta/monitoring/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Display one downtime

Authorizations:
path Parameters
downtime_id
required
integer <int64>

ID of downtime

+
get /monitoring/downtimes
http://localhost/centreon/api/beta/monitoring/downtimes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Display one downtime

Authorizations:
path Parameters
downtime_id
required
integer <int64>

ID of downtime

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/downtimes/{downtime_id}
http://localhost/centreon/api/beta/monitoring/downtimes/{downtime_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "author_id": 0,
  • "host_id": 0,
  • "comment": "string",
  • "duration": 0,
  • "entry_time": "2019-11-21T09:30:07Z",
  • "start_time": "2019-11-21T09:30:07Z",
  • "end_time": "2019-11-21T09:30:07Z",
  • "deletion_time": "2019-11-21T09:30:07Z",
  • "actual_start_time": "2019-11-21T09:30:07Z",
  • "actual_end_time": "2019-11-21T09:30:07Z",
  • "is_started": true,
  • "is_cancelled": true,
  • "is_fixed": true,
  • "service_id": 0
}

Cancel a downtime

Authorizations:
path Parameters
downtime_id
required
integer <int64>

ID of downtime

+
get /monitoring/downtimes/{downtime_id}
http://localhost/centreon/api/beta/monitoring/downtimes/{downtime_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "author_id": 0,
  • "host_id": 0,
  • "comment": "string",
  • "duration": 0,
  • "entry_time": "2019-12-10T12:19:38Z",
  • "start_time": "2019-12-10T12:19:38Z",
  • "end_time": "2019-12-10T12:19:38Z",
  • "deletion_time": "2019-12-10T12:19:38Z",
  • "actual_start_time": "2019-12-10T12:19:38Z",
  • "actual_end_time": "2019-12-10T12:19:38Z",
  • "is_started": true,
  • "is_cancelled": true,
  • "is_fixed": true,
  • "service_id": 0
}

Cancel a downtime

Authorizations:
path Parameters
downtime_id
required
integer <int64>

ID of downtime

Responses

204

Command sent

403

Forbidden

500

Internal Server Error

-
delete /monitoring/downtimes/{downtime_id}
http://localhost/centreon/api/beta/monitoring/downtimes/{downtime_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Monitoring

Real-time monitoring of the services and hosts

+
delete /monitoring/downtimes/{downtime_id}
http://localhost/centreon/api/beta/monitoring/downtimes/{downtime_id}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Monitoring

Real-time monitoring of the services and hosts

List all services grouped by host groups

Returns all services grouped by host groups.

The available parameters to search / sort_by are:

    @@ -602,7 +623,7 @@

    Information

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hostgroups
http://localhost/centreon/api/beta/monitoring/hostgroups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all hosts

Returns all hosts.

+
get /monitoring/hostgroups
http://localhost/centreon/api/beta/monitoring/hostgroups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all hosts

Returns all hosts.

The available parameters to search / sort_by are:

  • host.id
  • @@ -626,13 +647,13 @@

    Information

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/hosts
http://localhost/centreon/api/beta/monitoring/hosts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Find host by ID

Retuns a single host with full details and some details about its services

+
get /monitoring/hosts
http://localhost/centreon/api/beta/monitoring/hosts

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Find host by ID

Retuns a single host with full details and some details about its services

Authorizations:
path Parameters
hostId
required
integer <int64>

ID of host to return

Responses

200

successful operation

403

Forbidden

404

Host not found

500

Internal Server Error

-
get /monitoring/hosts/{hostId}
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "alias": "string",
  • "display_name": "string",
  • "name": "string",
  • "state": 0,
  • "services":
    [
    ],
  • "poller_id": 0,
  • "acknowledged": true,
  • "address_ip": "192.168.0.1",
  • "check_attempt": 0,
  • "checked": true,
  • "execution_time": 0,
  • "icon_image": "string",
  • "icon_image_alt": "string",
  • "last_check": "2019-11-21T09:30:07Z",
  • "last_hard_state_change": "2019-11-21T09:30:07Z",
  • "last_state_change": "2019-11-21T09:30:07Z",
  • "last_time_down": "2019-11-21T09:30:07Z",
  • "last_time_unreachable": "2019-11-21T09:30:07Z",
  • "last_time_up": "2019-11-21T09:30:07Z",
  • "last_update": "2019-11-21T09:30:07Z",
  • "max_check_attempts": 0,
  • "output": "string",
  • "passive_checks": true,
  • "state_type": 0,
  • "timezone": ":Europe/Paris",
  • "active_checks": true,
  • "check_command": "string",
  • "check_interval": 0,
  • "check_period": "string",
  • "check_type": 0,
  • "last_hard_state": "2019-11-21T09:30:07Z",
  • "last_notification": "2019-11-21T09:30:07Z",
  • "latency": "string",
  • "next_check": "2019-11-21T09:30:07Z",
  • "next_host_notification": 0,
  • "notification_interval": 0,
  • "notification_number": 0,
  • "notify": true,
  • "notify_on_down": true,
  • "notify_on_downtime": true,
  • "notify_on_flapping": true,
  • "notify_on_recovery": true,
  • "notify_on_unreachable": true
}

Find host-related services

Returns all services associated with a host.

+
get /monitoring/hosts/{hostId}
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "alias": "string",
  • "display_name": "string",
  • "name": "string",
  • "state": 0,
  • "services":
    [
    ],
  • "poller_id": 0,
  • "acknowledged": true,
  • "address_ip": "192.168.0.1",
  • "check_attempt": 0,
  • "checked": true,
  • "execution_time": 0,
  • "icon_image": "string",
  • "icon_image_alt": "string",
  • "last_check": "2019-12-10T12:19:38Z",
  • "last_hard_state_change": "2019-12-10T12:19:38Z",
  • "last_state_change": "2019-12-10T12:19:38Z",
  • "last_time_down": "2019-12-10T12:19:38Z",
  • "last_time_unreachable": "2019-12-10T12:19:38Z",
  • "last_time_up": "2019-12-10T12:19:38Z",
  • "last_update": "2019-12-10T12:19:38Z",
  • "max_check_attempts": 0,
  • "output": "string",
  • "passive_checks": true,
  • "state_type": 0,
  • "timezone": ":Europe/Paris",
  • "active_checks": true,
  • "check_command": "string",
  • "check_interval": 0,
  • "check_period": "string",
  • "check_type": 0,
  • "last_hard_state": "2019-12-10T12:19:38Z",
  • "last_notification": "2019-12-10T12:19:38Z",
  • "latency": "string",
  • "next_check": "2019-12-10T12:19:38Z",
  • "next_host_notification": 0,
  • "notification_interval": 0,
  • "notification_number": 0,
  • "notify": true,
  • "notify_on_down": true,
  • "notify_on_downtime": true,
  • "notify_on_flapping": true,
  • "notify_on_recovery": true,
  • "notify_on_unreachable": true
}

Find host-related services

Returns all services associated with a host.

The available parameters to search / sort_by are:

  • service.id
  • @@ -651,14 +672,14 @@

    Information

403

Forbidden

404

Host not found

500

Internal Server Error

-
get /monitoring/hosts/{hostId}/services
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Find service by ID related to a host

Retuns a single host with full details

+
get /monitoring/hosts/{hostId}/services
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

Find service by ID related to a host

Retuns a single host with full details

Authorizations:
path Parameters
hostId
required
integer <int64>

Host Id for which service is associed

serviceId
required
integer <int64>

ID of service to return

Responses

200

successful operation

403

Forbidden

404

Host or service not found

500

Internal Server Error

-
get /monitoring/hosts/{hostId}/services/{serviceId}
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}/services/{serviceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "description": "string",
  • "display_name": "string",
  • "state": 0,
  • "check_attempt": 0,
  • "icon_image": "string",
  • "icon_image_alt": "string",
  • "last_check": "2019-11-21T09:30:07Z",
  • "last_state_change": "2019-11-21T09:30:07Z",
  • "max_check_attempts": 0,
  • "output": "string",
  • "state_type": 0,
  • "check_command": "string",
  • "check_interval": 0,
  • "check_period": "string",
  • "check_type": 0,
  • "command_line": "string",
  • "execution_time": 0,
  • "is_acknowledged": true,
  • "is_active_check": true,
  • "is_checked": true,
  • "last_hard_state_change": "2019-11-21T09:30:07Z",
  • "last_notification": "2019-11-21T09:30:07Z",
  • "last_time_critical": "2019-11-21T09:30:07Z",
  • "last_time_ok": "2019-11-21T09:30:07Z",
  • "last_time_unknown": "2019-11-21T09:30:07Z",
  • "last_time_warning": "2019-11-21T09:30:07Z",
  • "last_update": "2019-11-21T09:30:07Z",
  • "latency": 0,
  • "next_check": "2019-11-21T09:30:07Z",
  • "performance_data": "string",
  • "scheduled_downtime_depth": 0
}

List all services grouped by service groups

Returns all services grouped by service groups.

+
get /monitoring/hosts/{hostId}/services/{serviceId}
http://localhost/centreon/api/beta/monitoring/hosts/{hostId}/services/{serviceId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": 0,
  • "description": "string",
  • "display_name": "string",
  • "state": 0,
  • "check_attempt": 0,
  • "icon_image": "string",
  • "icon_image_alt": "string",
  • "last_check": "2019-12-10T12:19:38Z",
  • "last_state_change": "2019-12-10T12:19:38Z",
  • "max_check_attempts": 0,
  • "output": "string",
  • "state_type": 0,
  • "check_command": "string",
  • "check_interval": 0,
  • "check_period": "string",
  • "check_type": 0,
  • "command_line": "string",
  • "execution_time": 0,
  • "is_acknowledged": true,
  • "is_active_check": true,
  • "is_checked": true,
  • "last_hard_state_change": "2019-12-10T12:19:38Z",
  • "last_notification": "2019-12-10T12:19:38Z",
  • "last_time_critical": "2019-12-10T12:19:38Z",
  • "last_time_ok": "2019-12-10T12:19:38Z",
  • "last_time_unknown": "2019-12-10T12:19:38Z",
  • "last_time_warning": "2019-12-10T12:19:38Z",
  • "last_update": "2019-12-10T12:19:38Z",
  • "latency": 0,
  • "next_check": "2019-12-10T12:19:38Z",
  • "performance_data": "string",
  • "scheduled_downtime_depth": 0
}

List all services grouped by service groups

Returns all services grouped by service groups.

The available parameters to search / sort_by are:

  • host.id
  • @@ -687,7 +708,7 @@

    Information

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/servicegroups
http://localhost/centreon/api/beta/monitoring/servicegroups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all services

Returns all services.

+
get /monitoring/servicegroups
http://localhost/centreon/api/beta/monitoring/servicegroups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}

List all services

Returns all services.

The available parameters to search / sort_by are:

  • host.id
  • @@ -711,9 +732,9 @@

    Information

Responses

200

successful operation

403

Forbidden

500

Internal Server Error

-
get /monitoring/services
http://localhost/centreon/api/beta/monitoring/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}
+
get /monitoring/services
http://localhost/centreon/api/beta/monitoring/services

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "meta":
    {
    }
}