'Create a new cgsnapshot.'

@wsgi.response(http_client.ACCEPTED)
def create(self, req, body):

    LOG.debug('Creating    new    cgsnapshot    %s', body)
    self.assert_valid_body(body, 'cgsnapshot')
    context = req.environ['cinder.context']
    cgsnapshot = body['cgsnapshot']
    self.validate_name_and_description(cgsnapshot)
    try:
        group_id = cgsnapshot['consistencygroup_id']
    except KeyError:
        msg = _("'consistencygroup_id'    must    be    specified")
        raise exc.HTTPBadRequest(explanation=msg)
    group = self._get_cg(context, group_id)
    name = cgsnapshot.get('name', None)
    description = cgsnapshot.get('description', None)
    LOG.info('Creating    cgsnapshot    %(name)s.', {'name': name}, context=context)
    try:
        new_cgsnapshot = self.group_snapshot_api.create_group_snapshot(context, group, name, description)
    except (exception.InvalidGroup, exception.InvalidGroupSnapshot, exception.InvalidVolume) as error:
        raise exc.HTTPBadRequest(explanation=error.msg)
    retval = self._view_builder.summary(req, new_cgsnapshot)
    return retval
