Files
KubeControl/include/kubecontrol/KubePod.hpp
2023-10-13 14:16:03 +02:00

80 lines
2.2 KiB
C++

#pragma once
#include "kubecontrol/PodInfo.hpp"
#include "nlohmann/json_fwd.hpp"
#include "yaml-cpp/node/node.h"
#include <map>
#include <string>
#include <vector>
#include <yaml-cpp/yaml.h>
#include <fstream>
#include <curlpp/Easy.hpp>
#include <curlpp/Options.hpp>
#include <kubecontrol/WriterMemoryClass.hpp>
#include <loguru.hpp>
#include <nlohmann/json.hpp>
#include <curlpp/cURLpp.hpp>
#include <filesystem>
#include <map>
#include <vector>
namespace kubecontrol
{
class KubePod
{
public:
KubePod(std::string Owner, std::string Uuid, std::string ContainerImage,std::string Namespace = "simulator");
KubePod(std::string Owner, std::string Uuid, std::string Component, std::string ContainerImage,std::string Namespace = "simulator");
std::string getUUID();
std::string getOwner();
void setEnvironmentVar(std::string key, std::string val);
std::map<std::string, std::string> GetEnvironmentVars();
std::string GetEnvironmentVar(std::string key);
void setArgs(std::string args);
std::vector<std::string> GetArgs();
void setCommand(std::string command);
std::string getCommand();
void setComponent(std::string component);
std::string getComponent();
std::string createYAML();
std::string start(std::string apiAddress,std::string token);
std::string stop(std::string apiAddress,std::string token);
std::string getInfo(std::string apiAddress,std::string token);
PodInfo InfoPod;
private:
std::string Owner_;
std::string Uuid_;
std::string Component_;
std::string ContainerImage_;
std::string ContainerRegistry_;
std::string PathToYaml_;
std::string Namespace_;
std::string PodCommand_;
YAML::Node YAMLNode_;
std::map<std::string, std::string> EnvirmonentVars_;
std::vector<std::string> Args_;
std::string StopChilds(std::string apiAddress,std::string token,std::string uuid);
};
}