X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fapp-mgr%2Fapp-mgr.service.ts;h=f9df38c370036657ede9c216a9928051ed998475;hb=b244a344777f416ad9b5ff09d1a8ad5f5517f2bf;hp=428bbe3e32e940083d0b0dce3d9d874dd22b14c9;hpb=80f26bbeef6caea8f9946e8a0e1a5e0319dacc38;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/services/app-mgr/app-mgr.service.ts b/webapp-frontend/src/app/services/app-mgr/app-mgr.service.ts index 428bbe3e..f9df38c3 100644 --- a/webapp-frontend/src/app/services/app-mgr/app-mgr.service.ts +++ b/webapp-frontend/src/app/services/app-mgr/app-mgr.service.ts @@ -18,7 +18,7 @@ * ========================LICENSE_END=================================== */ import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; +import { HttpClient, HttpResponse } from '@angular/common/http'; import { Observable } from 'rxjs'; import { XMXappInfo, XMDeployableApp, XMDeployedApp } from '../../interfaces/app-mgr.types'; @@ -29,23 +29,33 @@ export class AppMgrService { // injects to variable httpClient } - private basePath = 'api/appmgr/xapps'; + private basePath = 'api/appmgr'; getDeployable(): Observable { - return this.httpClient.get(this.basePath + '/list'); + return this.httpClient.get(this.basePath + '/xapps/list'); } getDeployed(): Observable { - return this.httpClient.get(this.basePath); + return this.httpClient.get(this.basePath + '/xapps'); } - deployXapp(name: string) { - const xappInfo: XMXappInfo = { xAppName: name }; - return this.httpClient.post(this.basePath, xappInfo, { observe: 'response' }); + deployXapp(name: string): Observable> { + const xappInfo: XMXappInfo = { name: name }; + return this.httpClient.post((this.basePath + '/xapps'), xappInfo, { observe: 'response' }); } - undeployXapp(name: string) { - return this.httpClient.delete((this.basePath + '/' + name), { observe: 'response' }); + undeployXapp(name: string): Observable> { + return this.httpClient.delete((this.basePath + '/xapps'+ '/' + name), { observe: 'response' }); } + getConfig(): Observable{ + return this.httpClient.get("/assets/mockdata/config.json"); + //return this.httpClient.get((this.basePath + '/config')); + } + + putConfig(config: any): Observable> { + return this.httpClient.put((this.basePath + '/config' ), config, { observe: 'response' }); + } + + }