summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorTimotej S <6674623+underhood@users.noreply.github.com>2021-09-29 14:16:42 +0200
committerGitHub <noreply@github.com>2021-09-29 14:16:42 +0200
commit96bef381474da7e136f260864595c8e8ee3fe592 (patch)
tree7f2cff7a7fe426327d5f941d89b653663877bca9 /web
parent1b22cba80bc2047b8a392a67aac6c0b7176053ec (diff)
Adds api/v1/aclk call to webserver (#11588)
Diffstat (limited to 'web')
-rw-r--r--web/api/web_api_v1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c
index f0a3ea146c..1be749b662 100644
--- a/web/api/web_api_v1.c
+++ b/web/api/web_api_v1.c
@@ -1102,6 +1102,22 @@ inline int web_client_api_request_v1_info(RRDHOST *host, struct web_client *w, c
return HTTP_RESP_OK;
}
+static int web_client_api_request_v1_aclk_state(RRDHOST *host, struct web_client *w, char *url) {
+ UNUSED(url);
+ if (!netdata_ready) return HTTP_RESP_BACKEND_FETCH_FAILED;
+
+ BUFFER *wb = w->response.data;
+ buffer_flush(wb);
+
+ char *str = aclk_state_json();
+ buffer_strcat(wb, str);
+ freez(str);
+
+ wb->contenttype = CT_APPLICATION_JSON;
+ buffer_no_cacheable(wb);
+ return HTTP_RESP_OK;
+}
+
static struct api_command {
const char *command;
uint32_t hash;
@@ -1127,6 +1143,7 @@ static struct api_command {
{ "alarm_count", 0, WEB_CLIENT_ACL_DASHBOARD, web_client_api_request_v1_alarm_count },
{ "allmetrics", 0, WEB_CLIENT_ACL_DASHBOARD, web_client_api_request_v1_allmetrics },
{ "manage/health", 0, WEB_CLIENT_ACL_MGMT, web_client_api_request_v1_mgmt_health },
+ { "aclk", 0, WEB_CLIENT_ACL_DASHBOARD, web_client_api_request_v1_aclk_state },
// terminator
{ NULL, 0, WEB_CLIENT_ACL_NONE, NULL },
};