jobs.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:python-freezerclient 作者: openstack 项目源码 文件源码
def start_job(self, job_id):
        """
        Request to start a job

        :param job_id: the id of the job to start
        :return: the response obj:
                 {
                    result: string 'success' or 'already started'
                 }
        """
        # endpoint /v1/jobs/{job_id}/event
        endpoint = '{0}{1}/event'.format(self.endpoint, job_id)
        doc = {"start": None}
        r = requests.post(endpoint,
                          headers=self.headers,
                          data=json.dumps(doc),
                          verify=self.verify)
        if r.status_code != 202:
            raise exceptions.ApiClientException(r)
        return r.json()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号