'Add or modify domain entry.'

@wsgi.Controller.api_version('2.1', MAX_PROXY_API_SUPPORT_VERSION)
@extensions.expected_errors((400, 501))
@validation.schema(floating_ip_dns.domain_entry_update)
def update(self, req, id, body):

    context = req.environ['nova.context']
    context.can((fid_policies.POLICY_ROOT % 'domain:update'))
    fqdomain = _unquote_domain(id)
    entry = body['domain_entry']
    scope = entry['scope']
    project = entry.get('project', None)
    av_zone = entry.get('availability_zone', None)
    if ((scope == 'private') and project):
        msg = _('you    can    not    pass    project    if    the    scope    is    private')
        raise webob.exc.HTTPBadRequest(explanation=msg)
    if ((scope == 'public') and av_zone):
        msg = _('you    can    not    pass    av_zone    if    the    scope    is    public')
        raise webob.exc.HTTPBadRequest(explanation=msg)
    if (scope == 'private'):
        create_dns_domain = self.network_api.create_private_dns_domain
        (area_name, area) = ('availability_zone', av_zone)
    else:
        create_dns_domain = self.network_api.create_public_dns_domain
        (area_name, area) = ('project', project)
    try:
        create_dns_domain(context, fqdomain, area)
    except NotImplementedError:
        common.raise_feature_not_supported()
    return _translate_domain_entry_view({'domain': fqdomain, 'scope': scope, area_name: area})
