mirror of https://github.com/Icinga/icinga2.git
Minor codestyle and doc changes
This commit is contained in:
parent
2823ebb831
commit
85f45d9b94
|
@ -208,13 +208,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.
|
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.
|
Permissions are tied to a maximum HTTP request size to prevent abuse, responses sent by Icinga are not limited.
|
||||||
A API user with `*` permissions is allowed to send 512 MB.
|
An API user with all permissions ("\*") may send up to 512 MB regardless of the endpoint.
|
||||||
|
|
||||||
|
|
||||||
Available permissions for specific URL endpoints:
|
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
|
actions/<action> | /v1/actions | Yes | 1
|
||||||
config/query | /v1/config | No | 1
|
config/query | /v1/config | No | 1
|
||||||
|
@ -234,8 +233,7 @@ The required actions or types can be replaced by using a wildcard match ("\*").
|
||||||
|
|
||||||
### Parameters <a id="icinga2-api-parameters"></a>
|
### Parameters <a id="icinga2-api-parameters"></a>
|
||||||
|
|
||||||
Depending on the request method there are two ways of
|
Depending on the request method there are two ways of passing parameters to the request:
|
||||||
passing parameters to the request:
|
|
||||||
|
|
||||||
* JSON object as request body (all request methods other than `GET`)
|
* JSON object as request body (all request methods other than `GET`)
|
||||||
* Query string as URL parameter (all request methods)
|
* Query string as URL parameter (all request methods)
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
#define TLS_TIMEOUT_SECONDS 10
|
#define TLS_TIMEOUT_SECONDS 10
|
||||||
#define TLS_TIMEOUT_STEP_SECONDS 1
|
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ HttpRequest::HttpRequest(Stream::Ptr stream)
|
||||||
m_State(HttpRequestStart)
|
m_State(HttpRequestStart)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
bool HttpRequest::ParseHeader(StreamReadContext& src, bool may_wait)
|
bool HttpRequest::ParseHeaders(StreamReadContext& src, bool may_wait)
|
||||||
{
|
{
|
||||||
if (!m_Stream)
|
if (!m_Stream)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
|
|
||||||
HttpRequest(Stream::Ptr stream);
|
HttpRequest(Stream::Ptr stream);
|
||||||
|
|
||||||
bool ParseHeader(StreamReadContext& src, bool may_wait);
|
bool ParseHeaders(StreamReadContext& src, bool may_wait);
|
||||||
bool ParseBody(StreamReadContext& src, bool may_wait);
|
bool ParseBody(StreamReadContext& src, bool may_wait);
|
||||||
size_t ReadBody(char *data, size_t count);
|
size_t ReadBody(char *data, size_t count);
|
||||||
|
|
||||||
|
|
|
@ -24,12 +24,13 @@
|
||||||
#include "remote/apifunction.hpp"
|
#include "remote/apifunction.hpp"
|
||||||
#include "remote/jsonrpc.hpp"
|
#include "remote/jsonrpc.hpp"
|
||||||
#include "base/base64.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/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>
|
#include <boost/thread/once.hpp>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
@ -101,7 +102,7 @@ bool HttpServerConnection::ProcessMessage()
|
||||||
|
|
||||||
if (!m_CurrentRequest.CompleteHeaders) {
|
if (!m_CurrentRequest.CompleteHeaders) {
|
||||||
try {
|
try {
|
||||||
res = m_CurrentRequest.ParseHeader(m_Context, false);
|
res = m_CurrentRequest.ParseHeaders(m_Context, false);
|
||||||
} catch (const std::invalid_argument& ex) {
|
} catch (const std::invalid_argument& ex) {
|
||||||
response.SetStatus(400, "Bad Request");
|
response.SetStatus(400, "Bad Request");
|
||||||
String msg = String("<h1>Bad Request</h1><p><pre>") + ex.what() + "</pre></p>";
|
String msg = String("<h1>Bad Request</h1><p><pre>") + ex.what() + "</pre></p>";
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#include "remote/httpresponse.hpp"
|
#include "remote/httpresponse.hpp"
|
||||||
#include "remote/apiuser.hpp"
|
#include "remote/apiuser.hpp"
|
||||||
#include "base/tlsstream.hpp"
|
#include "base/tlsstream.hpp"
|
||||||
#include "base/timer.hpp"
|
|
||||||
#include "base/workqueue.hpp"
|
#include "base/workqueue.hpp"
|
||||||
|
|
||||||
namespace icinga
|
namespace icinga
|
||||||
|
|
Loading…
Reference in New Issue