示例#1
0
def enable_flow_logs_update(module, request, response):
    auth = GcpSession(module, 'compute')
    auth.patch(
        ''.join(["https://www.googleapis.com/compute/v1/", "projects/{project}/regions/{region}/subnetworks/{name}"]).format(**module.params),
        {
            u'enableFlowLogs': module.params.get('enable_flow_logs'),
            u'fingerprint': response.get('fingerprint'),
            u'secondaryIpRanges': SubnetworkSecondaryiprangesArray(module.params.get('secondary_ip_ranges', []), module).to_request(),
        },
    )
def description_update(module, request, response):
    auth = GcpSession(module, 'dns')
    auth.patch(
        ''.join(["https://www.googleapis.com/dns/v1/", "projects/{project}/managedZones/{name}"]).format(**module.params),
        {
            u'description': module.params.get('description'),
            u'labels': module.params.get('labels'),
            u'privateVisibilityConfig': ManagedZonePrivatevisibilityconfig(module.params.get('private_visibility_config', {}), module).to_request(),
        },
    )
示例#3
0
def routing_config_update(module, request, response):
    auth = GcpSession(module, 'compute')
    auth.patch(
        ''.join([
            "https://www.googleapis.com/compute/v1/",
            "projects/{project}/global/networks/{name}"
        ]).format(**module.params),
        {
            u'routingConfig':
            NetworkRoutingconfig(module.params.get('routing_config', {}),
                                 module).to_request()
        },
    )
示例#4
0
def update(module, link, fetch):
    auth = GcpSession(module, 'redis')
    params = {
        'updateMask':
        updateMask(resource_to_request(module),
                   response_to_hash(module, fetch))
    }
    request = resource_to_request(module)
    del request['name']
    return wait_for_operation(module, auth.patch(link, request, params=params))
示例#5
0
def update(module, link, kind):
    auth = GcpSession(module, 'compute')
    return wait_for_operation(module,
                              auth.patch(link, resource_to_request(module)))
示例#6
0
def update(module, link):
    auth = GcpSession(module, 'spanner')
    return wait_for_operation(module,
                              auth.patch(link, resource_to_update(module)))
示例#7
0
def update(module, link):
    auth = GcpSession(module, 'cloudbuild')
    return return_if_object(module,
                            auth.patch(link, resource_to_request(module)))
示例#8
0
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))