def fetch_resource(module, link, kind, allow_not_found=True):
    auth = GcpSession(module, 'compute')
    return return_if_object(module, auth.get(link), kind, allow_not_found)
 def fetch_projects(self, params, link, query):
     module = GcpMockModule(params)
     auth = GcpSession(module, 'cloudresourcemanager')
     response = auth.get(link, params={'filter': query})
     return self._return_if_object(module, response)
def fetch_resource(module, link, allow_not_found=True):
    auth = GcpSession(module, 'cloudfunctions')
    return return_if_object(module, auth.get(link), allow_not_found)
def fetch_resource(module):
    auth = GcpSession(module, 'iam')
    return return_if_object(module, auth.get(self_link_from_file(module)))
Esempio n. 5
0
def fetch_resource(module, link, allow_not_found=True):
    auth = GcpSession(module, 'runtimeconfig')
    return return_if_object(module, auth.get(link), allow_not_found)
Esempio n. 6
0
def fetch_resource(module, link, allow_not_found=True):
    auth = GcpSession(module, 'filestore')
    return return_if_object(module, auth.get(link), allow_not_found)
def download_file(module):
    auth = GcpSession(module, 'storage')
    data = auth.get(media_link(module))
    with open(module.params['dest'], 'w') as f:
        f.write(data.text.encode('utf8'))
    return fetch_resource(module, self_link(module))
Esempio n. 8
0
def get_change_status(change_id, module):
    auth = GcpSession(module, 'dns')
    link = collection(module) + "/%s" % change_id
    return return_if_change_object(module, auth.get(link))['status']
 def fetch_resource(self, module, link, allow_not_found=True):
     auth = GcpSession(module, 'storage')
     return self.return_if_object(module, auth.get(link), allow_not_found)
 def get_file_contents(self, module):
     auth = GcpSession(module, 'storage')
     data = auth.get(self.media_link(module))
     return base64.b64encode(data.content.rstrip())