Add AC and ANR services
[portal/ric-dashboard.git] / webapp-frontend / src / app / services / e2-mgr / e2-mgr.service.ts
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 AT&T Intellectual Property and Nokia
6  * %%
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ========================LICENSE_END===================================
19  */
20 import { Injectable } from '@angular/core';
21 import { HttpClient } from '@angular/common/http';
22 import { E2SetupRequest } from '../../interfaces/e2-mgr.types';
23
24 @Injectable()
25 export class E2ManagerService {
26
27   private basePath = 'api/e2mgr/';
28
29   constructor(private httpClient: HttpClient) {
30     // injects to variable httpClient
31   }
32
33   /**
34    * Gets E2 manager client version details
35    * @returns Observable that should yield a DashboardSuccessTransport object
36    */
37   getE2ManagerVersion() {
38     return this.httpClient.get(this.basePath + 'version');
39   }
40
41   /**
42    * Gets setup request history
43    * @returns Observable that should yield an array of objects
44    */
45   getAll() {
46     return this.httpClient.get(this.basePath + 'setup');
47   }
48
49   /**
50    * Sends a request to setup an ENDC/gNodeB connection
51    * @returns Observable
52    */
53   endcSetup(req: E2SetupRequest) {
54     return this.httpClient.post(this.basePath + 'endcSetup', req);
55   }
56
57   /**
58    * Sends a request to setup an X2/eNodeB connection
59    * @returns Observable
60    */
61   x2Setup(req: E2SetupRequest) {
62     return this.httpClient.post(this.basePath + 'x2Setup', req);
63   }
64
65 }