Exemple #1
0
def get_routes(project):
    api = get_api('compute').routes()
    return pagingc(api, api.list(project=project))
Exemple #2
0
def get_zones(project):
    api = get_api('compute').zones()
    return map(lambda z: z['name'], pagingc(api, api.list(project=project)))
Exemple #3
0
def get_fw_rules(project):
    api = get_api('compute').firewalls()
    return pagingc(api, api.list(project=project))
Exemple #4
0
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')
Exemple #5
0
def get_users(domain):
    api = get_api('admin', 'directory_v1', USER_SCOPES).users()
    return pagingc(api, api.list(domain=domain), item_key='users')
Exemple #6
0
def get_members(group):
    api = get_api('admin', 'directory_v1', USER_SCOPES).members()
    return pagingc(api, api.list(groupKey=group), item_key='members')
Exemple #7
0
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')