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=15ab710a5920d57fd6e5a9af057a44d222b21a48;hb=9d7d3121efae3af7b8b06b9753cfd8e7bfac3650;hp=c903b2c3d9253a58bd00eddf2343af77468106c3;hpb=9872b8b01da34a6677844ebd56352c9d8c3ec09b;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 c903b2c..15ab710 100644 --- a/webapp-frontend/src/app/services/policy/policy.service.ts +++ b/webapp-frontend/src/app/services/policy/policy.service.ts @@ -22,8 +22,9 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { PolicyInstance, PolicyInstanceAck, PolicyType, PolicyTypes } from '../../interfaces/policy.types'; +import { PolicyInstance, PolicyInstanceAck, PolicyInstances, PolicyStatus, PolicyType, PolicyTypes } from '../../interfaces/policy.types'; import { ControlpanelSuccessTransport } from '../../interfaces/controlpanel.types'; +import { Ric } from 'src/app/interfaces/ric'; /** * Services for calling the policy endpoints. @@ -33,8 +34,8 @@ import { ControlpanelSuccessTransport } from '../../interfaces/controlpanel.type }) export class PolicyService { - private apiVersion2 = 'v2' - private basePath = ''; + private apiVersion2 = '/v2' + private basePath = '/a1-policy'; policyTypesPath = 'policy-types'; policyPath = 'policies'; @@ -60,9 +61,19 @@ export class PolicyService { return this.httpClient.get(url); } - getPolicyInstances(policyTypeId: string): Observable { - const url = this.buildPath(this.policyPath) + '?type=' + policyTypeId; - return this.httpClient.get(url); + getPolicyInstancesByType(policyTypeId: string): Observable { + const url = this.buildPath(this.policyPath + '?' + 'policytype_id=' + policyTypeId); + return this.httpClient.get(url); + } + + getPolicyInstance(policyId: string): Observable { + const url = this.buildPath(this.policyPath) + '/' + policyId; + return this.httpClient.get(url); + } + + getPolicyStatus(policyId: string): Observable { + const url = this.buildPath(this.policyPath) + '/' + policyId + '/status'; + return this.httpClient.get(url); } /** @@ -98,8 +109,8 @@ export class PolicyService { } - getRics(policyTypeId: string): Observable { - const url = this.buildPath('rics') + '?policyType=' + policyTypeId; + getRics(policyTypeId: string): Observable { + const url = this.buildPath('rics') + '?policytype_id=' + policyTypeId; return this.httpClient.get(url); } }