def get_routes(project): api = get_api('compute').routes() return pagingc(api, api.list(project=project))
def get_zones(project): api = get_api('compute').zones() return map(lambda z: z['name'], pagingc(api, api.list(project=project)))
def get_fw_rules(project): api = get_api('compute').firewalls() return pagingc(api, api.list(project=project))
def get_folder_policies(resource, body={}): api = get_api('cloudresourcemanager', 'v2').folders() return policy_wrap( pagingc(api, api.getIamPolicy(resource=resource, body=body), item_key='bindings'), resource, 'folder')
def get_users(domain): api = get_api('admin', 'directory_v1', USER_SCOPES).users() return pagingc(api, api.list(domain=domain), item_key='users')
def get_members(group): api = get_api('admin', 'directory_v1', USER_SCOPES).members() return pagingc(api, api.list(groupKey=group), item_key='members')
def get_project_policies(resource, body={}): api = get_api('cloudresourcemanager').projects() return policy_wrap( pagingc(api, api.getIamPolicy(resource=resource, body=body), item_key='bindings'), resource, 'project')