bigquery.py 文件源码

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

项目:forseti-security 作者: GoogleCloudPlatform 项目源码 文件源码
def get_bigquery_projectids(self):
        """Request and page through bigquery projectids.

        Returns:
            list: A list of project_ids enabled for bigquery.

            ['project-id',
             'project-id',
             '...']

            If there are no project_ids enabled for bigquery an empty list will
            be returned.
        """
        try:
            results = self.repository.projects.list(
                fields='nextPageToken,projects/id')
            flattened = api_helpers.flatten_list_results(results, 'projects')
        except (errors.HttpError, HttpLib2Error) as e:
            raise api_errors.ApiExecutionError('bigquery', e)

        project_ids = [result.get('id') for result in flattened
                       if 'id' in result]
        return project_ids
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号