summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/services
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2022-06-15 15:30:40 +0100
committerMichael Morris <michael.morris@est.tech>2022-06-22 20:36:22 +0000
commit7a7b13726c195e2944ccc59e4d5c5ade57318763 (patch)
treec22384a2abfc24adeb1c69a3696cda15c8e37548 /catalog-ui/src/app/ng2/services
parentfbab79aeaccf74385c9a55b697a1055a86bdf171 (diff)
Support TOSCA get_attribute function
Adds support to TOSCA get_attribute function in the Property Assignment TOSCA Function modal. Change-Id: I73dda215a7c9d7fecf0803cc259634279c3bdfb6 Issue-ID: SDC-4053 Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-ui/src/app/ng2/services')
-rw-r--r--catalog-ui/src/app/ng2/services/component-services/topology-template.service.ts54
1 files changed, 26 insertions, 28 deletions
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 92a12c8305..a2abb38f65 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
@@ -22,27 +22,28 @@
*/
import * as _ from "lodash";
-import {Injectable, Inject} from '@angular/core';
+import {Inject, Injectable} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';
import {
+ ArtifactModel,
+ AttributeModel,
+ Capability,
Component,
+ FilterPropertiesAssignmentData,
+ IFileDownload,
InputBEModel,
InstancePropertiesAPIMap,
- FilterPropertiesAssignmentData,
- ArtifactModel,
+ OperationModel,
PropertyModel,
- IFileDownload,
- AttributeModel,
- Capability, Requirement, BEOperationModel, InterfaceModel
+ Requirement
} from "app/models";
-import {ArtifactGroupType, COMPONENT_FIELDS} from "app/utils";
+import {API_QUERY_PARAMS, ArtifactGroupType, COMPONENT_FIELDS} from "app/utils";
import {ComponentGenericResponse} from "../responses/component-generic-response";
import {InstanceBePropertiesMap} from "../../../models/properties-inputs/property-fe-map";
-import {API_QUERY_PARAMS} from "app/utils";
import {ComponentType, ServerTypeUrl, SERVICE_FIELDS} from "../../../utils/constants";
-import {SdcConfigToken, ISdcConfig} from "../../config/sdc-config.config";
+import {ISdcConfig, SdcConfigToken} from "../../config/sdc-config.config";
import {IDependenciesServerResponse} from "../responses/dependencies-server-response";
import {AutomatedUpgradeGenericResponse} from "../responses/automated-upgrade-response";
import {IAutomatedUpgradeRequestObj} from "../../pages/automated-upgrade/automated-upgrade.service";
@@ -50,26 +51,15 @@ import {ComponentInstance} from "../../../models/componentsInstances/componentIn
import {CommonUtils} from "../../../utils/common-utils";
import {RelationshipModel} from "../../../models/graph/relationship";
import {ServiceGenericResponse} from "../responses/service-generic-response";
-import { HttpClient, HttpParams, HttpHeaders } from "@angular/common/http";
-import { HttpHelperService } from "../http-hepler.service";
-import {
- Component as TopologyTemplate,
- FullComponentInstance,
- Service,
- OperationModel,
-} from 'app/models';
-import { ConsumptionInput } from "../../components/logic/service-consumption/service-consumption.component";
-import { ConstraintObject } from "../../components/logic/service-dependencies/service-dependencies.component";
-import { ComponentMetadata } from "../../../models/component-metadata";
-import { PolicyInstance } from "../../../models/graph/zones/policy-instance";
-import { PropertyBEModel } from "../../../models/properties-inputs/property-be-model";
+import {HttpClient, HttpHeaders, HttpParams} from "@angular/common/http";
+import {HttpHelperService} from "../http-hepler.service";
+import {ConsumptionInput} from "../../components/logic/service-consumption/service-consumption.component";
+import {ConstraintObject} from "../../components/logic/service-dependencies/service-dependencies.component";
+import {PolicyInstance} from "../../../models/graph/zones/policy-instance";
+import {PropertyBEModel} from "../../../models/properties-inputs/property-be-model";
import {map} from "rxjs/operators";
import {CapabilitiesConstraintObject} from "../../components/logic/capabilities-constraint/capabilities-constraint.component";
-import {
- BEInterfaceOperationModel,
- ComponentInterfaceDefinitionModel,
- InterfaceOperationModel
-} from "../../../models/interfaceOperation";
+import {BEInterfaceOperationModel, InterfaceOperationModel} from "../../../models/interfaceOperation";
import {AttributeBEModel} from "../../../models/attributes-outputs/attribute-be-model";
import {InstanceAttributesAPIMap} from "../../../models/attributes-outputs/attribute-fe-map";
@@ -169,6 +159,10 @@ export class TopologyTemplateService {
return this.getComponentDataByFieldsName(componentType, componentUniqueId, [COMPONENT_FIELDS.COMPONENT_PROPERTIES]);
}
+ findAllComponentAttributes(componentType: string, componentUniqueId: string): Observable<ComponentGenericResponse> {
+ return this.getComponentDataByFieldsName(componentType, componentUniqueId, [COMPONENT_FIELDS.COMPONENT_ATTRIBUTES]);
+ }
+
getCapabilitiesAndRequirements(componentType: string, componentId: string): Observable<ComponentGenericResponse> {
return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_REQUIREMENTS, COMPONENT_FIELDS.COMPONENT_CAPABILITIES]);
}
@@ -393,7 +387,7 @@ export class TopologyTemplateService {
}
updateProperty = (componentType: string, componentId: string, property: PropertyModel): Observable<PropertyModel> => {
- var propertiesList:PropertyBEModel[] = [property];
+ const propertiesList: PropertyBEModel[] = [property];
return this.http.put<PropertyModel>(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/properties', propertiesList)
.map((response) => {
return new PropertyModel(response[Object.keys(response)[0]]);
@@ -470,6 +464,10 @@ export class TopologyTemplateService {
return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_PROPERTIES]);
}
+ findAllComponentInstanceAttributes(componentType: string, componentId: string): Observable<ComponentGenericResponse> {
+ return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_ATTRIBUTES]);
+ }
+
getComponentInstanceCapabilityProperties(componentType: string, componentId: string): Observable<ComponentGenericResponse> {
return this.getComponentDataByFieldsName(componentType, componentId,
[COMPONENT_FIELDS.COMPONENT_CAPABILITIES, COMPONENT_FIELDS.COMPONENT_CAPABILITIES_PROPERTIES]);