backup-disks.py 文件源码

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

项目:jupyterhub-k8s 作者: data-8 项目源码 文件源码
def list_snapshots(compute, project):
    """ Lists all snapshots created for this project """
    backup_logger.debug("Finding all snapshots for specified project")
    all_snapshots = []
    try:
        result = compute.snapshots().list(project=project).execute()
        all_snapshots.extend(result['items'])

        while 'nextPageToken' in result:
            result = compute.snapshots().list(project=project, \
                pageToken=result['nextPageToken']).execute()
            all_snapshots.extend(result['items'])
    except HttpError:
        backup_logger.error("Error with HTTP request made to list_snapshots")
        sys.exit(1)

    return all_snapshots
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号