コード例 #1
0
    def get_pod_info(self):
        """
        Get info of a pod
        """
        pod_name = self.stateless_job.job_id + "-" + str(self.instance_id)
        request = pod_svc.GetPodRequest(
            pod_name=v1alpha_peloton.PodName(value=pod_name),
            status_only=False)

        resp = self.stateless_job.client.pod_svc.GetPod(
            request,
            metadata=self.stateless_job.client.jobmgr_metadata,
            timeout=self.stateless_job.config.rpc_timeout_sec,
        )

        return resp.current
コード例 #2
0
ファイル: stateless_job.py プロジェクト: zhaohc10/peloton
    def get_pod_status(self, instance_id):
        """
        Get status of a pod
        :param instance_id: id of the pod
        """
        request = pod_svc.GetPodRequest(
            pod_name=v1alpha_peloton.PodName(value=self.job_id + "-" +
                                             str(instance_id)),
            status_only=True,
        )

        resp = self.client.pod_svc.GetPod(
            request,
            metadata=self.client.jobmgr_metadata,
            timeout=self.config.rpc_timeout_sec,
        )

        return resp.current.status