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';
28 export class E2ManagerService {
30 private basePath = 'api/e2mgr/';
32 constructor(private httpClient: HttpClient) {
33 // injects to variable httpClient
37 * Gets E2 manager client version details
38 * @returns Observable that should yield a DashboardSuccessTransport object
40 getE2ManagerVersion() {
41 return this.httpClient.get(this.basePath + 'version');
45 * Gets setup request history
46 * @returns Observable that should yield an array of objects
49 return this.httpClient.get(this.basePath + 'setup');
53 * Sends a request to setup an ENDC/gNodeB connection
56 endcSetup(req: E2SetupRequest) {
57 return this.httpClient.post(this.basePath + 'endcSetup', req);
61 * Sends a request to setup an X2/eNodeB connection
64 x2Setup(req: E2SetupRequest) {
65 return this.httpClient.post(this.basePath + 'x2Setup', req);
69 * Sends a request to drop all RAN connections
73 return this.httpClient.delete((this.basePath + 'nodeb'), { observe: 'response' });