IFileDownload,
InputBEModel,
InstancePropertiesAPIMap,
+ InterfaceModel,
OperationModel,
PropertyModel,
Requirement
return this.http.put<any>(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/toscaTemplate', file)
}
+ putServiceToscaModel(componentId: string, componentType: string, file) {
+ let uploadData:FormData = new FormData();
+ uploadData.append('upload', file);
+ return this.http.put<any>(this.baseUrl + this.getServerTypeUrl(componentType) + componentId + '/toscaModel', uploadData);
+ }
+
getFullComponent(componentType: string, uniqueId: string): Observable<Component> {
return this.http.get<Component>(this.baseUrl + this.getServerTypeUrl(componentType) + uniqueId);
}
return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_PROPERTIES]);
}
+ getComponentInstancesAndInputsAndProperties(componentType: string, componentId: string): Observable<ComponentGenericResponse> {
+ return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_INSTANCES ,COMPONENT_FIELDS.COMPONENT_INSTANCES_INPUTS, COMPONENT_FIELDS.COMPONENT_INSTANCES_PROPERTIES]);
+ }
+
findAllComponentInstanceAttributes(componentType: string, componentId: string): Observable<ComponentGenericResponse> {
return this.getComponentDataByFieldsName(componentType, componentId, [COMPONENT_FIELDS.COMPONENT_INSTANCES_ATTRIBUTES]);
}
.pipe(map(response => response && response.defaultCustomToscaFunction ? response.defaultCustomToscaFunction : []));
}
+ createComponentInstanceInterfaceOperation(componentMetaDataId: string, componentInstanceId: string,
+ operation: InterfaceOperationModel): Observable<InterfaceOperationModel> {
+ const operationList = {
+ interfaces: {
+ [operation.interfaceType]: {
+ type: operation.interfaceType,
+ operations: {
+ [operation.name]: new BEInterfaceOperationModel(operation)
+ }
+ }
+ }
+ };
+ return this.http.post<any>(this.baseUrl + 'services/' + componentMetaDataId + '/componentInstance/' + componentInstanceId + '/interfaceOperation', operationList)
+ .map((res: any) => {
+ const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
+ const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
+
+ return new InterfaceOperationModel({
+ ...newOperation,
+ interfaceType: interf.type,
+ interfaceId: interf.uniqueId,
+ });
+ });
+ }
+
}