diff options
author | Andrew Moss <1043609+amoss@users.noreply.github.com> | 2020-03-30 15:03:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-30 15:03:24 +0200 |
commit | d6f0703a09e33aa6fdafe51026953be30cdaa03e (patch) | |
tree | 912cc92b2c2471bb9eb62eabd0198dd805ef9c99 /web | |
parent | 71e1ef8c38181ea5bb491b020f30eeb11c10069f (diff) |
Updating the info endpoint for cloud notifications (#8519)
Diffstat (limited to 'web')
-rw-r--r-- | web/api/web_api_v1.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c index c15197fb63..d0dd0cd014 100644 --- a/web/api/web_api_v1.c +++ b/web/api/web_api_v1.c @@ -807,6 +807,7 @@ inline void host_labels2json(RRDHOST *host, BUFFER *wb, size_t indentation) { rrdhost_unlock(host); } +extern int aclk_connected; inline int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb) { buffer_strcat(wb, "{\n"); @@ -872,9 +873,15 @@ inline int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb) buffer_strcat(wb, "\t\"cloud-available\": false,\n"); #endif if (is_agent_claimed() == NULL) - buffer_strcat(wb, "\t\"agent-claimed\": false\n"); + buffer_strcat(wb, "\t\"agent-claimed\": false,\n"); else - buffer_strcat(wb, "\t\"agent-claimed\": true\n"); + buffer_strcat(wb, "\t\"agent-claimed\": true,\n"); +#ifdef ENABLE_ACLK + if (aclk_connected) + buffer_strcat(wb, "\t\"aclk-available\": true\n"); + else +#endif + buffer_strcat(wb, "\t\"aclk-available\": false\n"); // Intentionally valid with/without #ifdef above buffer_strcat(wb, "}"); return 0; |