'Enables replications for a group.'

@wsgi.Controller.api_version(GROUP_REPLICATION_API_VERSION)
@wsgi.action('enable_replication')
def enable_replication(self, req, id, body):

    context = req.environ['cinder.context']
    if body:
        if (not self.is_valid_body(body, 'enable_replication')):
            msg = _("Missing    required    element    'enable_replication'    in    request    body.")
            raise exc.HTTPBadRequest(explanation=msg)
    LOG.info('Enable    replication    group    with    id:    %s.', id, context=context)
    try:
        group = self.group_api.get(context, id)
        self.group_api.enable_replication(context, group)
    except (exception.InvalidGroup, exception.InvalidGroupType, exception.InvalidVolume, exception.InvalidVolumeType) as error:
        raise exc.HTTPBadRequest(explanation=error.msg)
    return webob.Response(status_int=202)
