39 Commits

Author SHA1 Message Date
Johannes Schmidt
82bb636d2b Use WaitGroup to wait for or abort HTTP requests
The wait group gets passed to HttpServerConnection, then down to the
HttpHandlers. For those handlers that modify the program state, the
wait group is locked so ApiListener will wait on Stop() for the
request to complete. If the request iterates over config objects,
a further check on the state of the wait group is added to abort early
and not delay program shutdown. In that case, 503 responses will be
sent to the client.

Additionally, in HttpServerConnection, no further requests than the
one already started will be allowed once the wait group is joining.
2025-06-13 14:48:15 +02:00
Alexander A. Klimov
c2ddd20ef3 Fix compiler warnings by (copy-)constructing loop variables explicitly
for (const T& needle : haystack) creates the illusion that haystack is a
container of T and we're just borrowing needle. In these cases that's not true.
2025-04-22 13:55:49 +02:00
Alexander A. Klimov
e18c923abb GET /v1/objects/*: handle "attrs":[] as expected
... i.e. yield no attrs and not all.

refs #8167
2025-01-21 11:36:55 +01:00
Alexander A. Klimov
3a09cf72d6 DependencyGraph: use ConfigObject*, not Object*
This saves dynamic_cast<ConfigObject*> + if() on every item of GetChildren().
2024-12-17 18:33:05 +01:00
Alexander A. Klimov
188ba53b74 DependencyGraph: switch "parent" and "child" terminology
The .ti files call `DependencyGraph::AddDependency(this, service.get())`. Obviously, `service.get()` is the parent and `this` (Downtime, Notification, ...) is the child. The DependencyGraph terminology should reflect this not to confuse its future users.
2024-12-04 10:57:30 +01:00
Yonas Habteab
c1f73fbc1d FilterUtility: Replace some nested raw pointers by our unique_ptr<X>* 2022-11-28 14:50:54 +01:00
Yonas Habteab
72e6894bbb Evaluate permission filters also on all joined relations 2022-10-10 12:33:33 +02:00
Yonas Habteab
607f7ab5ca ObjectQueryHandler: Check user permissions on joined relations 2022-10-10 12:33:33 +02:00
Alexander A. Klimov
c284cf0b68 HttpServerConnection: encapsulate streaming start indicator 2019-04-02 17:37:29 +02:00
Alexander A. Klimov
fd239ba3fe Adjust /v1/events, too 2019-04-01 11:40:14 +02:00
Alexander A. Klimov
1941c1da28 Adjust all HTTP handlers (ex. /v1/events) 2019-04-01 11:40:14 +02:00
Michael Friedrich
d14a88235d Replace Copyright header with a short version, part I
CLion -> replace in path
2019-02-25 14:48:22 +01:00
Michael Friedrich
dab53448bc icinga.com: Update *.{h,c}pp 2018-10-18 09:27:04 +02:00
Michael Friedrich
3e83e94c15 Fix object and status query verbose errors 2018-04-06 12:47:20 +02:00
Gunnar Beutner
94e6be1a65 Remove unused includes 2018-01-22 09:52:29 +01:00
Gunnar Beutner
c2fb9fe226 Use initializer lists for arrays and dictionaries 2018-01-16 12:27:44 +01:00
Michael Friedrich
d073a807b0 API: Add 'pretty' parameter for beautified JSON response bodies
fixes #5877
2018-01-08 20:55:36 +01:00
Michael Insel
158ae2188e Change copyright header for 2018 2018-01-02 12:08:55 +01:00
Jean Flach
2636e6a77a Whitespace fix
What does this change?
* Remove use of spaces for formatting
These could be found by using `grep -r -l -P '^\t+ +[^*]'
* Removal of training whitespaces
* A few lines longer than 120 chars
2017-12-20 14:53:52 +01:00
Gunnar Beutner
42744fde5b Remove extraneous whitespace 2017-12-14 08:50:09 +01:00
Stefar77
6b66e332fb API: Fix requested attrs/joins/meta type errors in object query response
fixes #5377

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
2017-08-11 16:23:29 +02:00
Gunnar Beutner
2d9be77260 Clean up the code a bit
refs #4991
2017-03-29 10:17:03 +02:00
Michael Friedrich
b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Gunnar Beutner
602643b93d Provide location information for objects and templates in the API
fixes #12566
2016-08-27 19:25:38 +02:00
Gunnar Beutner
288413f046 Replace BOOST_FOREACH with range-based for loops
fixes #12538
2016-08-25 06:46:17 +02:00
Gunnar Beutner
b7a1b58069 Improve performance for type lookups
fixes #12448
2016-08-16 11:02:33 +02:00
Michael Friedrich
9a88185b12 API: Fix error handling for invalid JSON request body
fixes #11757
2016-05-10 15:16:35 +02:00
Gunnar Beutner
09165e5ca6 Only hide navigational attributes which are not config/state
fixes #11567
2016-04-13 12:02:08 +02:00
Michael Friedrich
3227186c7d Fix: API queries on non-existant objects cause exception
fixes #11088
2016-02-04 22:40:01 +01:00
Gunnar Beutner
599929b0f6 Update copyright headers for 2016 2016-01-12 08:29:59 +01:00
Michael Friedrich
284a10150b Fix attributes names for joins; update documentation
refs #10551
fixes #10576
2015-11-11 13:50:47 +01:00
Gunnar Beutner
a177e5e05a Change output format for object queries
fixes #10551
2015-11-06 14:45:38 +01:00
Gunnar Beutner
d01f09f3ef Hide internal attributes in the API
fixes #10393
2015-10-20 08:25:10 +02:00
Gunnar Beutner
f841daf680 Improve performance for object queries
fixes #10360
2015-10-14 16:08:23 +02:00
Gunnar Beutner
48d80e29a0 Don't look up joined objects when we don't need to
refs #10360
2015-10-14 15:36:59 +02:00
Michael Friedrich
f498ce39f3 Improve api error handling
refs #10194
2015-09-28 16:08:14 +02:00
Gunnar Beutner
425a1a0166 Implement API permissions
fixes #9088
2015-09-28 14:30:46 +02:00
Gunnar Beutner
8a5d71a565 Move /v1/<type> to /v1/objects/<type>
refs #10212
2015-09-28 08:39:56 +02:00
Jean-Marcel Flach
15a46958f0 Rename statusqueryhandler to objectqueryhandler
fixes #10209
2015-09-24 17:38:44 +02:00