|
|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
#define JSON_RETRIEVE_H
|
|
|
|
|
#include <ArduinoJson.h>
|
|
|
|
|
|
|
|
|
|
/// @brief Struct to store information about a node in appropriate data types.
|
|
|
|
|
typedef struct {
|
|
|
|
|
String name;
|
|
|
|
|
float cpu;
|
|
|
|
|
@ -14,6 +15,7 @@ typedef struct {
|
|
|
|
|
long long uptime;
|
|
|
|
|
} Node;
|
|
|
|
|
|
|
|
|
|
/// @brief Struct to store information about a container in appropriate data types.
|
|
|
|
|
typedef struct {
|
|
|
|
|
String name;
|
|
|
|
|
int id;
|
|
|
|
|
@ -23,6 +25,7 @@ typedef struct {
|
|
|
|
|
long long uptime;
|
|
|
|
|
} Container;
|
|
|
|
|
|
|
|
|
|
/// @brief Struct to store information about a VM in appropriate data types.
|
|
|
|
|
typedef struct {
|
|
|
|
|
String name;
|
|
|
|
|
int id;
|
|
|
|
|
@ -34,7 +37,7 @@ typedef struct {
|
|
|
|
|
long long netout;
|
|
|
|
|
} VM;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// @brief Struct to store information about a disk in appropriate data types.
|
|
|
|
|
typedef struct {
|
|
|
|
|
String devpath;
|
|
|
|
|
long long size;
|
|
|
|
|
@ -45,6 +48,7 @@ typedef struct {
|
|
|
|
|
String health;
|
|
|
|
|
} Disk;
|
|
|
|
|
|
|
|
|
|
/// @brief Struct to store information about a pool in appropriate data types.
|
|
|
|
|
typedef struct {
|
|
|
|
|
String name;
|
|
|
|
|
long long free;
|
|
|
|
|
@ -52,12 +56,14 @@ typedef struct {
|
|
|
|
|
String health;
|
|
|
|
|
} Pool;
|
|
|
|
|
|
|
|
|
|
// Function declarations
|
|
|
|
|
Node *getNodeInfo(int &numNodes);
|
|
|
|
|
Container *getContainerInfo(int &numContainers, const String &node);
|
|
|
|
|
VM *getVMInfo(int &numVMs, const String &node);
|
|
|
|
|
Disk *getDiskInfo(int &numDisks, const String &node);
|
|
|
|
|
Pool *getPoolInfo(int &numPools, const String &node);
|
|
|
|
|
|
|
|
|
|
/// @brief Template for a callback function for processing JSON data in to an appropriate struct.
|
|
|
|
|
typedef void (*ProcessDataCallback)(DynamicJsonDocument&, int&, void*&);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|