33 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
Yonas Habteab
546dea95a2 Don't allow to modify/create/delete an object concurrently 2024-06-13 11:26:19 +02:00
Alexander A. Klimov
9376a311ea Fix file endings
git ls-files -z \
	|grep -zEe '^lib/' \
	|grep -zEe '\.[ch]pp$' \
	|xargs -0 perl -p0i -e 's/\n*(?!(?:.|\n))/\n/'
2023-05-17 18:05:13 +02:00
Alexander A. Klimov
2ee776b5ab Disallow config modifications via API during reload
Once the new main process has read the config,
it misses subsequent modifications from the old process otherwise.
2023-04-12 14:45:40 +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
c4a6ab0211 Add diagnostic_information as verbose error to config object handlers 2018-04-06 12:26:49 +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
Michael Friedrich
b7caf0820d Ensure that *.icinga.com is used everywhere
fixes #13897
fixes #13277
2017-01-10 17:19:12 +01:00
Gunnar Beutner
288413f046 Replace BOOST_FOREACH with range-based for loops
fixes #12538
2016-08-25 06:46:17 +02:00
Michael Friedrich
9a88185b12 API: Fix error handling for invalid JSON request body
fixes #11757
2016-05-10 15:16:35 +02:00
Jean Flach
9cdea730a3 Fix delete object handler returning incorrect status codes
Now a 200 OK only gets returned if all objects could be deleted

fixes #10770
2016-03-01 16:53:52 +01: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
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
Michael Friedrich
6549721ec6 Ensure that multiple object handler request methods still work
refs #10194
2015-09-27 15:27:08 +02:00
Jean-Marcel Flach
5ef4204d06 Improve API error handling and fix some whitespace
fixes #10194
2015-09-25 13:57:28 +02:00
Gunnar Beutner
06f02f8b10 Implement reflection support for the API
fixes #9076
2015-08-26 10:58:59 +02:00
Gunnar Beutner
de09a562f6 Use dependency graph when deleting objects
refs #9096
2015-08-26 06:35:06 +02:00
Gunnar Beutner
0cbcb75e79 Ensure that runtime config objects are persisted on disk
refs #9101
fixes #9926
2015-08-18 14:21:55 +02:00
Gunnar Beutner
60a30d50f6 Don't allow users to delete objects that weren't created using the API
refs #9082
2015-08-18 08:22:14 +02:00
Gunnar Beutner
071d2f18fb Rename DynamicObject/DynamicType to ConfigObject/ConfigType
fixes #9914
2015-08-15 20:40:41 +02:00
Gunnar Beutner
e2290d5012 Implement support for unregistering objects
refs #9101
2015-08-15 20:07:11 +02:00