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=1237b589d9902405ada9814194b9046e2fcf8694;hb=8cf8165763380e8779c9420099faf2197fa161d4;hp=d09b5efb1701fd185365395c1933b3ae92cd4e58;hpb=94225563a68aecb49e713eb8508fb278682cec08;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 d09b5ef..1237b58 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, EIProducer } from '../../interfaces/ei.types'; -import { ControlpanelSuccessTransport } from '../../interfaces/controlpanel.types'; +import { EIJob, ProducerStatus, ProducerRegistrationInfo } from '@interfaces/ei.types'; /** * Services for calling the EI endpoints. @@ -33,9 +31,10 @@ import { ControlpanelSuccessTransport } from '../../interfaces/controlpanel.type }) export class EIService { - private basePath = 'api/enrichment'; - eiJobPath = 'eijobs'; - eiProducerPath = 'eiproducers'; + private basePath = '/ei-producer/v1'; + readonly eiJobsPath = 'eijobs'; + readonly eiProducersPath = 'eiproducers'; + readonly eiProducerStatusPath = 'status'; private buildPath(...args: any[]) { let result = this.basePath; @@ -49,13 +48,23 @@ export class EIService { // injects to variable httpClient } - getEIJobs(): Observable { - const url = this.buildPath(this.eiJobPath); + getProducerIds(): Observable { + const url = this.buildPath(this.eiProducersPath); + return this.httpClient.get(url); + } + + 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); - return this.httpClient.get(url); + getProducer(producerId: string): Observable { + const url = this.buildPath(this.eiProducersPath, producerId); + return this.httpClient.get(url); + } + + getProducerStatus(producerId: string): Observable { + const url = this.buildPath(this.eiProducersPath, producerId, this.eiProducerStatusPath); + return this.httpClient.get(url); } }