ADD: added central kubernetes api class

This commit is contained in:
Henry Winkel
2023-12-21 17:15:28 +01:00
parent d1024de907
commit 351cf9ec69
12 changed files with 514 additions and 128 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "kubecontrol/KubernetesAPI.hpp"
#include "kubecontrol/PodInfo.hpp"
#include "nlohmann/json_fwd.hpp"
#include "yaml-cpp/node/node.h"
@@ -45,16 +46,36 @@ namespace kubecontrol
std::string getComponent();
std::string createYAML();
std::string start(std::string apiAddress,std::string token);
// [[deprecated("replace with start(KubernetesAPI APIInterface)")]]
// std::string start(std::string apiAddress,std::string token,bool WaitTillRunning = true);
std::string start(KubernetesAPI APIInterface,bool WaitTillRunning = true);
[[deprecated("replace with stop(KubernetesAPI APIInterface)")]]
std::string stop(std::string apiAddress,std::string token);
std::string getInfo(std::string apiAddress,std::string token);
std::string stop(KubernetesAPI APIInterface);
// [[deprecated("replace with getInfo(KubernetesAPI APIInterface)")]]
// std::string getInfo(std::string apiAddress,std::string token);
std::string getInfoForThisPod(KubernetesAPI APIInterface);
std::string getInfoForRelatedPods(KubernetesAPI APIInterface);
std::vector<std::string> getUUIDForRelatedPods(KubernetesAPI APIInterface);
PodInfo InfoPod;
private:
std::string Owner_;
std::string Uuid_;
std::string Component_;
@@ -63,6 +84,10 @@ namespace kubecontrol
std::string PathToYaml_;
std::string Namespace_;
std::string Ip_;
std::string Status_;
std::string PartOf_;
std::vector<std::string> uuidsOfShildContainers;
std::string PodCommand_;
@@ -71,9 +96,12 @@ namespace kubecontrol
std::map<std::string, std::string> EnvirmonentVars_;
std::vector<std::string> Args_;
std::string createYAML();
// std::string read;
std::string StopChilds(std::string apiAddress,std::string token,std::string uuid);
std::string StopChilds(std::string apiAddress,std::string token,std::string uuid);
};
}