'Create a new group_snapshot.'

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

    LOG.debug('Creating    new    group_snapshot    %s', body)
    self.assert_valid_body(body, 'group_snapshot')
    context = req.environ['cinder.context']
    group_snapshot = body['group_snapshot']
    self.validate_name_and_description(group_snapshot)
    try:
        group_id = group_snapshot['group_id']
    except KeyError:
        msg = _("'group_id'    must    be    specified")
        raise exc.HTTPBadRequest(explanation=msg)
    group = self.group_snapshot_api.get(context, group_id)
    self._check_default_cgsnapshot_type(group.group_type_id)
    name = group_snapshot.get('name', None)
    description = group_snapshot.get('description', None)
    LOG.info('Creating    group_snapshot    %(name)s.', {'name': name}, context=context)
    try:
        new_group_snapshot = 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_group_snapshot)
    return retval
