Minor codestyle and doc changes

This commit is contained in:
Jean Flach 2018-02-21 13:22:17 +01:00
parent 4b77afedcd
commit c5b92defec
6 changed files with 13 additions and 16 deletions

View File

@ -201,13 +201,12 @@ The [regex function](18-library-reference.md#global-functions-regex) is availabl
More information about filters can be found in the [filters](12-icinga2-api.md#icinga2-api-filters) chapter.
Note that the permissions a API user has also specify the max body size of their requests.
A API user with `*` permissions is allowed to send 512 MB.
Permissions are tied to a maximum HTTP request size to prevent abuse, responses sent by Icinga are not limited.
An API user with all permissions ("\*") may send up to 512 MB regardless of the endpoint.
Available permissions for specific URL endpoints:
Permissions | URL Endpoint | Supports Filters | Max Body Size in MB
Permissions | URL Endpoint | Supports filters | Max body size in MB
------------------------------|---------------|-------------------|---------------------
actions/<action> | /v1/actions | Yes | 1
config/query | /v1/config | No | 1
@ -227,8 +226,7 @@ The required actions or types can be replaced by using a wildcard match ("\*").
### Parameters <a id="icinga2-api-parameters"></a>
Depending on the request method there are two ways of
passing parameters to the request:
Depending on the request method there are two ways of passing parameters to the request:
* JSON object as request body (all request methods other than `GET`)
* Query string as URL parameter (all request methods)

View File

@ -29,7 +29,6 @@
#endif /* _WIN32 */
#define TLS_TIMEOUT_SECONDS 10
#define TLS_TIMEOUT_STEP_SECONDS 1
using namespace icinga;

View File

@ -38,7 +38,7 @@ HttpRequest::HttpRequest(const Stream::Ptr& stream)
m_State(HttpRequestStart)
{ }
bool HttpRequest::ParseHeader(StreamReadContext& src, bool may_wait)
bool HttpRequest::ParseHeaders(StreamReadContext& src, bool may_wait)
{
if (!m_Stream)
return false;

View File

@ -64,7 +64,7 @@ public:
HttpRequest(const Stream::Ptr& stream);
bool ParseHeader(StreamReadContext& src, bool may_wait);
bool ParseHeaders(StreamReadContext& src, bool may_wait);
bool ParseBody(StreamReadContext& src, bool may_wait);
size_t ReadBody(char *data, size_t count);

View File

@ -24,12 +24,13 @@
#include "remote/apifunction.hpp"
#include "remote/jsonrpc.hpp"
#include "base/base64.hpp"
#include "base/configtype.hpp"
#include "base/objectlock.hpp"
#include "base/utility.hpp"
#include "base/logger.hpp"
#include "base/exception.hpp"
#include "base/convert.hpp"
#include "base/configtype.hpp"
#include "base/exception.hpp"
#include "base/logger.hpp"
#include "base/objectlock.hpp"
#include "base/timer.hpp"
#include "base/utility.hpp"
#include <boost/thread/once.hpp>
using namespace icinga;
@ -101,7 +102,7 @@ bool HttpServerConnection::ProcessMessage(void)
if (!m_CurrentRequest.CompleteHeaders) {
try {
res = m_CurrentRequest.ParseHeader(m_Context, false);
res = m_CurrentRequest.ParseHeaders(m_Context, false);
} catch (const std::invalid_argument& ex) {
response.SetStatus(400, "Bad Request");
String msg = String("<h1>Bad Request</h1><p><pre>") + ex.what() + "</pre></p>";

View File

@ -24,7 +24,6 @@
#include "remote/httpresponse.hpp"
#include "remote/apiuser.hpp"
#include "base/tlsstream.hpp"
#include "base/timer.hpp"
#include "base/workqueue.hpp"
namespace icinga