mirror of https://github.com/Icinga/icinga2.git
Minor codestyle and doc changes
This commit is contained in:
parent
4b77afedcd
commit
c5b92defec
|
@ -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)
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#endif /* _WIN32 */
|
||||
|
||||
#define TLS_TIMEOUT_SECONDS 10
|
||||
#define TLS_TIMEOUT_STEP_SECONDS 1
|
||||
|
||||
using namespace icinga;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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>";
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue