2 * ========================LICENSE_START=================================
5 * Copyright (C) 2019 AT&T Intellectual Property and Nokia
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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===================================
20 import { Injectable } from '@angular/core';
21 import { HttpClient } from '@angular/common/http';
22 import { E2SetupRequest } from '../../interfaces/e2-mgr.types';
25 export class E2ManagerService {
27 private basePath = 'api/e2mgr/';
29 constructor(private httpClient: HttpClient) {
30 // injects to variable httpClient
34 * Gets E2 manager client version details
35 * @returns Observable that should yield a DashboardSuccessTransport object
37 getE2ManagerVersion() {
38 return this.httpClient.get(this.basePath + 'version');
42 * Gets setup request history
43 * @returns Observable that should yield an array of objects
46 return this.httpClient.get(this.basePath + 'setup');
50 * Sends a request to setup an ENDC/gNodeB connection
53 endcSetup(req: E2SetupRequest) {
54 return this.httpClient.post(this.basePath + 'endcSetup', req);
58 * Sends a request to setup an X2/eNodeB connection
61 x2Setup(req: E2SetupRequest) {
62 return this.httpClient.post(this.basePath + 'x2Setup', req);
66 * Sends a request to drop all RAN connections
70 return this.httpClient.delete((this.basePath + 'nodeb'), { observe: 'response' });