'Deletes an existing group type.'

@wsgi.Controller.api_version('3.11')
def delete(self, req, id):

    context = req.environ['cinder.context']
    self._check_policy(context)
    try:
        grp_type = group_types.get_group_type(context, id)
        group_types.destroy(context, grp_type['id'])
        self._notify_group_type_info(context, 'group_type.delete', grp_type)
    except exception.GroupTypeInUse as err:
        self._notify_group_type_error(context, 'group_type.delete', err, group_type=grp_type)
        msg = _('Target    group    type    is    still    in    use.')
        raise webob.exc.HTTPBadRequest(explanation=msg)
    except exception.GroupTypeNotFound as err:
        self._notify_group_type_error(context, 'group_type.delete', err, id=id)
        raise webob.exc.HTTPNotFound(explanation=err.msg)
    return webob.Response(status_int=http_client.ACCEPTED)
