450e66ead27dca8756ca641fc338fab390e9c25c
[sdc.git] / catalog-ui / src / app / ng2 / services / component-services / component.service.ts
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 import * as _ from "lodash";
22 import {Inject, Injectable} from '@angular/core';
23 import {Observable} from 'rxjs/Observable';
24 import 'rxjs/add/operator/map';
25 import 'rxjs/add/operator/toPromise';
26 import {
27     Component,
28     FilterPropertiesAssignmentData,
29     InputBEModel,
30     InstancePropertiesAPIMap,
31     OperationModel
32 } from "app/models";
33 import {API_QUERY_PARAMS, COMPONENT_FIELDS} from "app/utils";
34 import {ComponentGenericResponse} from "../responses/component-generic-response";
35 import {InstanceBePropertiesMap} from "../../../models/properties-inputs/property-fe-map";
36 import {ComponentType, ServerTypeUrl, SERVICE_FIELDS} from "../../../utils/constants";
37 import {ISdcConfig, SdcConfigToken} from "../../config/sdc-config.config";
38 import {IDependenciesServerResponse} from "../responses/dependencies-server-response";
39 import {AutomatedUpgradeGenericResponse} from "../responses/automated-upgrade-response";
40 import {IAutomatedUpgradeRequestObj} from "../../pages/automated-upgrade/automated-upgrade.service";
41 import {ComponentInstance} from "../../../models/componentsInstances/componentInstance";
42 import {CommonUtils} from "../../../utils/common-utils";
43 import {HttpClient, HttpHeaders, HttpParams} from "@angular/common/http";
44 import {BEOperationModel, InterfaceModel} from "../../../models/operation";
45 import {PropertyBEModel} from "../../../models/properties-inputs/property-be-model";
46 import {PolicyInstance} from "../../../models/graph/zones/policy-instance";
47 import {OutputBEModel} from "app/models/attributes-outputs/output-be-model";
48 import {HttpHelperService} from '../http-hepler.service';
49 import {
50     BEInterfaceOperationModel,
51     InterfaceOperationModel
52 } from "../../../models/interfaceOperation";
53 import {FilterConstraint} from "../../../models/filter-constraint";
54
55 /*
56 PLEASE DO NOT USE THIS SERVICE IN ANGULAR2! Use the topology-template.service instead
57  */
58 @Injectable()
59 export class ComponentServiceNg2 {
60
61     protected baseUrl;
62
63     constructor(protected http: HttpClient, @Inject(SdcConfigToken) sdcConfig: ISdcConfig) {
64         this.baseUrl = sdcConfig.api.root + sdcConfig.api.component_api_root;
65     }
66
67     protected getComponentDataByFieldsName(componentType: string, componentId: string, fields: Array<string>): Observable<ComponentGenericResponse> {
68
69         let params: HttpParams = new HttpParams();
70         fields.forEach((field: string): void => {
71             params = params.append(API_QUERY_PARAMS.INCLUDE, field);
72         });
73
74         return this.http.get<ComponentGenericResponse>(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/filteredDataByParams', {params: params})
75         .map((res) => {
76             return new ComponentGenericResponse().deserialize(res);
77         });
78     }
79
80     protected getServerTypeUrl = (componentType: string): string => {
81         switch (componentType) {
82             case ComponentType.SERVICE:
83                 return ServerTypeUrl.SERVICES;
84             default:
85                 return ServerTypeUrl.RESOURCES;
86         }
87     }
88
89     getFullComponent(uniqueId: string): Observable<ComponentGenericResponse> {
90         return this.http.get<ComponentGenericResponse>(this.baseUrl + uniqueId)
91         .map((res) => {
92             return new ComponentGenericResponse().deserialize(res);
93         });
94     }
95
96     getComponentMetadata(uniqueId: string, type: string): Observable<ComponentGenericResponse> {
97         return this.getComponentDataByFieldsName(type, uniqueId, [COMPONENT_FIELDS.COMPONENT_METADATA]);
98     }
99
100     getComponentInstanceAttributesAndProperties(component: Component): Observable<ComponentGenericResponse> {
101         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_PROPERTIES, COMPONENT_FIELDS.COMPONENT_INSTANCES_ATTRIBUTES]);
102     }
103
104     getComponentInstanceProperties(component: Component): Observable<ComponentGenericResponse> {
105         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_PROPERTIES]);
106     }
107
108     getComponentAttributes(component: Component): Observable<ComponentGenericResponse> {
109         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_ATTRIBUTES]);
110     }
111
112     getComponentCompositionData(component: Component): Observable<ComponentGenericResponse> {
113         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_RELATION, COMPONENT_FIELDS.COMPONENT_INSTANCES, COMPONENT_FIELDS.COMPONENT_NON_EXCLUDED_POLICIES, COMPONENT_FIELDS.COMPONENT_NON_EXCLUDED_GROUPS]);
114     }
115
116     getComponentResourcePropertiesData(component: Component): Observable<ComponentGenericResponse> {
117         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INSTANCES, COMPONENT_FIELDS.COMPONENT_POLICIES, COMPONENT_FIELDS.COMPONENT_NON_EXCLUDED_GROUPS]);
118     }
119
120     getComponentResourceAttributesData(component: Component): Observable<ComponentGenericResponse> {
121         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INSTANCES, COMPONENT_FIELDS.COMPONENT_NON_EXCLUDED_GROUPS]);
122     }
123
124     getComponentResourceInstances(component: Component): Observable<ComponentGenericResponse> {
125         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INSTANCES]);
126     }
127
128     getComponentInputs(component: Component): Observable<ComponentGenericResponse> {
129         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INPUTS]);
130     }
131
132     getComponentInputsWithProperties(component: Component): Observable<ComponentGenericResponse> {
133         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INPUTS, COMPONENT_FIELDS.COMPONENT_INSTANCES, COMPONENT_FIELDS.COMPONENT_INSTANCES_PROPERTIES, COMPONENT_FIELDS.COMPONENT_PROPERTIES]);
134     }
135
136     getComponentDeploymentArtifacts(component: Component): Observable<ComponentGenericResponse> {
137         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_DEPLOYMENT_ARTIFACTS]);
138     }
139
140     getComponentInformationalArtifacts(component: Component): Observable<ComponentGenericResponse> {
141         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INFORMATIONAL_ARTIFACTS]);
142     }
143
144     getComponentInformationalArtifactsAndInstances(component: Component): Observable<ComponentGenericResponse> {
145         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INFORMATIONAL_ARTIFACTS, COMPONENT_FIELDS.COMPONENT_INSTANCES]);
146     }
147
148     getComponentToscaArtifacts(component: Component): Observable<ComponentGenericResponse> {
149         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_TOSCA_ARTIFACTS]);
150     }
151
152     getComponentProperties(component: Component): Observable<ComponentGenericResponse> {
153         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_PROPERTIES]);
154     }
155
156     getInterfaceOperations(component: Component): Observable<ComponentGenericResponse> {
157         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INTERFACE_OPERATIONS]);
158     }
159
160     getInterfaceOperation(component: Component, operation: OperationModel): Observable<OperationModel> {
161         return this.http.get<OperationModel>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations/' + operation.uniqueId);
162     }
163
164     // tslint:disable-next-line:member-ordering
165     createInterfaceOperation(component: Component, operation: OperationModel): Observable<OperationModel> {
166         const operationList = {
167             'interfaces': {
168                 [operation.interfaceType]: {
169                     'type': operation.interfaceType,
170                     'operations': {
171                         [operation.name]: new BEOperationModel(operation)
172                     }
173                 }
174             }
175         };
176         return this.http.post<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
177         .map((res: any) => {
178             const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
179             const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
180             return new OperationModel({
181                 ...newOperation,
182                 interfaceType: interf.type,
183                 interfaceId: interf.uniqueId,
184                 artifactFileName: operation.artifactFileName
185             });
186         });
187     }
188
189     // tslint:disable-next-line:member-ordering
190     updateInterfaceOperation(component: Component, operation: OperationModel): Observable<OperationModel> {
191         const operationList = {
192             interfaces: {
193                 [operation.interfaceType]: {
194                     type: operation.interfaceType,
195                     operations: {
196                         [operation.name]: new BEOperationModel(operation)
197                     }
198                 }
199             }
200         };
201         return this.http.put<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
202         .map((res: any) => {
203             const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
204             const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
205             return new OperationModel({
206                 ...newOperation,
207                 interfaceType: interf.type,
208                 interfaceId: interf.uniqueId,
209                 artifactFileName: operation.artifactFileName
210             });
211         });
212     }
213
214     updateComponentInterfaceOperation(componentMetaDataId: string,
215                                       operation: InterfaceOperationModel): Observable<InterfaceOperationModel> {
216         const operationList = {
217             interfaces: {
218                 [operation.interfaceType]: {
219                     type: operation.interfaceType,
220                     operations: {
221                         [operation.name]: new BEInterfaceOperationModel(operation)
222                     }
223                 }
224             }
225         };
226         return this.http.put<any>(this.baseUrl + 'resources/' + componentMetaDataId + '/interfaceOperation', operationList)
227         .map((res: any) => {
228             const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
229             const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
230
231             return new InterfaceOperationModel({
232                 ...newOperation,
233                 interfaceType: interf.type,
234                 interfaceId: interf.uniqueId,
235             });
236         });
237     }
238
239     createComponentInterfaceOperation(componentMetaDataId: string,
240                                       componentMetaDataType: string,
241                                       operation: InterfaceOperationModel): Observable<InterfaceOperationModel> {
242         const operationList = {
243             interfaces: {
244                 [operation.interfaceType]: {
245                     type: operation.interfaceType,
246                     operations: {
247                         [operation.name]: new BEInterfaceOperationModel(operation)
248                     }
249                 }
250             }
251         };
252         console.log(operationList);
253         console.log(this.baseUrl + componentMetaDataType + componentMetaDataId + '/resource/interfaceOperation')
254         return this.http.post<any>(this.baseUrl + componentMetaDataType + componentMetaDataId + '/resource/interfaceOperation', operationList)
255         .map((res: any) => {
256             const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
257             const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
258
259             return new InterfaceOperationModel({
260                 ...newOperation,
261                 interfaceType: interf.type,
262                 interfaceId: interf.uniqueId,
263             });
264         });
265     }
266
267     deleteInterfaceOperation(component: Component, operation: OperationModel): Observable<OperationModel> {
268         return this.http.delete<OperationModel>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaces/' + operation.interfaceId + '/operations/' + operation.uniqueId);
269     }
270
271     getInterfaceTypes(component: Component): Observable<{ [id: string]: Array<string> }> {
272         return this.getInterfaceTypesByModel(component && component.model);
273     }
274
275     getInterfaceTypesByModel(model: string): Observable<{ [id: string]: Array<string> }> {
276         return this.http.get<any>(this.baseUrl + 'interfaceLifecycleTypes' + ((model) ? '?model=' + model : ''))
277         .map((res: any) => {
278             const interfaceMap = {};
279             if (!res) {
280                 return interfaceMap;
281             }
282             Object.keys(res).forEach(interfaceName => {
283                 const interface1 = res[interfaceName];
284                 if (!interface1.toscaPresentation.operations) {
285                     return;
286                 }
287                 interfaceMap[interface1.toscaPresentation.type] = Object.keys(interface1.toscaPresentation.operations);
288             });
289             return interfaceMap;
290         });
291     }
292
293     uploadInterfaceOperationArtifact(component: Component, newOperation: OperationModel, oldOperation: OperationModel) {
294         const payload = {
295             artifactType: "WORKFLOW",
296             artifactName: oldOperation.artifactFileName,
297             description: "Workflow Artifact Description",
298             payloadData: oldOperation.artifactData
299         };
300
301         const headers = new HttpHeaders().append('Content-MD5', HttpHelperService.getHeaderMd5(payload));
302
303         return this.http.post(this.baseUrl + component.getTypeUrl() + component.uuid + '/interfaces/' + newOperation.interfaceId + '/operations/' + newOperation.uniqueId + '/artifacts/' + newOperation.implementation.artifactUUID,
304             payload, {headers: headers}
305         ).map((res: any) => {
306             const fileName = res.artifactDisplayName || res.artifactName;
307             newOperation.artifactFileName = fileName;
308             return res;
309         });
310     }
311
312     getCapabilitiesAndRequirements(componentType: string, componentId: string): Observable<ComponentGenericResponse> {
313         return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_REQUIREMENTS, COMPONENT_FIELDS.COMPONENT_CAPABILITIES]);
314     }
315
316     getDeploymentGraphData(component: Component): Observable<ComponentGenericResponse> {
317         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_RELATION, COMPONENT_FIELDS.COMPONENT_INSTANCES, COMPONENT_FIELDS.COMPONENT_GROUPS]);
318     }
319
320     createInput(component: Component, inputsToCreate: InstancePropertiesAPIMap, isSelf: boolean): Observable<any> {
321         const inputs = isSelf ? {serviceProperties: inputsToCreate.componentInstanceProperties} : inputsToCreate;
322         return this.http.post<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/create/inputs', inputs);
323     }
324
325     createListInput(component: Component, input: any, isSelf: boolean): Observable<any> {
326         let inputs: any;
327         if (isSelf) {
328             // change componentInstanceProperties -> serviceProperties
329             inputs = {
330                 componentInstInputsMap: {
331                     serviceProperties: input.componentInstInputsMap.componentInstanceProperties
332                 },
333                 listInput: input.listInput
334             };
335         } else {
336             inputs = input;
337         }
338         return this.http.post<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/create/listInput', inputs);
339     }
340
341     createPolicy(component: Component, policiesToCreate: InstancePropertiesAPIMap, isSelf: boolean): Observable<any> {
342         const policiesList =
343             isSelf ?
344                 {
345                     'componentPropertiesToPolicies': {
346                         ...policiesToCreate.componentInstanceProperties
347                     }
348                 } :
349                 {
350                     'componentInstancePropertiesToPolicies': {
351                         ...policiesToCreate.componentInstanceProperties
352                     }
353                 };
354         return this.http.post(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/create/policies', policiesList);
355     }
356
357     deletePolicy(component: Component, policy: PolicyInstance) {
358         return this.http.put<PolicyInstance>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/policies/' + policy.uniqueId + '/undeclare', policy);
359     }
360
361     restoreComponent(componentType: string, componentId: string) {
362         return this.http.post(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/restore', {})
363     }
364
365     archiveComponent(componentType: string, componentId: string) {
366         return this.http.post(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/archive', {})
367     }
368
369     deleteInput(component: Component, input: InputBEModel): Observable<InputBEModel> {
370
371         return this.http.delete<InputBEModel>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/delete/' + input.uniqueId + '/input')
372         .map((res) => {
373             return new InputBEModel(res);
374         })
375     }
376
377     deleteOutput(component: Component, output: OutputBEModel): Observable<OutputBEModel> {
378
379         return this.http.delete<OutputBEModel>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/delete/' + output.uniqueId + '/output')
380         .map((res) => {
381             return new OutputBEModel(res);
382         })
383     }
384
385     updateComponentInputs(component: Component, inputs: InputBEModel[]): Observable<InputBEModel[]> {
386
387         return this.http.post<InputBEModel[]>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/update/inputs', inputs)
388         .map((res) => {
389             return res.map((input) => new InputBEModel(input));
390         })
391     }
392
393     updateComponentOutputs(component: Component, outputs: OutputBEModel[]): Observable<OutputBEModel[]> {
394
395         return this.http.post<OutputBEModel[]>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/update/outputs', outputs)
396         .map((res) => {
397             return res.map((output) => new OutputBEModel(output));
398         })
399     }
400
401     filterComponentInstanceProperties(component: Component, filterData: FilterPropertiesAssignmentData): Observable<InstanceBePropertiesMap> {//instance-property-be-map
402         let params: HttpParams = new HttpParams();
403         filterData.selectedTypes.forEach((type: string) => {
404             params = params.append('resourceType', type);
405         });
406
407         return this.http.get<InstanceBePropertiesMap>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/filteredproperties/' + filterData.propertyName, {params: params});
408     }
409
410     filterComponentInstanceAttributes(component: Component, filterData: FilterPropertiesAssignmentData): Observable<InstanceBePropertiesMap> {//instance-property-be-map
411         let params: HttpParams = new HttpParams();
412         filterData.selectedTypes.forEach((type: string) => {
413             params = params.append('resourceType', type);
414         });
415
416         return this.http.get<InstanceBePropertiesMap>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/filteredproperties/' + filterData.propertyName, {params: params});
417     }
418
419     deleteComponent(componentType: string, componentId: string) {
420         return this.http.delete(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + "?deleteAction=DELETE", {});
421     }
422
423     createServiceProperty(component: Component, propertyModel: PropertyBEModel): Observable<PropertyBEModel> {
424         let serverObject = {};
425         serverObject[propertyModel.name] = propertyModel;
426         return this.http.post(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/properties', serverObject)
427         .map((res: PropertyBEModel) => {
428             const property: PropertyBEModel = new PropertyBEModel(res);
429             return property;
430         })
431     }
432
433     getServiceProperties(component: Component): Observable<PropertyBEModel[]> {
434         return this.http.get(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/properties')
435         .map((res: PropertyBEModel[]) => {
436             if (!res) {
437                 return new Array<PropertyBEModel>();
438             }
439             return CommonUtils.initBeProperties(res);
440         });
441     }
442
443     updateServiceProperties(component: Component, properties: PropertyBEModel[]) {
444         return this.http.put<PropertyBEModel[]>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/properties', properties)
445         .map((res) => {
446             const resJson = res;
447             return _.map(resJson,
448                 (resValue: PropertyBEModel) => new PropertyBEModel(resValue));
449         });
450     }
451
452     deleteServiceProperty(component: Component, property: PropertyBEModel): Observable<string> {
453         return this.http.delete(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/properties/' + property.uniqueId)
454         .map((res: Response) => {
455             return property.uniqueId;
456         })
457     }
458
459     getDependencies(componentType: string, componentId: string): Observable<IDependenciesServerResponse[]> {
460         return this.http.get<IDependenciesServerResponse[]>(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/dependencies');
461     }
462
463     automatedUpgrade(componentType: string, componentId: string, componentsIdsToUpgrade: IAutomatedUpgradeRequestObj[]): Observable<AutomatedUpgradeGenericResponse> {
464         return this.http.post<AutomatedUpgradeGenericResponse>(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/automatedupgrade', componentsIdsToUpgrade);
465     }
466
467     updateMultipleComponentInstances(componentId: string, instances: ComponentInstance[]): Observable<ComponentInstance[]> {
468         return this.http.post<ComponentInstance[]>(this.baseUrl + componentId + '/resourceInstance/multipleComponentInstance', instances);
469     }
470
471     getServiceFilterConstraints(component: Component): Observable<ComponentGenericResponse> {
472         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [SERVICE_FIELDS.NODE_FILTER]);
473     }
474
475     createServiceFilterConstraints(component: Component, componentInstance: ComponentInstance, constraint: FilterConstraint): Observable<any> {
476         return this.http.post<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/resourceInstances/' + componentInstance.uniqueId + '/nodeFilter', constraint);
477     }
478
479     updateServiceFilterConstraints(component: Component, componentInstance: ComponentInstance, constraints: FilterConstraint[]): Observable<any> {
480         return this.http.put<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/resourceInstances/' + componentInstance.uniqueId + '/nodeFilter/', constraints);
481     }
482
483     deleteServiceFilterConstraints(component: Component, componentInstance: ComponentInstance, constraintIndex: number) {
484         return this.http.delete<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/resourceInstances/' + componentInstance.uniqueId + '/nodeFilter/' + constraintIndex);
485     }
486
487     protected analyzeComponentDataResponse(res: Response): ComponentGenericResponse {
488         return new ComponentGenericResponse().deserialize(res);
489     }
490 }