summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/services
diff options
context:
space:
mode:
authorArielk <Ariel.Kenan@amdocs.com>2018-04-16 15:37:39 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-05-01 03:38:57 +0000
commit802bd2af2e3c6ba92eb1ce0180a13b11018f6695 (patch)
tree0906a846aa2c3edc9f2067364ed812bdead9f939 /catalog-ui/src/app/ng2/services
parentd0f6cb3ef9600846358a0e7f849759be6f9d917e (diff)
Interface Operation tab and screens
Change-Id: If03234c783d6ce16fdd0945987ada83b6285f97f Issue-ID: SDC-1060 Signed-off-by: Arielk <Ariel.Kenan@amdocs.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/services')
-rw-r--r--catalog-ui/src/app/ng2/services/component-services/component.service.ts44
-rw-r--r--catalog-ui/src/app/ng2/services/responses/component-generic-response.ts6
2 files changed, 48 insertions, 2 deletions
diff --git a/catalog-ui/src/app/ng2/services/component-services/component.service.ts b/catalog-ui/src/app/ng2/services/component-services/component.service.ts
index 9c3f78a444..381995d91c 100644
--- a/catalog-ui/src/app/ng2/services/component-services/component.service.ts
+++ b/catalog-ui/src/app/ng2/services/component-services/component.service.ts
@@ -24,7 +24,7 @@ import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/toPromise';
import {Response, URLSearchParams} from '@angular/http';
-import { Component, InputBEModel, InstancePropertiesAPIMap, FilterPropertiesAssignmentData} from "app/models";
+import { Component, InputBEModel, InstancePropertiesAPIMap, FilterPropertiesAssignmentData, OperationModel, CreateOperationResponse} from "app/models";
import {COMPONENT_FIELDS} from "app/utils";
import {ComponentGenericResponse} from "../responses/component-generic-response";
import {InstanceBePropertiesMap} from "../../../models/properties-inputs/property-fe-map";
@@ -114,6 +114,48 @@ export class ComponentServiceNg2 {
return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_PROPERTIES]);
}
+ getInterfaceOperations(component:Component):Observable<ComponentGenericResponse> {
+ return this.getComponentDataByFieldsName(component.componentType, component.uniqueId, [COMPONENT_FIELDS.COMPONENT_INTERFACE_OPERATIONS]);
+ }
+
+ getInterfaceOperation(component:Component, operation:OperationModel):Observable<OperationModel> {
+ return this.http.get(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations/' + operation.uniqueId)
+ .map((res:Response) => {
+ return res.json();
+ });
+ }
+
+ createInterfaceOperation(component:Component, operation:OperationModel):Observable<CreateOperationResponse> {
+ const operationList = {
+ 'interfaceOperations': {
+ [operation.operationType]: operation
+ }
+ };
+ return this.http.post(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
+ .map((res:Response) => {
+ return res.json();
+ });
+ }
+
+ updateInterfaceOperation(component:Component, operation:OperationModel):Observable<CreateOperationResponse> {
+ const operationList = {
+ 'interfaceOperations': {
+ [operation.operationType]: operation
+ }
+ };
+ return this.http.put(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
+ .map((res:Response) => {
+ return res.json();
+ });
+ }
+
+ deleteInterfaceOperation(component:Component, operation:OperationModel):Observable<OperationModel> {
+ return this.http.delete(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations/' + operation.uniqueId)
+ .map((res:Response) => {
+ return res.json();
+ });
+ }
+
getCapabilitiesAndRequirements(componentType: string, componentId:string):Observable<ComponentGenericResponse> {
return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_REQUIREMENTS, COMPONENT_FIELDS.COMPONENT_CAPABILITIES]);
}
diff --git a/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts b/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts
index e7c88a0ab8..5036a10a9d 100644
--- a/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts
+++ b/catalog-ui/src/app/ng2/services/responses/component-generic-response.ts
@@ -22,7 +22,7 @@
* Created by ob0695 on 4/18/2017.
*/
-import { ArtifactGroupModel, PropertyModel, PropertiesGroup, AttributeModel, AttributesGroup, ComponentInstance,
+import { ArtifactGroupModel, PropertyModel, PropertiesGroup, AttributeModel, AttributesGroup, ComponentInstance, OperationModel,
InputBEModel, Module, ComponentMetadata, RelationshipModel, RequirementsGroup, CapabilitiesGroup,InputFEModel} from "app/models";
import {CommonUtils} from "app/utils";
import {Serializable} from "../utils/serializable";
@@ -47,6 +47,7 @@ export class ComponentGenericResponse implements Serializable<ComponentGenericR
public policies:Array<PolicyInstance>;
public groups:Array<Module>;
public interfaces:any;
+ public interfaceOperations:Array<OperationModel>;
public additionalInformation:any;
public derivedList:Array<any>;
@@ -88,6 +89,9 @@ export class ComponentGenericResponse implements Serializable<ComponentGenericR
if(response.toscaArtifacts) {
this.toscaArtifacts = new ArtifactGroupModel(response.toscaArtifacts);
}
+ if(response.interfaces) {
+ this.interfaceOperations = CommonUtils.initInterfaceOperations(response.interfaces);
+ }
if(response.metadata) {
this.metadata = new ComponentMetadata().deserialize(response.metadata);
}