#pragma once #include "kubecontrol/KubernetesAPI.hpp" #include "kubecontrol/PodInfo.hpp" #include #include #include #include #include #include namespace kubecontrol { class PodController { public: PodController(std::string pathToKubectlConfig); std::string getServerAddress(); void startPod(KubePod Pod,bool WaitTillRunning = true ); void stopPod(std::string uuid); void stopAllPods(); std::string getInfoForAllPods(); // std::string getInfoForOwnPod(); std::string getInfoForPod(std::string uuid); size_t getListOfChildPods(); void checkPodsHierarchy(); std::string getPodsInfoForAll(); std::shared_ptr getPodsInfo(std::string uuid); private: KubernetesAPI APIInterface_; std::vector 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); std::shared_ptr getPodInfo(std::string uuid); std::vector> podsInfoList_; mutable std::mutex mx_; }; } // namespace ku