def retrieve_pool(self, uuid):
"""Retrieve a :class:`qarnot.pool.Pool` from its uuid
:param str uuid: Desired pool uuid
:rtype: :class:`~qarnot.pool.Pool`
:returns: Existing pool defined by the given uuid
:raises qarnot.exceptions.MissingPoolException: pool does not exist
:raises qarnot.exceptions.UnauthorizedException: invalid credentials
:raises qarnot.exceptions.QarnotGenericException: API general error, see message for details
"""
response = self._get(get_url('pool update', uuid=uuid))
if response.status_code == 404:
raise MissingPoolException(response.json()['message'])
raise_on_error(response)
return Pool.from_json(self, response.json())
评论列表
文章目录