'Delete a security group.'

@wsgi.Controller.api_version('2.1', MAX_PROXY_API_SUPPORT_VERSION)
@extensions.expected_errors((400, 404))
@wsgi.response(202)
def delete(self, req, id):

    context = _authorize_context(req)
    try:
        id = self.security_group_api.validate_id(id)
        security_group = self.security_group_api.get(context, None, id, map_exception=True)
        self.security_group_api.destroy(context, security_group)
    except exception.SecurityGroupNotFound as exp:
        raise exc.HTTPNotFound(explanation=exp.format_message())
    except exception.Invalid as exp:
        raise exc.HTTPBadRequest(explanation=exp.format_message())
