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
评论列表
文章目录