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=42ad2213cf3d87abd7779db58ed2da2ef32c9d58;hb=3fe1dac7e8d82e2e9dedb52e82f45e493d0ff6de;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..42ad221 100644 --- a/webapp-frontend/src/app/services/ei/ei.service.ts +++ b/webapp-frontend/src/app/services/ei/ei.service.ts @@ -21,9 +21,7 @@ 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 { EIJob, ProducerStatus, ProducerRegistrationInfo } from '../../interfaces/ei.types'; /** * Services for calling the EI endpoints. @@ -33,10 +31,10 @@ 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'; + readonly eiJobsPath = 'eijobs'; + readonly eiProducersPath = 'eiproducers'; + readonly eiProducerStatusPath = 'status'; private buildPath(...args: any[]) { let result = this.basePath; @@ -50,30 +48,23 @@ 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); + getJobsForProducer(producerId: string): Observable { + const url = this.buildPath(this.eiProducersPath, producerId, this.eiJobsPath); + return this.httpClient.get(url); } - getEIJobs(): Observable { - const url = this.buildPath(this.eiJobPath); - return this.httpClient.get(url); + getProducer(producerId: string): Observable { + const url = this.buildPath(this.eiProducersPath, producerId); + return this.httpClient.get(url); } - getEIProducers(): Observable { - const url = this.buildPath(this.eiProducerPath); - return this.httpClient.get(url); + getProducerStatus(producerId: string): Observable { + const url = this.buildPath(this.eiProducersPath, producerId, this.eiProducerStatusPath); + return this.httpClient.get(url); } }