2 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13 * or implied. See the License for the specific language governing
14 * permissions and limitations under the License.
16 import {Factory} from 'rosie';
17 import randomstring from 'randomstring';
18 import {type2Name, fileTypes} from 'sdc-app/onboarding/softwareProduct/components/monitoring/SoftwareProductComponentsMonitoringConstants.js';
20 export const trap = type2Name[fileTypes.SNMP_TRAP];
21 export const poll = type2Name[fileTypes.SNMP_POLL];
22 export const ves = type2Name[fileTypes.VES_EVENT];
24 export const VSPComponentsMonitoringRestFactory = new Factory()
25 .option('createTrap', false)
26 .option('createPoll', false)
27 .option('createVes', false)
29 .attr(trap, ['createTrap'], (createTrap) => {return (createTrap) ? randomstring.generate() : undefined})
30 .attr(poll, ['createPoll'], (createPoll) => {return (createPoll) ? randomstring.generate() : undefined})
31 .attr(ves, ['createVes'], (createVes) => {return (createVes) ? randomstring.generate() : undefined});
34 export const VSPComponentsMonitoringViewFactory = new Factory()
35 .extend(VSPComponentsMonitoringRestFactory);
36 // .after(monitoring => {