blob: b82d08683fa498614fbfa66baee678e2e0234920 [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'
122 },
123 operationalScope: {
124 rule: rules.FUNCTION,
125 functionName: 'processChoices'
126 }
127 },
128 [fileTypes.FG]: {
129 referencingLicenseAgreements: {
130 rule: rules.SKIP,
131 functionName: 'getLicenseAgreements'
132 }
133 },
134 [fileTypes.LA]: {
135 licenseTerm: {
136 rule: rules.FUNCTION,
137 functionName: 'processChoice'
138 }
139 },
140 [fileTypes.LIMIT]: {
141 type: {
142 rule: rules.FUNCTION,
143 functionName: 'getEnumValue',
144 args: { listName: 'limitType' }
145 },
146 unit: {
147 rule: rules.FUNCTION,
148 functionName: 'getEnumValue',
149 args: { listName: 'limitUnit' }
150 }
151 },
152 [fileTypes.LKG]: {
153 operationalScope: {
154 rule: rules.FUNCTION,
155 functionName: 'processChoices'
156 },
157 referencingFeatureGroups: {
158 rule: rules.SKIP,
159 functionName: 'getFeatureGroups'
160 }
161 },
162 [fileTypes.NIC]: {
163 networkId: {
164 rule: rules.SKIP
165 }
166 },
167 [fileTypes.NIC_Q]: {},
168 [fileTypes.PROCESS]: {
169 type: {
170 rule: rules.FUNCTION,
171 functionName: 'getEnumValue',
172 args: { listName: 'processType' }
173 }
174 },
175 [fileTypes.VLM]: {
176 iconRef: {
177 rule: rules.SKIP
178 }
179 },
180 [fileTypes.VSP]: {
181 vendorId: {
182 rule: rules.SKIP
183 },
184 onboardingMethod: {
185 rule: rules.SKIP
186 },
187 validationData: {
188 rule: rules.SKIP
189 },
190 isOldVersion: {
191 rule: rules.SKIP
192 },
193 licensingVersion: {
194 rule: rules.FUNCTION,
195 functionName: 'fetchLMVersion'
196 },
197 category: {
198 rule: rules.FUNCTION,
199 functionName: 'fetchCategory'
200 },
201 subCategory: {
202 rule: rules.SKIP
203 }
204 },
205 [fileTypes.VSP_Q]: {
206 affinityData: {
207 rule: rules.SKIP
208 },
209 storageReplicationAcrossRegion: {
210 rule: rules.BOOLEAN,
211 trueValue: 'true',
212 falseValue: 'false'
213 }
214 },
215 [fileTypes.ORCHESTRATION_TEMPLATE_CANDIDATE]: {
216 modules: {
217 rule: rules.FUNCTION,
218 functionName: 'convertArrayToObject'
219 }
220 }
talig8e9c0652017-12-20 14:30:43 +0200221};