summaryrefslogtreecommitdiffstats
path: root/src/claim/cloud-status.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:36:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-25 11:21:20 +0000
commiteae52fdaa9298e00f14b0b6256400d200db9c373 (patch)
treea3040a19bd024295ded05370853647bab9d7c225 /src/claim/cloud-status.h
parentAdding upstream version 1.47.5. (diff)
downloadnetdata-eae52fdaa9298e00f14b0b6256400d200db9c373.tar.xz
netdata-eae52fdaa9298e00f14b0b6256400d200db9c373.zip
Adding upstream version 2.0.3.upstream/2.0.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/claim/cloud-status.h')
-rw-r--r--src/claim/cloud-status.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/claim/cloud-status.h b/src/claim/cloud-status.h
new file mode 100644
index 000000000..648c114f9
--- /dev/null
+++ b/src/claim/cloud-status.h
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef NETDATA_CLOUD_STATUS_H
+#define NETDATA_CLOUD_STATUS_H
+
+#include "daemon/common.h"
+
+typedef enum __attribute__((packed)) {
+ CLOUD_STATUS_AVAILABLE = 1, // cloud and aclk functionality is available, but the agent is not claimed
+ CLOUD_STATUS_BANNED, // the agent has been banned from cloud
+ CLOUD_STATUS_OFFLINE, // the agent tries to connect to cloud, but cannot do it
+ CLOUD_STATUS_INDIRECT, // the agent is connected to cloud via a parent
+ CLOUD_STATUS_ONLINE, // the agent is connected to cloud
+} CLOUD_STATUS;
+
+const char *cloud_status_to_string(CLOUD_STATUS status);
+CLOUD_STATUS cloud_status(void);
+
+time_t cloud_last_change(void);
+time_t cloud_next_connection_attempt(void);
+size_t cloud_connection_id(void);
+const char *cloud_status_aclk_offline_reason(void);
+const char *cloud_status_aclk_base_url(void);
+CLOUD_STATUS buffer_json_cloud_status(BUFFER *wb, time_t now_s);
+
+#endif //NETDATA_CLOUD_STATUS_H