Beispiel #1
0
def fetch_resource(module, link, allow_not_found=True):
    auth = GcpSession(module, 'cloudscheduler')
    return return_if_object(module, auth.get(link), allow_not_found)
def fetch_list(module, link):
    auth = GcpSession(module, 'redis')
    return auth.list(link, return_if_object, array_name='instances')
Beispiel #3
0
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 delete(module, link, kind):
    auth = GcpSession(module, 'storage')
    return return_if_object(module, auth.delete(link), kind)
def create(module, link):
    auth = GcpSession(module, 'iam')
    return return_if_object(module, auth.post(link,
                                              resource_to_create(module)))
def create_change(original, updated, module):
    auth = GcpSession(module, 'dns')
    return return_if_change_object(module, auth.post(collection(module), resource_to_change_request(original, updated, module)))
Beispiel #7
0
def create(module, link, kind):
    auth = GcpSession(module, 'sql')
    return wait_for_operation(module,
                              auth.post(link, resource_to_request(module)))
Beispiel #8
0
def create(module, link):
    auth = GcpSession(module, 'sourcerepo')
    return return_if_object(module, auth.post(link,
                                              resource_to_request(module)))
Beispiel #9
0
def delete(module, link):
    auth = GcpSession(module, 'sourcerepo')
    return return_if_object(module, auth.delete(link))
def update(module, link, fetch):
    auth = GcpSession(module, 'pubsub')
    params = {'updateMask': updateMask(resource_to_request(module), response_to_hash(module, fetch))}
    request = resource_to_request(module)
    del request['name']
    return return_if_object(module, auth.patch(link, request, params=params))
Beispiel #11
0
def delete(module, link):
    auth = GcpSession(module, 'mlengine')
    return wait_for_operation(module, auth.delete(link))
def fetch_list(module, link):
    auth = GcpSession(module, 'spanner')
    return auth.list(link, return_if_object, array_name='databases')
Beispiel #13
0
def fetch_list(module, link):
    auth = GcpSession(module, 'logging')
    return auth.list(link, return_if_object, array_name='metrics')
Beispiel #14
0
def fetch_list(module, link):
    auth = GcpSession(module, 'tpu')
    return auth.list(link, return_if_object, array_name='nodes')
def delete(module, link, kind, fetch):
    auth = GcpSession(module, 'sql')
    return wait_for_operation(module, auth.delete(link))
def fetch_list(module, link):
    auth = GcpSession(module, 'sql')
    return auth.list(link, return_if_object, array_name='items')
def fetch_list(module, link):
    auth = GcpSession(module, 'container')
    return auth.list(link, return_if_object, array_name='nodePools')
def create(module, link, kind):
    auth = GcpSession(module, 'dns')
    return return_if_object(module,
                            auth.post(link, resource_to_request(module)), kind)
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 update(module, link):
    auth = GcpSession(module, 'runtimeconfig')
    return return_if_object(module, auth.put(link,
                                             resource_to_request(module)))
def update(module, link, kind):
    auth = GcpSession(module, 'storage')
    return return_if_object(module,
                            auth.put(link, resource_to_request(module)), kind)
def delete(module, link):
    auth = GcpSession(module, 'runtimeconfig')
    return return_if_object(module, auth.delete(link))
Beispiel #23
0
def fetch_list(module, link, query):
    auth = GcpSession(module, 'compute')
    return auth.list(link,
                     return_if_object,
                     array_name='items',
                     params={'filter': query})
def fetch_resource(module, link, allow_not_found=True):
    auth = GcpSession(module, 'runtimeconfig')
    return return_if_object(module, auth.get(link), allow_not_found)
def delete(module, link):
    auth = GcpSession(module, 'iam')
    return return_if_object(module, auth.delete(link))
Beispiel #26
0
 def get_file_contents(self, module):
     auth = GcpSession(module, 'storage')
     data = auth.get(self.media_link(module))
     return base64.b64encode(data.content.rstrip())
Beispiel #27
0
def delete(module, link, kind):
    auth = GcpSession(module, 'compute')
    return wait_for_operation(module, auth.delete(link))
Beispiel #28
0
 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)
Beispiel #29
0
def update(module, link, kind):
    auth = GcpSession(module, 'compute')
    return wait_for_operation(module,
                              auth.put(link, resource_to_request(module)))
Beispiel #30
0
def delete(module, link):
    auth = GcpSession(module, 'cloudscheduler')
    return return_if_object(module, auth.delete(link))