master
h 28 lines 1.03 KB
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #ifndef NETDATA_CLOUD_STATUS_H
4 #define NETDATA_CLOUD_STATUS_H
5
6 #include "libnetdata/libnetdata.h"
7 #include "claim/cloud-status.h"
8
9 typedef enum __attribute__((packed)) {
10 CLOUD_STATUS_AVAILABLE = 1, // cloud and aclk functionality is available, but the agent is not claimed
11 CLOUD_STATUS_BANNED, // the agent has been banned from cloud
12 CLOUD_STATUS_OFFLINE, // the agent tries to connect to cloud, but cannot do it
13 CLOUD_STATUS_INDIRECT, // the agent is connected to cloud via a parent
14 CLOUD_STATUS_ONLINE, // the agent is connected to cloud
15 } CLOUD_STATUS;
16
17 ENUM_STR_DEFINE_FUNCTIONS_EXTERN(CLOUD_STATUS);
18
19 CLOUD_STATUS cloud_status(void);
20
21 time_t cloud_last_change(void);
22 time_t cloud_next_connection_attempt(void);
23 size_t cloud_connection_id(void);
24 const char *cloud_status_aclk_offline_reason(void);
25 const char *cloud_status_aclk_base_url(void);
26 CLOUD_STATUS buffer_json_cloud_status(BUFFER *wb, time_t now_s);
27
28 #endif //NETDATA_CLOUD_STATUS_H