import Boom from '@hapi/boom' ; import { ML_ERRORS } from '../../../common/anomaly_detection' ; import { Setup } from '../helpers/setup_request' ; import { getMlJobsWithAPMGroup } from './get_ml_jobs_with_apm_group' ; export function getAnomalyDetectionJobs ( setup ) { const { ml } = setup ; if ( ! ml ) { throw Boom . notImplemented ( ML_ERRORS . ML_NOT_AVAILABLE ) ; } return getMlJobsWithAPMGroup ( ml . anomalyDetectors ) ; }