audit_log.py 文件源码

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

项目:professional-services 作者: GoogleCloudPlatform 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号