ADD: added podinfo with building a tree hierarchy for a pod
This commit is contained in:
66
include/kubecontrol/PodInfo.hpp
Normal file
66
include/kubecontrol/PodInfo.hpp
Normal file
@@ -0,0 +1,66 @@
|
||||
#pragma once
|
||||
#include "nlohmann/json_fwd.hpp"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <string>
|
||||
#include <loguru.hpp>
|
||||
|
||||
namespace kubecontrol {
|
||||
|
||||
class PodInfo
|
||||
{
|
||||
public:
|
||||
|
||||
PodInfo();
|
||||
|
||||
PodInfo(std::string response);
|
||||
|
||||
void update(std::string response);
|
||||
|
||||
std::string ToString();
|
||||
nlohmann::json ToJson();
|
||||
|
||||
std::vector<std::string> getRelatedPods();
|
||||
|
||||
std::string Uuid;
|
||||
std::string Image;
|
||||
std::string Ip;
|
||||
std::string Component;
|
||||
std::string Status;
|
||||
std::string PartOf;
|
||||
|
||||
void addRelatedPods(std::string uuid);
|
||||
size_t relatedPodsSize();
|
||||
private:
|
||||
std::vector<std::string> relatedPods;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
// struct PodInfo
|
||||
// {
|
||||
// std::string Uuid;
|
||||
// std::string Image;
|
||||
// std::string Ip;
|
||||
// std::string Component;
|
||||
// std::string Status;
|
||||
// std::string PartOf;
|
||||
// std::vector<std::pair<std::string,std::shared_ptr<KubePod>>> relatedPods;
|
||||
|
||||
// bool operator==(PodInfo const &rhs )
|
||||
// {
|
||||
// if (Uuid == rhs.Uuid) {
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
// };
|
||||
}
|
||||
Reference in New Issue
Block a user