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