blob: bb25a1af06749634e7001f0b342ec709f7c69b8a [file] [log] [blame]
talig8e9c0652017-12-20 14:30:43 +02001/*!
2 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17import keyMirror from 'nfvo-utils/KeyMirror.js';
18
19export const actionTypes = keyMirror({
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020020 LOAD_CONFLICTS: null,
21 ADD_ACTIONS: null,
22 LOAD_CONFLICT: null,
23 DATA_PROCESSED: null
talig8e9c0652017-12-20 14:30:43 +020024});
25
26export const rules = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020027 SKIP: 'skip',
28 PARSE: 'parse',
29 FUNCTION: 'function',
30 BOOLEAN: 'boolean'
talig8e9c0652017-12-20 14:30:43 +020031};
32
33export const SyncStates = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020034 MERGE: 'Merging',
35 OUT_OF_SYNC: 'OutOfSync',
36 UP_TO_DATE: 'UpToDate'
talig8e9c0652017-12-20 14:30:43 +020037};
38
39export const ResolutionTypes = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020040 YOURS: 'YOURS',
41 THEIRS: 'THEIRS'
talig8e9c0652017-12-20 14:30:43 +020042};
43
44export const fileTypes = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020045 LKG: 'LicenseKeyGroup',
46 VLM: 'VendorLicenseModel',
47 EP: 'EntitlementPool',
48 FG: 'FeatureGroup',
49 LA: 'LicenseAgreement',
50 VSP: 'VendorSoftwareProduct',
51 LIMIT: 'Limit',
52 VSP_Q: 'VSPQuestionnaire',
53 COMPONENT: 'Component',
54 COMPONENT_Q: 'ComponentQuestionnaire',
55 COMPONENT_DEP: 'ComponentDependencies',
56 COMPUTE_Q: 'ComputeQuestionnaire',
57 COMPUTE: 'Compute',
58 COMPUTE_FLAVOR: 'ComputeFlavor',
59 NIC: 'Nic',
60 NIC_Q: 'NicQuestionnaire',
61 IMAGE: 'Image',
62 IMAGE_Q: 'ImageQuestionnaire',
63 PROCESS: 'Process',
64 DEPLOYMENT_FLAVOR: 'DeploymentFlavor',
65 VENDOR: 'Vendor',
66 NETWORK: 'Network',
67 ORCHESTRATION_TEMPLATE_CANDIDATE: 'OrchestrationTemplateCandidate'
talig8e9c0652017-12-20 14:30:43 +020068};
69
70export const dataRules = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020071 general: {
72 id: {
73 rule: rules.SKIP
74 },
75 questionareData: {
76 rule: rules.PARSE,
77 moveFields: true
78 },
79 startDate: {
80 rule: rules.FUNCTION,
81 functionName: 'parseDate'
82 },
83 expiryDate: {
84 rule: rules.FUNCTION,
85 functionName: 'parseDate'
86 },
87 featureGroups: {
88 rule: rules.FUNCTION,
89 functionName: 'reduceList',
90 args: { subField: 'name' }
91 },
92 licenseKeyGroups: {
93 rule: rules.FUNCTION,
94 functionName: 'reduceList',
95 args: { subField: 'name' }
96 },
97 entitlementPools: {
98 rule: rules.FUNCTION,
99 functionName: 'reduceList',
100 args: { subField: 'name' }
101 }
102 },
103 [fileTypes.COMPONENT]: {},
104 [fileTypes.COMPUTE_FLAVOR]: {
105 associatedToDeploymentFlavor: {
106 rule: rules.BOOLEAN,
107 trueValue: 'true'
108 }
109 },
110 [fileTypes.COMPUTE_Q]: {},
111 [fileTypes.COMPONENT_Q]: {
112 isComponentMandatory: {
113 rule: rules.BOOLEAN,
114 trueValue: 'YES',
115 falseValue: 'NO'
116 }
117 },
118 [fileTypes.EP]: {
119 referencingFeatureGroups: {
120 rule: rules.SKIP,
121 functionName: 'getFeatureGroups'
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200122 }
123 },
124 [fileTypes.FG]: {
125 referencingLicenseAgreements: {
126 rule: rules.SKIP,
127 functionName: 'getLicenseAgreements'
128 }
129 },
130 [fileTypes.LA]: {
131 licenseTerm: {
132 rule: rules.FUNCTION,
133 functionName: 'processChoice'
134 }
135 },
136 [fileTypes.LIMIT]: {
137 type: {
138 rule: rules.FUNCTION,
139 functionName: 'getEnumValue',
140 args: { listName: 'limitType' }
141 },
142 unit: {
143 rule: rules.FUNCTION,
144 functionName: 'getEnumValue',
145 args: { listName: 'limitUnit' }
146 }
147 },
148 [fileTypes.LKG]: {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200149 referencingFeatureGroups: {
150 rule: rules.SKIP,
151 functionName: 'getFeatureGroups'
152 }
153 },
154 [fileTypes.NIC]: {
155 networkId: {
156 rule: rules.SKIP
157 }
158 },
159 [fileTypes.NIC_Q]: {},
160 [fileTypes.PROCESS]: {
161 type: {
162 rule: rules.FUNCTION,
163 functionName: 'getEnumValue',
164 args: { listName: 'processType' }
165 }
166 },
167 [fileTypes.VLM]: {
168 iconRef: {
169 rule: rules.SKIP
170 }
171 },
172 [fileTypes.VSP]: {
173 vendorId: {
174 rule: rules.SKIP
175 },
176 onboardingMethod: {
177 rule: rules.SKIP
178 },
179 validationData: {
180 rule: rules.SKIP
181 },
182 isOldVersion: {
183 rule: rules.SKIP
184 },
185 licensingVersion: {
186 rule: rules.FUNCTION,
187 functionName: 'fetchLMVersion'
188 },
189 category: {
190 rule: rules.FUNCTION,
191 functionName: 'fetchCategory'
192 },
193 subCategory: {
194 rule: rules.SKIP
195 }
196 },
197 [fileTypes.VSP_Q]: {
198 affinityData: {
199 rule: rules.SKIP
200 },
201 storageReplicationAcrossRegion: {
202 rule: rules.BOOLEAN,
203 trueValue: 'true',
204 falseValue: 'false'
205 }
206 },
207 [fileTypes.ORCHESTRATION_TEMPLATE_CANDIDATE]: {
208 modules: {
209 rule: rules.FUNCTION,
210 functionName: 'convertArrayToObject'
211 }
212 }
talig8e9c0652017-12-20 14:30:43 +0200213};