Exemplo n.º 1
0
def fetch_list(module, link):
    auth = GcpSession(module, 'cloudfunctions')
    return auth.list(link, return_if_object, array_name='functions')
Exemplo n.º 2
0
def create(module, link, kind):
    auth = GcpSession(module, 'compute')
    return wait_for_operation(module, auth.post(link, resource_to_request(module)))
Exemplo n.º 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 fetch_resource(module, link, allow_not_found=True):
    auth = GcpSession(module, 'pubsub')
    return return_if_object(module, auth.get(link), allow_not_found)
def fetch_list(module, link):
    auth = GcpSession(module, 'kms')
    return auth.list(link, return_if_object, array_name='cryptoKeys')
def delete(module):
    auth = GcpSession(module, 'iam')
    return return_if_object(module, auth.delete(self_link_from_file(module)))
def create(module, link):
    auth = GcpSession(module, 'pubsub')
    return return_if_object(module, auth.put(link,
                                             resource_to_request(module)))
def size_gb_update(module, request, response):
    auth = GcpSession(module, 'compute')
    auth.post(
        ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/disks/{name}/resize"]).format(**module.params),
        {u'sizeGb': module.params.get('size_gb')},
    )
Exemplo n.º 9
0
def node_template_update(module, request, response):
    auth = GcpSession(module, 'compute')
    auth.post(
        ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/nodeGroups/{name}/setNodeTemplate"]).format(**module.params),
        {u'nodeTemplate': replace_resource_dict(module.params.get(u'node_template', {}), 'selfLink')},
    )
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='clusters')
def fetch_list(module, link):
    auth = GcpSession(module, 'sourcerepo')
    return auth.list(link, return_if_object, array_name='repos')
def fetch_list(module, link):
    auth = GcpSession(module, 'cloudbuild')
    return auth.list(link, return_if_object, array_name='triggers')
Exemplo n.º 14
0
def target_update(module, request, response):
    auth = GcpSession(module, 'compute')
    auth.post(
        ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/forwardingRules/{name}/setTarget"]).format(**module.params),
        {u'target': replace_resource_dict(module.params.get(u'target', {}), 'selfLink')},
    )
Exemplo n.º 15
0
def delete(module, link):
    auth = GcpSession(module, 'cloudbuild')
    return return_if_object(module, auth.delete(link))
Exemplo n.º 16
0
def fetch_list(module, link):
    auth = GcpSession(module, 'appengine')
    return auth.list(link, return_if_object, array_name='ingressRules')
def create(module):
    auth = GcpSession(module, 'iam')
    json_content = return_if_object(module, auth.post(self_link(module), resource_to_request(module)))
    with open(module.params['path'], 'w') as f:
        private_key_contents = to_native(base64.b64decode(json_content['privateKeyData']))
        f.write(private_key_contents)
Exemplo n.º 18
0
def create(module, link):
    auth = GcpSession(module, 'filestore')
    return wait_for_operation(module,
                              auth.post(link, resource_to_request(module)))
def fetch_resource(module):
    auth = GcpSession(module, 'iam')
    return return_if_object(module, auth.get(self_link_from_file(module)))
Exemplo n.º 20
0
def delete(module, link):
    auth = GcpSession(module, 'filestore')
    return wait_for_operation(module, auth.delete(link))
def delete(module, link):
    auth = GcpSession(module, 'pubsub')
    return return_if_object(module, auth.delete(link))
def fetch_list(module, link):
    auth = GcpSession(module, 'mlengine')
    return auth.list(link, return_if_object, array_name='versions')
def fetch_list(module, link):
    auth = GcpSession(module, 'dns')
    return auth.list(link, return_if_object, array_name='rrsets')
Exemplo n.º 24
0
def labels_update(module, request, response):
    auth = GcpSession(module, 'compute')
    auth.post(
        ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/snapshots/{name}/setLabels"]).format(**module.params),
        {u'labels': module.params.get('labels'), u'labelFingerprint': response.get('labelFingerprint')},
    )
def fetch_list(module, link, query):
    auth = GcpSession(module, 'compute')
    return auth.list(link,
                     return_if_object,
                     array_name='items',
                     params={'filter': query})
def update(module, link):
    auth = GcpSession(module, 'iam')
    return return_if_object(module, auth.put(link,
                                             resource_to_request(module)))
Exemplo n.º 27
0
def delete(module, link, kind):
    auth = GcpSession(module, 'compute')
    return wait_for_operation(module, auth.delete(link))
Exemplo n.º 28
0
def update(module, link):
    auth = GcpSession(module, 'cloudbuild')
    return return_if_object(module, auth.patch(link, resource_to_request(module)))
Exemplo n.º 29
0
def create(module, link):
    auth = GcpSession(module, 'runtimeconfig')
    return return_if_object(module, auth.post(link,
                                              resource_to_request(module)))
Exemplo n.º 30
0
def fetch_list(module, link):
    auth = GcpSession(module, 'spanner')
    return auth.list(link, return_if_object, array_name='instances')