コード例 #1
0
def service_update(module, request, response):
    auth = GcpSession(module, 'compute')
    auth.post(
        ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/targetTcpProxies/{name}/setBackendService"]).format(**module.params),
        {u'service': replace_resource_dict(module.params.get(u'service', {}), 'selfLink')},
    )
コード例 #2
0
def fetch_resource(module, link, allow_not_found=True):
    auth = GcpSession(module, 'iam')
    return return_if_object(module, auth.get(link), allow_not_found)
コード例 #3
0
def fetch_list(module, link):
    auth = GcpSession(module, 'container')
    return auth.list(link, return_if_object, array_name='clusters')
コード例 #4
0
def fetch_list(module, link):
    auth = GcpSession(module, 'cloudbuild')
    response = auth.get(link)
    return return_if_object(module, response)
コード例 #5
0
def create(module, link):
    auth = GcpSession(module, 'iam')
    return return_if_object(module, auth.post(link,
                                              resource_to_create(module)))
コード例 #6
0
def create(module, link, kind):
    auth = GcpSession(module, 'compute')
    return wait_for_operation(module,
                              auth.post(link, resource_to_request(module)))
コード例 #7
0
def update(module, link):
    auth = GcpSession(module, 'container')
    return wait_for_operation(module, auth.put(link, resource_to_request(module)))
コード例 #8
0
def delete(module, link, kind):
    auth = GcpSession(module, 'storage')
    return return_if_object(module, auth.delete(link), kind)
コード例 #9
0
def fetch_list(module, link, query):
    auth = GcpSession(module, 'dns')
    return auth.list(link,
                     return_if_object,
                     array_name='managedZones',
                     params={'dnsName': query})
コード例 #10
0
def fetch_list(module, link, query):
    auth = GcpSession(module, 'dns')
    response = auth.get(link, params={'dnsName': query})
    return return_if_object(module, response)
コード例 #11
0
def update(module, link, kind):
    auth = GcpSession(module, 'storage')
    return return_if_object(module,
                            auth.put(link, resource_to_request(module)), kind)
コード例 #12
0
def update(module, link):
    auth = GcpSession(module, 'logging')
    return return_if_object(module, auth.put(link,
                                             resource_to_request(module)))
コード例 #13
0
def delete(module, link, kind, fetch):
    auth = GcpSession(module, 'sql')
    return wait_for_operation(module, auth.delete(link))
コード例 #14
0
def update(module, link, kind, fetch):
    auth = GcpSession(module, 'sql')
    return wait_for_operation(module,
                              auth.put(link, resource_to_request(module)))
コード例 #15
0
def label_fingerprint_update(module, request, response):
    auth = GcpSession(module, 'compute')
    auth.post(
        ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/zones/{zone}/disks/{name}/setLabels"]).format(**module.params),
        {u'labelFingerprint': response.get('labelFingerprint'), u'labels': module.params.get('labels')},
    )
コード例 #16
0
def fetch_list(module, link):
    auth = GcpSession(module, 'redis')
    return auth.list(link, return_if_object, array_name='instances')
コード例 #17
0
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')},
    )
コード例 #18
0
def update(module, link, kind, fetch):
    update_fields(module, resource_to_request(module),
                  response_to_hash(module, fetch))
    auth = GcpSession(module, 'compute')
    return wait_for_operation(module,
                              auth.put(link, resource_to_request(module)))
コード例 #19
0
def delete(module, link, kind):
    auth = GcpSession(module, 'compute')
    return wait_for_operation(module, auth.delete(link))
コード例 #20
0
def fetch_resource(module, link, kind):
    auth = GcpSession(module, 'compute')
    return return_if_object(module, auth.get(link), kind)
コード例 #21
0
def delete(module, link):
    auth = GcpSession(module, 'container')
    return wait_for_operation(module, auth.delete(link))
コード例 #22
0
def delete(module, link):
    auth = GcpSession(module, 'sourcerepo')
    return return_if_object(module, auth.delete(link))
コード例 #23
0
def fetch_list(module, link):
    auth = GcpSession(module, 'container')
    response = auth.get(link)
    return return_if_object(module, response)
コード例 #24
0
def fetch_list(module, link):
    auth = GcpSession(module, 'sql')
    return auth.list(link, return_if_object, array_name='items')
コード例 #25
0
def delete(module, link):
    auth = GcpSession(module, 'iam')
    return return_if_object(module, auth.delete(link))
コード例 #26
0
def fetch_list(module, link):
    auth = GcpSession(module, 'appengine')
    return auth.list(link, return_if_object, array_name='ingressRules')
コード例 #27
0
def fetch_list(module, link, query):
    auth = GcpSession(module, 'compute')
    response = auth.get(link, params={'filter': query})
    return return_if_object(module, response)
コード例 #28
0
def create(module, link):
    auth = GcpSession(module, 'pubsub')
    return return_if_object(module, auth.put(link,
                                             resource_to_request(module)))
コード例 #29
0
def fetch_list(module, link, query):
    auth = GcpSession(module, 'compute')
    return auth.list(link,
                     return_if_object,
                     array_name='items',
                     params={'filter': query})
コード例 #30
0
def proxy_header_update(module, request, response):
    auth = GcpSession(module, 'compute')
    auth.post(
        ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/global/targetTcpProxies/{name}/setProxyHeader"]).format(**module.params),
        {u'proxyHeader': module.params.get('proxy_header')},
    )