master
c 19 lines 481 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #include "api_v1_calls.h"
4
5 int api_v1_aclk(RRDHOST *host, struct web_client *w, char *url) {
6 UNUSED(url);
7 UNUSED(host);
8 if (!netdata_ready_load()) return HTTP_RESP_SERVICE_UNAVAILABLE;
9
10 BUFFER *wb = w->response.data;
11 buffer_flush(wb);
12 char *str = aclk_state_json();
13 buffer_strcat(wb, str);
14 freez(str);
15
16 wb->content_type = CT_APPLICATION_JSON;
17 buffer_no_cacheable(wb);
18 return HTTP_RESP_OK;
19 }