'Update an existing zone.
API docs: http://www.linode.com/api/dns/domain.update'

def update_zone(self, zone, domain=None, type=None, ttl=None, extra=None):

    params = {'api_action': 'domain.update', 'DomainID': zone.id}
    if type:
        params['Type'] = type
    if domain:
        params['Domain'] = domain
    if ttl:
        params['TTL_sec'] = ttl
    merged = merge_valid_keys(params=params, valid_keys=VALID_ZONE_EXTRA_PARAMS, extra=extra)
    self.connection.request(API_ROOT, params=params).objects[0]
    updated_zone = get_new_obj(obj=zone, klass=Zone, attributes={'domain': domain, 'type': type, 'ttl': ttl, 'extra': merged})
    return updated_zone
