Provide UI page for interface assignment in service for VFC instances
[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_INTERFACE_OPERATIONS, 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     
161
162     getInterfaceOperation(component: Component, operation: OperationModel): Observable<OperationModel> {
163         return this.http.get<OperationModel>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations/' + operation.uniqueId);
164     }
165
166     // tslint:disable-next-line:member-ordering
167     createInterfaceOperation(component: Component, operation: OperationModel): Observable<OperationModel> {
168         const operationList = {
169             'interfaces': {
170                 [operation.interfaceType]: {
171                     'type': operation.interfaceType,
172                     'operations': {
173                         [operation.name]: new BEOperationModel(operation)
174                     }
175                 }
176             }
177         };
178         return this.http.post<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
179         .map((res: any) => {
180             const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
181             const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
182             return new OperationModel({
183                 ...newOperation,
184                 interfaceType: interf.type,
185                 interfaceId: interf.uniqueId,
186                 artifactFileName: operation.artifactFileName
187             });
188         });
189     }
190
191     // tslint:disable-next-line:member-ordering
192     updateInterfaceOperation(component: Component, operation: OperationModel): Observable<OperationModel> {
193         const operationList = {
194             interfaces: {
195                 [operation.interfaceType]: {
196                     type: operation.interfaceType,
197                     operations: {
198                         [operation.name]: new BEOperationModel(operation)
199                     }
200                 }
201             }
202         };
203         return this.http.put<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
204         .map((res: any) => {
205             const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
206             const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
207             return new OperationModel({
208                 ...newOperation,
209                 interfaceType: interf.type,
210                 interfaceId: interf.uniqueId,
211                 artifactFileName: operation.artifactFileName
212             });
213         });
214     }
215
216     updateComponentInterfaceOperation(componentMetaDataId: string,
217                                       operation: InterfaceOperationModel): Observable<InterfaceOperationModel> {
218         const operationList = {
219             interfaces: {
220                 [operation.interfaceType]: {
221                     type: operation.interfaceType,
222                     operations: {
223                         [operation.name]: new BEInterfaceOperationModel(operation)
224                     }
225                 }
226             }
227         };
228         return this.http.put<any>(this.baseUrl + 'resources/' + componentMetaDataId + '/interfaceOperation', operationList)
229         .map((res: any) => {
230             const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
231             const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
232
233             return new InterfaceOperationModel({
234                 ...newOperation,
235                 interfaceType: interf.type,
236                 interfaceId: interf.uniqueId,
237             });
238         });
239     }
240
241     createComponentInterfaceOperation(componentMetaDataId: string,
242                                       componentMetaDataType: string,
243                                       operation: InterfaceOperationModel): Observable<InterfaceOperationModel> {
244         const operationList = {
245             interfaces: {
246                 [operation.interfaceType]: {
247                     type: operation.interfaceType,
248                     operations: {
249                         [operation.name]: new BEInterfaceOperationModel(operation)
250                     }
251                 }
252             }
253         };
254         console.log(operationList);
255         console.log(this.baseUrl + componentMetaDataType + componentMetaDataId + '/resource/interfaceOperation')
256         return this.http.post<any>(this.baseUrl + componentMetaDataType + componentMetaDataId + '/resource/interfaceOperation', operationList)
257         .map((res: any) => {
258             const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
259             const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
260
261             return new InterfaceOperationModel({
262                 ...newOperation,
263                 interfaceType: interf.type,
264                 interfaceId: interf.uniqueId,
265             });
266         });
267     }
268
269     deleteInterfaceOperation(component: Component, operation: OperationModel): Observable<OperationModel> {
270         return this.http.delete<OperationModel>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaces/' + operation.interfaceId + '/operations/' + operation.uniqueId);
271     }
272
273     getInterfaceTypes(component: Component): Observable<{ [id: string]: Array<string> }> {
274         return this.getInterfaceTypesByModel(component && component.model);
275     }
276
277     getInterfaceTypesByModel(model: string): Observable<{ [id: string]: Array<string> }> {
278         return this.http.get<any>(this.baseUrl + 'interfaceLifecycleTypes' + ((model) ? '?model=' + model : ''))
279         .map((res: any) => {
280             const interfaceMap = {};
281             if (!res) {
282                 return interfaceMap;
283             }
284             Object.keys(res).forEach(interfaceName => {
285                 const interface1 = res[interfaceName];
286                 if (!interface1.toscaPresentation.operations) {
287                     return;
288                 }
289                 interfaceMap[interface1.toscaPresentation.type] = Object.keys(interface1.toscaPresentation.operations);
290             });
291             return interfaceMap;
292         });
293     }
294
295     uploadInterfaceOperationArtifact(component: Component, newOperation: OperationModel, oldOperation: OperationModel) {
296         const payload = {
297             artifactType: "WORKFLOW",
298             artifactName: oldOperation.artifactFileName,
299             description: "Workflow Artifact Description",
300             payloadData: oldOperation.artifactData
301         };
302
303         const headers = new HttpHeaders().append('Content-MD5', HttpHelperService.getHeaderMd5(payload));
304
305         return this.http.post(this.baseUrl + component.getTypeUrl() + component.uuid + '/interfaces/' + newOperation.interfaceId + '/operations/' + newOperation.uniqueId + '/artifacts/' + newOperation.implementation.artifactUUID,
306             payload, {headers: headers}
307         ).map((res: any) => {
308             const fileName = res.artifactDisplayName || res.artifactName;
309             newOperation.artifactFileName = fileName;
310             return res;
311         });
312     }
313
314     getCapabilitiesAndRequirements(componentType: string, componentId: string): Observable<ComponentGenericResponse> {
315         return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_REQUIREMENTS, COMPONENT_FIELDS.COMPONENT_CAPABILITIES]);
316     }
317
318     getDeploymentGraphData(component: Component): Observable<ComponentGenericResponse> {
319         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_RELATION, COMPONENT_FIELDS.COMPONENT_INSTANCES, COMPONENT_FIELDS.COMPONENT_GROUPS]);
320     }
321
322     createInput(component: Component, inputsToCreate: InstancePropertiesAPIMap, isSelf: boolean): Observable<any> {
323         const inputs = isSelf ? {serviceProperties: inputsToCreate.componentInstanceProperties} : inputsToCreate;
324         return this.http.post<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/create/inputs', inputs);
325     }
326
327     createListInput(component: Component, input: any, isSelf: boolean): Observable<any> {
328         let inputs: any;
329         if (isSelf) {
330             // change componentInstanceProperties -> serviceProperties
331             inputs = {
332                 componentInstInputsMap: {
333                     serviceProperties: input.componentInstInputsMap.componentInstanceProperties
334                 },
335                 listInput: input.listInput
336             };
337         } else {
338             inputs = input;
339         }
340         return this.http.post<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/create/listInput', inputs);
341     }
342
343     createPolicy(component: Component, policiesToCreate: InstancePropertiesAPIMap, isSelf: boolean): Observable<any> {
344         const policiesList =
345             isSelf ?
346                 {
347                     'componentPropertiesToPolicies': {
348                         ...policiesToCreate.componentInstanceProperties
349                     }
350                 } :
351                 {
352                     'componentInstancePropertiesToPolicies': {
353                         ...policiesToCreate.componentInstanceProperties
354                     }
355                 };
356         return this.http.post(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/create/policies', policiesList);
357     }
358
359     deletePolicy(component: Component, policy: PolicyInstance) {
360         return this.http.put<PolicyInstance>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/policies/' + policy.uniqueId + '/undeclare', policy);
361     }
362
363     restoreComponent(componentType: string, componentId: string) {
364         return this.http.post(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/restore', {})
365     }
366
367     archiveComponent(componentType: string, componentId: string) {
368         return this.http.post(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/archive', {})
369     }
370
371     deleteInput(component: Component, input: InputBEModel): Observable<InputBEModel> {
372
373         return this.http.delete<InputBEModel>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/delete/' + input.uniqueId + '/input')
374         .map((res) => {
375             return new InputBEModel(res);
376         })
377     }
378
379     deleteOutput(component: Component, output: OutputBEModel): Observable<OutputBEModel> {
380
381         return this.http.delete<OutputBEModel>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/delete/' + output.uniqueId + '/output')
382         .map((res) => {
383             return new OutputBEModel(res);
384         })
385     }
386
387     updateComponentInputs(component: Component, inputs: InputBEModel[]): Observable<InputBEModel[]> {
388
389         return this.http.post<InputBEModel[]>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/update/inputs', inputs)
390         .map((res) => {
391             return res.map((input) => new InputBEModel(input));
392         })
393     }
394
395     updateComponentOutputs(component: Component, outputs: OutputBEModel[]): Observable<OutputBEModel[]> {
396
397         return this.http.post<OutputBEModel[]>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/update/outputs', outputs)
398         .map((res) => {
399             return res.map((output) => new OutputBEModel(output));
400         })
401     }
402
403     filterComponentInstanceProperties(component: Component, filterData: FilterPropertiesAssignmentData): Observable<InstanceBePropertiesMap> {//instance-property-be-map
404         let params: HttpParams = new HttpParams();
405         filterData.selectedTypes.forEach((type: string) => {
406             params = params.append('resourceType', type);
407         });
408
409         return this.http.get<InstanceBePropertiesMap>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/filteredproperties/' + filterData.propertyName, {params: params});
410     }
411
412     filterComponentInstanceAttributes(component: Component, filterData: FilterPropertiesAssignmentData): Observable<InstanceBePropertiesMap> {//instance-property-be-map
413         let params: HttpParams = new HttpParams();
414         filterData.selectedTypes.forEach((type: string) => {
415             params = params.append('resourceType', type);
416         });
417
418         return this.http.get<InstanceBePropertiesMap>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/filteredproperties/' + filterData.propertyName, {params: params});
419     }
420
421     deleteComponent(componentType: string, componentId: string) {
422         return this.http.delete(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + "?deleteAction=DELETE", {});
423     }
424
425     createServiceProperty(component: Component, propertyModel: PropertyBEModel): Observable<PropertyBEModel> {
426         let serverObject = {};
427         serverObject[propertyModel.name] = propertyModel;
428         return this.http.post(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/properties', serverObject)
429         .map((res: PropertyBEModel) => {
430             const property: PropertyBEModel = new PropertyBEModel(res);
431             return property;
432         })
433     }
434
435     getServiceProperties(component: Component): Observable<PropertyBEModel[]> {
436         return this.http.get(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/properties')
437         .map((res: PropertyBEModel[]) => {
438             if (!res) {
439                 return new Array<PropertyBEModel>();
440             }
441             return CommonUtils.initBeProperties(res);
442         });
443     }
444
445     updateServiceProperties(component: Component, properties: PropertyBEModel[]) {
446         return this.http.put<PropertyBEModel[]>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/properties', properties)
447         .map((res) => {
448             const resJson = res;
449             return _.map(resJson,
450                 (resValue: PropertyBEModel) => new PropertyBEModel(resValue));
451         });
452     }
453
454     deleteServiceProperty(component: Component, property: PropertyBEModel): Observable<string> {
455         return this.http.delete(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/properties/' + property.uniqueId)
456         .map((res: Response) => {
457             return property.uniqueId;
458         })
459     }
460
461     getDependencies(componentType: string, componentId: string): Observable<IDependenciesServerResponse[]> {
462         return this.http.get<IDependenciesServerResponse[]>(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/dependencies');
463     }
464
465     automatedUpgrade(componentType: string, componentId: string, componentsIdsToUpgrade: IAutomatedUpgradeRequestObj[]): Observable<AutomatedUpgradeGenericResponse> {
466         return this.http.post<AutomatedUpgradeGenericResponse>(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/automatedupgrade', componentsIdsToUpgrade);
467     }
468
469     updateMultipleComponentInstances(componentId: string, instances: ComponentInstance[]): Observable<ComponentInstance[]> {
470         return this.http.post<ComponentInstance[]>(this.baseUrl + componentId + '/resourceInstance/multipleComponentInstance', instances);
471     }
472
473     getServiceFilterConstraints(component: Component): Observable<ComponentGenericResponse> {
474         return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [SERVICE_FIELDS.NODE_FILTER]);
475     }
476
477     createServiceFilterConstraints(component: Component, componentInstance: ComponentInstance, constraint: FilterConstraint): Observable<any> {
478         return this.http.post<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/resourceInstances/' + componentInstance.uniqueId + '/nodeFilter', constraint);
479     }
480
481     updateServiceFilterConstraints(component: Component, componentInstance: ComponentInstance, constraints: FilterConstraint[]): Observable<any> {
482         return this.http.put<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/resourceInstances/' + componentInstance.uniqueId + '/nodeFilter/', constraints);
483     }
484
485     deleteServiceFilterConstraints(component: Component, componentInstance: ComponentInstance, constraintIndex: number) {
486         return this.http.delete<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/resourceInstances/' + componentInstance.uniqueId + '/nodeFilter/' + constraintIndex);
487     }
488
489     protected analyzeComponentDataResponse(res: Response): ComponentGenericResponse {
490         return new ComponentGenericResponse().deserialize(res);
491     }
492 }