def fetch_resource(module, link, kind):
    auth = GcpSession(module, 'compute')
    return return_if_object(module, auth.get(link), kind)
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_resource(module, link):
    auth = GcpSession(module, 'pubsub')
    return return_if_object(module, auth.get(link))
def fetch_list(module, link, query):
    auth = GcpSession(module, 'compute')
    response = auth.get(link, params={'filter': query})
    return return_if_object(module, response)
def fetch_resource(module, link, allow_not_found=True):
    auth = GcpSession(module, 'spanner')
    return return_if_object(module, auth.get(link), allow_not_found)
def fetch_list(module, link):
    auth = GcpSession(module, 'container')
    response = auth.get(link)
    return return_if_object(module, response)
示例#7
0
def fetch_resource(module, link, kind):
    auth = GcpSession(module, 'compute')
    return return_if_object(module, auth.get(link), kind)
def fetch_list(module, link, query):
    auth = GcpSession(module, 'dns')
    response = auth.get(link, params={'dnsName': query})
    return return_if_object(module, response)
示例#9
0
def fetch_list(module, link):
    auth = GcpSession(module, 'bigquery')
    response = auth.get(link)
    return return_if_object(module, response)
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']
示例#11
0
def fetch_list(module, link):
    auth = GcpSession(module, 'resourcemanager')
    response = auth.get(link)
    return return_if_object(module, response)
def fetch_list(module, link):
    auth = GcpSession(module, 'cloudbuild')
    response = auth.get(link)
    return return_if_object(module, response)
示例#13
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']
示例#14
0
 def fetch(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)
示例#15
0
def fetch_resource(module, link):
    auth = GcpSession(module, 'container')
    return return_if_object(module, auth.get(link))
示例#16
0
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))