def get_test_resource(cls):
"""Return the GCE Instance the audit loop uses.
Returns:
Dictionary representing the GCE instance, None if not found.
Raises:
errors.HttpError: On a failed API call.
"""
try:
resource = api.CLIENTS.compute.instances().get(
instance=AuditLogLoop.RESOURCE_NAME,
project=config.get_project_id(),
zone=AuditLogLoop.ZONE).execute()
except errors.HttpError as e:
if e.resp.status == 404:
return None
else:
raise
return resource
audit_log.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录