'Update a health check with new values.
To update, change the attributes of the health check object and pass
the updated object to the method.
:param  healthcheck: A healthcheck object with updated values.
:type   healthcheck: :class:`GCEHealthCheck`
:return:  An object representing the new state of the health check.
:rtype:   :class:`GCEHealthCheck`'

def ex_update_healthcheck(self, healthcheck):

    hc_data = {}
    hc_data['name'] = healthcheck.name
    hc_data['requestPath'] = healthcheck.path
    hc_data['port'] = healthcheck.port
    hc_data['checkIntervalSec'] = healthcheck.interval
    hc_data['timeoutSec'] = healthcheck.timeout
    hc_data['unhealthyThreshold'] = healthcheck.unhealthy_threshold
    hc_data['healthyThreshold'] = healthcheck.healthy_threshold
    if healthcheck.extra['host']:
        hc_data['host'] = healthcheck.extra['host']
    if healthcheck.extra['description']:
        hc_data['description'] = healthcheck.extra['description']
    request = ('/global/httpHealthChecks/%s' % healthcheck.name)
    self.connection.async_request(request, method='PUT', data=hc_data)
    return self.ex_get_healthcheck(healthcheck.name)
