sessions.py 文件源码

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

项目:python-freezerclient 作者: openstack 项目源码 文件源码
def end_session(self, session_id, job_id, session_tag, result):
        """
        Informs the freezer service that the job has ended.
        Provides information about the job's result and the session tag

        :param session_id:
        :param job_id:
        :param session_tag:
        :param result:
        :return:
        """
        # endpoint /v1/sessions/{sessions_id}/action
        endpoint = '{0}{1}/action'.format(self.endpoint, session_id)
        doc = {"end": {
            "job_id": job_id,
            "current_tag": session_tag,
            "result": result
        }}
        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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号