Files
KubeControl/include/kubecontrol/PodController.hpp

49 lines
1.3 KiB
C++

#pragma once
#include "kubecontrol/PodInfo.hpp"
#include <kubecontrol/KubePod.hpp>
#include <memory>
#include <string>
#include <vector>
namespace kubecontrol
{
class PodController
{
public:
PodController(std::string pathToKubectlConfig);
std::string getServerAddress();
void startPod(KubePod Pod);
void stopPod(std::string Label);
void stopAllPods();
std::string getPodsInfo();
std::string getInfoForOwnPod();
std::string getInfoForPod(std::string Label);
void checkPodsHierarchy();
std::string getPodsInfoForAll();
std::shared_ptr<PodInfo> getPodsInfo(std::string uuid);
private:
std::vector<KubePod> PodList_;
std::string performRequest(std::string url);
void performForceStopRequest(std::string uuid);
std::string BearerToken_;
std::string ServerAddress_;
std::string Namespace_;
std::string ApiCall_;
// void addPodInfoToInfoList(std::shared_ptr<PodInfo> podinfo);
std::shared_ptr<PodInfo> getPodInfo(std::string uuid);
std::vector<std::shared_ptr<PodInfo>> podsInfoList_;
};
} // namespace ku