X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fei%2Fei.service.ts;h=3be9b8b76696e9c7d7a4799036766a9a4dcd4534;hb=refs%2Fchanges%2F87%2F5587%2F1;hp=976b7b8c0672caa8eeb41bc047bf92e39228af06;hpb=cde4ceece9e916ef9387e78982df21b13dc58837;p=portal%2Fnonrtric-controlpanel.git diff --git a/webapp-frontend/src/app/services/ei/ei.service.ts b/webapp-frontend/src/app/services/ei/ei.service.ts index 976b7b8..3be9b8b 100644 --- a/webapp-frontend/src/app/services/ei/ei.service.ts +++ b/webapp-frontend/src/app/services/ei/ei.service.ts @@ -20,10 +20,8 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; -import { Observable } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { EIJob, EIType, EIProducer } from '../../interfaces/ei.jobs'; -import { ControlpanelSuccessTransport } from '../../interfaces/controlpanel.types'; +import { Observable, of } from 'rxjs'; +import { EIJob, EIProducer } from '../../interfaces/ei.types'; /** * Services for calling the EI endpoints. @@ -33,10 +31,9 @@ import { ControlpanelSuccessTransport } from '../../interfaces/controlpanel.type }) export class EIService { - private basePath = 'api/enrichment'; - private eiTypePath = 'eitypes'; - private eiJobPath = 'eijobs'; - private eiProducerPath = 'eiproducers'; + private basePath = '/ei-producer/v1'; + eiJobsPath = 'eijobs'; + eiProducersPath = 'eiproducers'; private buildPath(...args: any[]) { let result = this.basePath; @@ -50,30 +47,18 @@ export class EIService { // injects to variable httpClient } - /** - * Gets version details - * @returns Observable that should yield a String - */ - getVersion(): Observable { - const url = this.buildPath('version'); - return this.httpClient.get(url).pipe( - // Extract the string here - map(res => res['data']) - ); + getProducerIds(): Observable { + const url = this.buildPath(this.eiProducersPath); + return this.httpClient.get(url); } - getEITypes(): Observable { - const url = this.buildPath(this.eiTypePath); - return this.httpClient.get(url); - } - - getEIJobs(): Observable { - const url = this.buildPath(this.eiJobPath); + getJobsForProducer(producerId: String): Observable { + const url = this.buildPath(this.eiProducersPath, producerId, this.eiJobsPath); return this.httpClient.get(url); } getEIProducers(): Observable { - const url = this.buildPath(this.eiProducerPath); + const url = this.buildPath(this.eiProducersPath); return this.httpClient.get(url); } }