X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fxapp-mgr%2Fxapp-mgr.service.ts;fp=webapp-frontend%2Fsrc%2Fapp%2Fservices%2Fcatalog%2Fcatalog.service.ts;h=daef3e07c5f7090cb5864ce0c4a4992e7f299418;hb=3e69af1763ea2ce5f9485ab1cb5a39b089b109a7;hp=4946f24b38965ee0055e931eab222ab5d44d9e2c;hpb=a4c7cdd075d372de0ab352abc46359d88a570d90;p=portal%2Fric-dashboard.git diff --git a/webapp-frontend/src/app/services/catalog/catalog.service.ts b/webapp-frontend/src/app/services/xapp-mgr/xapp-mgr.service.ts similarity index 72% rename from webapp-frontend/src/app/services/catalog/catalog.service.ts rename to webapp-frontend/src/app/services/xapp-mgr/xapp-mgr.service.ts index 4946f24b..daef3e07 100644 --- a/webapp-frontend/src/app/services/catalog/catalog.service.ts +++ b/webapp-frontend/src/app/services/xapp-mgr/xapp-mgr.service.ts @@ -20,22 +20,29 @@ import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; -import { XMXappInfo } from '../../interfaces/xapp-mgr.types'; +import { XMXappInfo, XMXapp} from '../../interfaces/xapp-mgr.types'; + @Injectable() -export class CatalogService { +export class XappMgrService { constructor(private httpClient: HttpClient) { // injects to variable httpClient } - getAll() { - return this.httpClient.get('api/xappmgr/xapps'); + private basePath = 'api/xappmgr/xapps'; + + getAll(){ + return this.httpClient.get(this.basePath); } deployXapp(name: string) { const xappInfo: XMXappInfo = { xAppName: name }; - return this.httpClient.post('api/xappmgr/xapps', xappInfo, { observe: 'response' }); + return this.httpClient.post(this.basePath, xappInfo, { observe: 'response' }); + } + + undeployXapp(name: string) { + return this.httpClient.delete((this.basePath + '/' + name), { observe: 'response' }); } -} +} \ No newline at end of file