X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fpolicy%2Fpolicy.service.ts;h=028caa07e6836aa519dbbb7ed27e45a5a1371e1d;hb=HEAD;hp=8c6d01512722e0c2aa227560cb1f30121721b4bf;hpb=fb9a5699b247ad1518c5714224396205485a3c4c;p=portal%2Fnonrtric-controlpanel.git diff --git a/webapp-frontend/src/app/services/policy/policy.service.ts b/webapp-frontend/src/app/services/policy/policy.service.ts index 8c6d015..028caa0 100644 --- a/webapp-frontend/src/app/services/policy/policy.service.ts +++ b/webapp-frontend/src/app/services/policy/policy.service.ts @@ -31,6 +31,8 @@ import { PolicyTypes, } from "@interfaces/policy.types"; import { Rics } from "@interfaces/ric"; +import { RicConfig } from "@interfaces/ric.config"; +import { HttpHeaders } from "@angular/common/http"; /** * Services for calling the policy endpoints. @@ -83,18 +85,6 @@ export class PolicyService { return this.httpClient.get(url); } - /** - * Gets policy parameters. - * @returns Observable that should yield a policy instance - */ - getPolicy(policyTypeId: string, policyInstanceId: string): Observable { - const url = - this.buildPath(this.policyPath, policyInstanceId) + - "?type=" + - policyTypeId; - return this.httpClient.get(url); - } - /** * Creates or replaces policy instance. * @param policyTypeId ID of the policy type that the instance will have @@ -124,4 +114,18 @@ export class PolicyService { const url = this.buildPath("rics") + "?policytype_id=" + policyTypeId; return this.httpClient.get(url); } + + getConfiguration(): Observable { + const url = this.buildPath("configuration"); + return this.httpClient.get(url); + } + + updateConfiguration(ricConfig: RicConfig): Observable { + const httpOptions = { + headers: new HttpHeaders({'Content-Type': 'application/json'}), + observe: 'response' as 'body' + } + const url = this.buildPath("configuration"); + return this.httpClient.put(url, ricConfig, httpOptions); + } }