From 50c930a4095964a77611900401eff85f001c4aed Mon Sep 17 00:00:00 2001 From: aribeiro Date: Mon, 25 May 2020 11:33:22 +0100 Subject: Add Support for node_filters Allows for node_filter to be specified for a node template to provide processing instructions to the orchestrator Issue-ID: SDC-3095 Change-Id: I4e496e300552049d9bfd00df878b86d9fb97312b Signed-off-by: aribeiro --- .../service-dependencies/service-dependencies.component.html | 2 +- .../service-dependencies/service-dependencies.component.ts | 9 ++++++--- .../services/component-services/topology-template.service.ts | 12 ++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'catalog-ui/src') diff --git a/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.html b/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.html index 833f6f3c62..f093143054 100644 --- a/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.html +++ b/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.html @@ -15,7 +15,7 @@ -
+
diff --git a/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts b/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts index f3fd36364a..495782494c 100644 --- a/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts +++ b/catalog-ui/src/app/ng2/components/logic/service-dependencies/service-dependencies.component.ts @@ -315,7 +315,8 @@ export class ServiceDependenciesComponent { this.topologyTemplateService.createServiceFilterConstraints( this.compositeService.uniqueId, this.currentServiceInstance.uniqueId, - newRuleToCreate + newRuleToCreate, + this.compositeService.componentType ).subscribe( (response) => { this.updateRulesListEvent.emit(response.properties); this.isLoading = false; @@ -331,7 +332,8 @@ export class ServiceDependenciesComponent { this.topologyTemplateService.updateServiceFilterConstraints( this.compositeService.uniqueId, this.currentServiceInstance.uniqueId, - allRulesToUpdate + allRulesToUpdate, + this.compositeService.componentType ).subscribe((response) => { this.updateRulesListEvent.emit(response.properties); this.isLoading = false; @@ -354,7 +356,8 @@ export class ServiceDependenciesComponent { this.topologyTemplateService.deleteServiceFilterConstraints( this.compositeService.uniqueId, this.currentServiceInstance.uniqueId, - index + index, + this.compositeService.componentType ).subscribe( (response) => { this.updateRulesListEvent.emit(response.properties); this.isLoading = false; diff --git a/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts b/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts index 6d19ed8bcc..095c8d6e76 100644 --- a/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts +++ b/catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts @@ -384,16 +384,16 @@ export class TopologyTemplateService { return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_PROPERTIES]); } - createServiceFilterConstraints(componentMetaDataId: string, componentInstanceId: string, constraint: ConstraintObject): Observable { - return this.http.post(this.baseUrl + 'services/' + componentMetaDataId + '/resourceInstances/' + componentInstanceId + '/nodeFilter', constraint); + createServiceFilterConstraints(componentMetaDataId: string, componentInstanceId: string, constraint: ConstraintObject, componentType: string): Observable { + return this.http.post(this.baseUrl + this.getServerTypeUrl(componentType) + componentMetaDataId + '/resourceInstances/' + componentInstanceId + '/nodeFilter', constraint); } - updateServiceFilterConstraints(componentMetaDataId: string, componentInstanceId: string, constraints: ConstraintObject[]):Observable { - return this.http.put(this.baseUrl + 'services/' + componentMetaDataId + '/resourceInstances/' + componentInstanceId + '/nodeFilter', constraints) + updateServiceFilterConstraints(componentMetaDataId: string, componentInstanceId: string, constraints: ConstraintObject[], componentType: string):Observable{ + return this.http.put(this.baseUrl + this.getServerTypeUrl(componentType) + componentMetaDataId + '/resourceInstances/' + componentInstanceId + '/nodeFilter', constraints) } - deleteServiceFilterConstraints(componentMetaDataId: string, componentInstanceId: string, constraintIndex: number): Observable{ - return this.http.delete(this.baseUrl + 'services/' + componentMetaDataId + '/resourceInstances/' + componentInstanceId + '/nodeFilter/' + constraintIndex) + deleteServiceFilterConstraints(componentMetaDataId: string, componentInstanceId: string, constraintIndex: number, componentType: string): Observable{ + return this.http.delete(this.baseUrl + this.getServerTypeUrl(componentType) + componentMetaDataId + '/resourceInstances/' + componentInstanceId + '/nodeFilter/' + constraintIndex) } deletePolicy(component: Component, policy: PolicyInstance): Observable { -- cgit 1.2.3-korg