def get_instance(self, project_id, service_id, version_id, instances_id):
"""Gets information about a specific instance of a service.
Args:
project_id (str): The id of the project.
service_id (str): The id of the service to query.
version_id (str): The id of the version to query.
instances_id (str): The id of the instance to query.
Returns:
dict: An Instance resource dict for a given project_id,
service_id and version_id.
"""
try:
return self.repository.version_instances.get(
project_id, target=instances_id, services_id=service_id,
versions_id=version_id)
except (errors.HttpError, HttpLib2Error) as e:
if isinstance(e, errors.HttpError) and e.resp.status == 404:
return {}
raise api_errors.ApiExecutionError(project_id, e)
评论列表
文章目录