Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
feat(api): add eventlog listing (#8381)
Browse files Browse the repository at this point in the history
* Adapt font regexp path for Windows (#8375)

* enh(apiv2): add event listing for hosts and services
Resolves: MON-4866, MON-4867

* enh(apiv2): add event listing for hosts and services
Resolves: MON-4866, MON-4867

* fix(doc): regenerate html for doc

* feat(ui): Implement Resources listing (#8371)

* fix(tests): update error message on unit test

* Fix the search parameter 'IN' (#8380)

* fix(doc): fix scrollbar issue in API documentation (#8378)

* feat(build): stash git sources for Sonar analysis.

* feat(ui): Implement Unified view search (#8382)

* feat(build): fail build on front-end style errors.

* enh(doc): update docblock in interface

* fix: fix ESLint warnings

* doc(api): document how to use search parameter with API (#8376)

* fix(test): improve unit test SqlRequestParametersTranslatorTest::testTranslateSortParameterToSql

* fix(configuration): export hosts geo_coords to remote server (#8390)

* fix(ldap): use define user member_attribute var (#8287)

* fix(ldap): use define user member_attribute var

* fix(code): use PSR2

* feat(ui): Implement Unified view downtime and acknowledge tooltips (#8385)

* fix(code): Clean switch case service monitoring (#8285)

* fix(code): dedicated meta event console does not exist anymore

* fix(code): scheduling queue console does not exist anymore

* fix(code): merge some cases

Co-authored-by: Colin Gagnaire <cgagnaire@centreon.com>

* fix(remote-server): fix import with strict mode (#7944)

Refs: MON-7944

* doc(api): document how to generate html api documentation (#8394)

* feat(doc): update the API documentation (#8393)

* feat(doc): update the API documentation

Resolve MON-4887

* fix(doc): apply feedback from PR

Resolve MON-4887

* fix(doc): remove again api html documentation

* Update src/Centreon/Domain/Monitoring/Entity/DowntimeEventObject.php

Co-Authored-By: Kevin Duret <kduret@centreon.com>

* Update src/Centreon/Domain/Monitoring/Interfaces/TimelineRepositoryInterface.php

Co-Authored-By: Kevin Duret <kduret@centreon.com>

* Update src/Centreon/Domain/Monitoring/Interfaces/EventObjectInterface.php

Co-Authored-By: Kevin Duret <kduret@centreon.com>

* Update package-lock

* enh(apiv2): add event listing for hosts and services
Resolves: MON-4866, MON-4867

* fix(doc): regenerate html for doc

* fix(tests): update error message on unit test

* enh(doc): update docblock in interface

* Update src/Centreon/Domain/Monitoring/Entity/DowntimeEventObject.php

Co-Authored-By: Kevin Duret <kduret@centreon.com>

* Update src/Centreon/Domain/Monitoring/Interfaces/TimelineRepositoryInterface.php

Co-Authored-By: Kevin Duret <kduret@centreon.com>

* Update src/Centreon/Domain/Monitoring/Interfaces/EventObjectInterface.php

Co-Authored-By: Kevin Duret <kduret@centreon.com>

* resolve conflict with html doc

Co-authored-by: Tom Darneix <tomdar87@outlook.com>
Co-authored-by: Bruno d'Auria <bdauria@centreon.com>
Co-authored-by: Laurent Calvet <lcalvet@centreon.com>
Co-authored-by: Kevin Duret <kduret@centreon.com>
Co-authored-by: Matthieu Kermagoret <mkermagoret@centreon.com>
Co-authored-by: Valentin Hristov <vhr@users.noreply.github.com>
Co-authored-by: Colin Gagnaire <cgagnaire@centreon.com>
  • Loading branch information
8 people authored Mar 6, 2020
1 parent a06651f commit 2467ebd
Show file tree
Hide file tree
Showing 30 changed files with 2,962 additions and 9 deletions.
7 changes: 7 additions & 0 deletions config/Modules/Centreon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,10 @@ services:
calls:
- method: setSqlRequestTranslator
arguments: ['@sqlRequestTranslator']

# Monitoring Timeline
Centreon\Domain\Monitoring\Interfaces\TimelineRepositoryInterface:
class: Centreon\Infrastructure\Monitoring\TimelineRepositoryRDB
calls:
- method: setSqlRequestTranslator
arguments: ['@sqlRequestTranslator']
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Centreon\Domain\Acknowledgement\Acknowledgement:
type: int
groups:
- 'ack_main'
- 'ack_event_list'
authorId:
type: int
groups:
Expand All @@ -12,14 +13,17 @@ Centreon\Domain\Acknowledgement\Acknowledgement:
type: string
groups:
- 'ack_main'
- 'ack_event_list'
deletionTime:
type: DateTime
groups:
- 'ack_main'
- 'ack_event_list'
entryTime:
type: DateTime
groups:
- 'ack_main'
- 'ack_event_list'
hostId:
type: int
groups:
Expand All @@ -32,19 +36,23 @@ Centreon\Domain\Acknowledgement\Acknowledgement:
type: bool
groups:
- 'ack_main'
- 'ack_event_list'
isPersistentComment:
type: bool
groups:
- 'ack_main'
- 'ack_event_list'
isSticky:
type: bool
groups:
- 'ack_main'
- 'ack_event_list'
serviceId:
type: int
groups:
- 'ack_service'
state:
type: int
groups:
- 'ack_main'
- 'ack_main'
- 'ack_event_list'
14 changes: 13 additions & 1 deletion config/packages/serializer/Centreon/Downtime.Downtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ Centreon\Domain\Downtime\Downtime:
type: int
groups:
- 'downtime_main'
- 'downtime_event_list'
entryTime:
type: DateTime
groups:
- 'downtime_main'
- 'downtime_event_list'
authorId:
type: int
groups:
Expand All @@ -24,28 +26,34 @@ Centreon\Domain\Downtime\Downtime:
type: bool
groups:
- 'downtime_main'
- 'downtime_event_list'
comment:
type: string
groups:
- 'downtime_main'
- 'downtime_event_list'
deletionTime:
type: DateTime
groups:
- 'downtime_main'
- 'downtime_event_list'
duration:
type: int
groups:
- 'downtime_main'
- 'downtime_event_list'
endTime:
type: DateTime<'Y-m-d\TH:i:sP'>
groups:
- 'downtime_main'
- 'downtime_event_list'
internalId:
type: int
isFixed:
type: bool
groups:
- 'downtime_main'
- 'downtime_event_list'
pollerId:
type: int
groups:
Expand All @@ -54,15 +62,19 @@ Centreon\Domain\Downtime\Downtime:
type: DateTime<'Y-m-d\TH:i:sP'>
groups:
- 'downtime_main'
- 'downtime_event_list'
actualStartTime:
type: DateTime
groups:
- 'downtime_main'
- 'downtime_event_list'
actualEndTime:
type: DateTime
groups:
- 'downtime_main'
- 'downtime_event_list'
isStarted:
type: bool
groups:
- 'downtime_main'
- 'downtime_main'
- 'downtime_event_list'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Centreon\Domain\Monitoring\Entity\AckEventObject:
properties:
id:
type: int
groups:
- 'ack_event_list'
author:
type: string
groups:
- 'ack_event_list'
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Centreon\Domain\Monitoring\Entity\CommentEventObject:
properties:
id:
type: int
groups:
- 'comment_event_list'
- 'comment_event_full'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Centreon\Domain\Monitoring\Entity\DowntimeEventObject:
properties:
id:
type: int
groups:
- 'downtime_event_list'
author:
type: string
groups:
- 'downtime_event_list'
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Centreon\Domain\Monitoring\Entity\LogEventObject:
properties:
id:
type: int
groups:
- 'log_event_list'
- 'log_event_full'
27 changes: 27 additions & 0 deletions config/packages/serializer/Centreon/Monitoring.Model.Comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Centreon\Domain\Monitoring\Model\Comment:
properties:
id:
type: int
groups:
- 'comment_event_list'
- 'comment_event_full'
entryTime:
type: DateTime<'Y-m-d\TH:i:sP'>
groups:
- 'comment_event_list'
- 'comment_event_full'
data:
type: string
groups:
- 'comment_event_list'
- 'comment_event_full'
author:
type: string
groups:
- 'comment_event_list'
- 'comment_event_full'
persistent:
type: int
groups:
- 'comment_event_list'
- 'comment_event_full'
46 changes: 46 additions & 0 deletions config/packages/serializer/Centreon/Monitoring.Model.Log.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Centreon\Domain\Monitoring\Model\Log:
properties:
id:
type: int
groups:
- 'log_event_list'
- 'log_event_full'
output:
type: string
groups:
- 'log_event_list'
- 'log_event_full'
createTime:
type: DateTime<'Y-m-d\TH:i:sP'>
groups:
- 'log_event_list'
- 'log_event_full'
status:
type: string
accessor:
getter: getStatusText
groups:
- 'log_event_list'
- 'log_event_full'
type:
type: string
accessor:
getter: getTypeText
groups:
- 'log_event_list'
- 'log_event_full'
retry:
type: int
groups:
- 'log_event_list'
- 'log_event_full'
contact:
type: string
groups:
- 'log_event_list'
- 'log_event_full'
command:
type: string
groups:
- 'log_event_list'
- 'log_event_full'
18 changes: 18 additions & 0 deletions config/packages/serializer/Centreon/Monitoring.TimelineEvent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Centreon\Domain\Monitoring\TimelineEvent:
virtual_properties:
getType:
serialized_name: type
groups:
- 'timeline_list'
getId:
serialized_name: id
groups:
- 'timeline_list'
getTimestamp:
serialized_name: date
groups:
- 'timeline_list'
properties:
object:
groups:
- 'timeline_list'
12 changes: 12 additions & 0 deletions config/routes/Centreon/monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,16 @@ centreon_application_monitoring_gethostgroupsbyhost:
methods: GET
path: /monitoring/hosts/{hostId}/hostgroups
controller: 'Centreon\Application\Controller\MonitoringHostsController::getHostGroupsByHost'
condition: "request.attributes.get('version.is_beta') == true"

centreon_application_monitoring_gettimelinebyhostandservice:
methods: GET
path: /monitoring/hosts/{hostId}/services/{serviceId}/timeline
controller: 'Centreon\Application\Controller\MonitoringServicesController::getServiceTimeline'
condition: "request.attributes.get('version.is_beta') == true"

centreon_application_monitoring_gettimelinebyhost:
methods: GET
path: /monitoring/hosts/{hostId}/timeline
controller: 'Centreon\Application\Controller\MonitoringHostsController::getHostTimeline'
condition: "request.attributes.get('version.is_beta') == true"
842 changes: 842 additions & 0 deletions doc/API/centreon-api-v2.html

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions doc/API/centreon-api-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,44 @@ paths:
description: "Host or service not found"
'500':
$ref: '#/components/responses/InternalServerError'

/monitoring/hosts/{host_id}/timeline:
get:
tags:
- Timeline
summary: "List events related to a host"
description: |
List all events for a given host
The available parameters to **search** / **sort_by** are:
* date
parameters:
- $ref: '#/components/parameters/HostId'
- $ref: '#/components/parameters/Search'
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/SortBy'
responses:
'200':
description: "OK"
content:
application/json:
schema:
type: object
properties:
result:
type: array
items:
$ref: '#/components/schemas/Monitoring.TimelineEvent'
meta:
$ref: '#/components/schemas/Meta'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServerError'
components:
securitySchemes:
Token:
Expand Down Expand Up @@ -2779,3 +2817,21 @@ components:
- port
- user
- password
Monitoring.TimelineEvent:
type: object
properties:
type:
type: string
description: "Type of Event (L - log, C - Comment, A - Acknowledgement, D - Downtime"
example: "C"
id:
type: string
description: "Concatinated ID of Type + Object ID"
example: "C25"
date:
type: string
format: date-time
description: "The date the event was created (ISO8601)"
object:
type: object
description: "The detailed object properties of above types"
Loading

0 comments on commit 2467ebd

Please sign in to comment.