Add AC and ANR services 70/170/6
authorLott, Christopher (cl778h) <cl778h@att.com>
Fri, 17 May 2019 09:46:29 +0000 (05:46 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Mon, 20 May 2019 14:47:45 +0000 (10:47 -0400)
Rename services to reflect the corresponding endpoints.
Clean many minor code issues identified by TS-Lint.

Change-Id: I4efb1142048d18706e10ff4af44cf524517ae0f9
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
42 files changed:
docs/release-notes.rst
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AcXappController.java
webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/AnrXappController.java
webapp-frontend/.gitignore
webapp-frontend/src/app/admin/admin.component.html
webapp-frontend/src/app/admin/admin.component.ts
webapp-frontend/src/app/anr-xapp/anr-xapp.component.html [new file with mode: 0644]
webapp-frontend/src/app/anr-xapp/anr-xapp.component.scss [new file with mode: 0644]
webapp-frontend/src/app/anr-xapp/anr-xapp.component.spec.ts [new file with mode: 0644]
webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts [new file with mode: 0644]
webapp-frontend/src/app/app-routing.module.ts
webapp-frontend/src/app/app.component.ts
webapp-frontend/src/app/app.module.ts
webapp-frontend/src/app/footer/footer.component.spec.ts
webapp-frontend/src/app/footer/footer.component.ts
webapp-frontend/src/app/interfaces/ac-xapp.types.ts
webapp-frontend/src/app/interfaces/anr-xapp.types.ts
webapp-frontend/src/app/interfaces/dashboard.types.ts
webapp-frontend/src/app/interfaces/e2-mgr.types.ts
webapp-frontend/src/app/interfaces/xapp-mgr.types.ts
webapp-frontend/src/app/navigation/sidenav-list/sidenav-list.component.ts
webapp-frontend/src/app/services/ac-xapp/ac-xapp.service.spec.ts [new file with mode: 0644]
webapp-frontend/src/app/services/ac-xapp/ac-xapp.service.ts [new file with mode: 0644]
webapp-frontend/src/app/services/admin/admin.service.spec.ts
webapp-frontend/src/app/services/anr-xapp/anr-xapp.service.spec.ts [new file with mode: 0644]
webapp-frontend/src/app/services/anr-xapp/anr-xapp.service.ts [new file with mode: 0644]
webapp-frontend/src/app/services/catalog/catalog.service.ts
webapp-frontend/src/app/services/control/control.service.ts
webapp-frontend/src/app/services/dashboard/dashboard.service.spec.ts [moved from webapp-frontend/src/app/services/version/version.service.spec.ts with 85% similarity]
webapp-frontend/src/app/services/dashboard/dashboard.service.ts [moved from webapp-frontend/src/app/services/signal/signal.service.ts with 63% similarity]
webapp-frontend/src/app/services/e2-mgr/e2-mgr.service.spec.ts [moved from webapp-frontend/src/app/services/signal/signal.service.spec.ts with 88% similarity]
webapp-frontend/src/app/services/e2-mgr/e2-mgr.service.ts [new file with mode: 0644]
webapp-frontend/src/app/services/stats/stats.service.ts
webapp-frontend/src/app/services/ui/confirm-dialog.service.ts
webapp-frontend/src/app/services/ui/notification.service.spec.ts
webapp-frontend/src/app/services/ui/notification.service.ts
webapp-frontend/src/app/services/ui/ui.service.spec.ts
webapp-frontend/src/app/services/ui/ui.service.ts
webapp-frontend/src/app/services/version/version.service.ts [deleted file]
webapp-frontend/src/app/signal/signal.component.ranconnect-dialog.html
webapp-frontend/src/app/signal/signal.component.ts
webapp-frontend/src/app/xapp/xapp.component.ts

index fa2b460..30e4da9 100644 (file)
@@ -27,6 +27,8 @@ Version 1.0.3, 20 May 2019
 * Update ANR xApp client to spec version 0.0.5
 * Add get-version methods to all controllers
 * Add simple page footer with copyright and version
+* Add AC and ANR xApp services
+* Rename signal service to E2 Manager service
 
 Version 1.0.2, 13 May 2019
 --------------------------
index 859efb8..87a783c 100644 (file)
@@ -32,7 +32,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.util.Assert;
-import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -44,8 +43,8 @@ import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 
 /**
- * Provides methods to manage policies of the Admission Control xApp. All
- * messages go via the A1 Mediatior.
+ * Provides methods to manage policies of the Admission Control xApp, which
+ * initially defines just one. All requests go via the A1 Mediatior.
  */
 @RestController
 @RequestMapping(value = DashboardConstants.ENDPOINT_PREFIX + "/xapp/ac", produces = MediaType.APPLICATION_JSON_VALUE)
@@ -53,7 +52,7 @@ public class AcXappController {
 
        private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-       private static final String POLICY_NAME = "policyname";
+       private static final String POLICY_CONTROL_ADMISSION_TIME = "control_admission_time";
 
        // Populated by the autowired constructor
        private final A1MediatorApi a1MediatorApi;
@@ -71,21 +70,29 @@ public class AcXappController {
                return new SuccessTransport(200, DashboardApplication.getImplementationVersion(A1MediatorApi.class));
        }
 
-       @ApiOperation(value = "Gets the named policy for AC xApp via the A1 Mediator")
-       @RequestMapping(value = "policy/{" + POLICY_NAME + "}", method = RequestMethod.GET)
-       public Object getPolicy(@PathVariable(POLICY_NAME) String policyName) {
-               logger.debug("getPolicy: policy {}", policyName);
-               a1MediatorApi.a1ControllerGetHandler(policyName);
-               return null;
-       }
+       /*
+        * GET policy is not supported at present by A1 Mediator. Keeping this hidden
+        * until that changes.
+        *
+        * @ApiOperation(value =
+        * "Gets the named policy for AC xApp via the A1 Mediator")
+        * 
+        * @RequestMapping(value = "policy/{" + POLICY_NAME + "}", method =
+        * RequestMethod.GET) public Object getPolicy(@PathVariable(POLICY_NAME) String
+        * policyName) { logger.debug("getPolicy: policy {}", policyName);
+        * a1MediatorApi.a1ControllerGetHandler(policyName); return null; }
+        */
 
-       @ApiOperation(value = "Sets the named policy for AC xApp via the A1 Mediator")
-       @RequestMapping(value = "policy/{" + POLICY_NAME + "}", method = RequestMethod.PUT)
-       public void putPolicy(@PathVariable(POLICY_NAME) String policyName, //
-                       @ApiParam(value = "JSON formatted policy") @RequestBody JsonNode policy, //
+       /*
+        * This controller is deliberately kept ignorant of the
+        * ACAdmissionIntervalControl data structure.
+        */
+       @ApiOperation(value = "Sets the control admission time for AC xApp via the A1 Mediator")
+       @RequestMapping(value = "catime", method = RequestMethod.PUT)
+       public void setControlAdmissionTime(@ApiParam(value = "Control admission time") @RequestBody JsonNode caTime, //
                        HttpServletResponse response) {
-               logger.debug("putPolicy: policy {}", policyName);
-               a1MediatorApi.a1ControllerPutHandler(policyName, policy);
+               logger.debug("setControlAdmissionTime {}", caTime);
+               a1MediatorApi.a1ControllerPutHandler(POLICY_CONTROL_ADMISSION_TIME, caTime);
                response.setStatus(a1MediatorApi.getApiClient().getStatusCode().value());
        }
 
index 6c0ca4b..aa7b443 100644 (file)
@@ -101,7 +101,7 @@ public class AnrXappController {
 
        @ApiOperation(value = "Query NCRT of all cells, all or one gNB(s)", response = NeighborCellRelationTable.class)
        @RequestMapping(value = "/cell", method = RequestMethod.GET)
-       public NeighborCellRelationTable queryNcrtAllCells( //
+       public NeighborCellRelationTable getNcrtInfo( //
                        @RequestParam(name = GGNBID, required = false) String ggnbId, //
                        @RequestParam(name = START_INDEX, required = false) String startIndex, //
                        @RequestParam(name = LIMIT, required = false) Integer limit) {
@@ -111,7 +111,7 @@ public class AnrXappController {
 
        @ApiOperation(value = "Query NCRT of a single serving cell", response = NeighborCellRelationTable.class)
        @RequestMapping(value = "/cell/" + CELL_ID + "/{" + CELL_ID + "}", method = RequestMethod.GET)
-       public NeighborCellRelationTable queryNcrtServingCell(@PathVariable(CELL_ID) String cellIdentifier, //
+       public NeighborCellRelationTable getCellNcrtInfo(@PathVariable(CELL_ID) String cellIdentifier, //
                        @RequestParam(name = START_INDEX, required = false) String startIndex, //
                        @RequestParam(name = LIMIT, required = false) Integer limit,
                        @RequestParam(name = NRPCI, required = false) String nrpci,
@@ -131,13 +131,17 @@ public class AnrXappController {
                response.setStatus(healthApi.getApiClient().getStatusCode().value());
        }
 
+       /*
+        * TODO: DELETE should not have a body - the path should identify the resource to be deleted.
+        */
        @ApiOperation(value = "Delete neighbor cell relation based on Source Cell NR CGI and Target Cell NR PCI / NR CGI")
        @RequestMapping(value = "/cell/" + CELL_ID + "/{" + CELL_ID + "}", method = RequestMethod.DELETE)
-       public void modifyNcrt(@PathVariable(CELL_ID) String cellIdentifier, //
+       public void deleteNcrt(@PathVariable(CELL_ID) String cellIdentifier, //
                        @RequestBody NeighborCellRelationDelTable ncrtDelTable, //
                        HttpServletResponse response) {
                logger.debug("modifyNcrt: cellIdentifier {} delTable {}", cellIdentifier, ncrtDelTable);
                ncrtApi.deleteNcrt(cellIdentifier, ncrtDelTable);
                response.setStatus(healthApi.getApiClient().getStatusCode().value());
        }
+
 }
index 4cfece3..588ac10 100644 (file)
@@ -15,7 +15,7 @@
 /.settings
 /target/
 /.mvn/wrapper/maven-wrapper.jar
-/.vscode
+**/.vscode
 
 ### STS ###
 .apt_generated
index aba337c..1cc9173 100644 (file)
@@ -16,7 +16,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
   ========================LICENSE_END===================================
-  -->
+-->
 <div class="admin__section">
     <h3 class="admin__header">Users</h3>
     <ng2-smart-table [settings]="usersettings" [source]="usersource" (deleteConfirm)="onDeleteUserConfirm($event)">
index 6669079..33ce1e7 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.html b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.html
new file mode 100644 (file)
index 0000000..0684ac7
--- /dev/null
@@ -0,0 +1,26 @@
+<!--
+  ========================LICENSE_START=================================
+  O-RAN-SC
+  %%
+  Copyright (C) 2019 AT&T Intellectual Property and Nokia
+  %%
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ========================LICENSE_END===================================
+-->
+<div class="anr__section">
+  <h3 class="anr__header">ANR xApp</h3>
+  <ng2-smart-table [settings]="settings" [source]="source" (custom)="onAnrControlAction($event)">
+  </ng2-smart-table>
+  <app-modal-event hidden></app-modal-event>
+</div>
+
diff --git a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.scss b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.scss
new file mode 100644 (file)
index 0000000..183d90d
--- /dev/null
@@ -0,0 +1,40 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+ .anr__section {
+    position: relative;
+    top: -150px;
+}
+
+.anr__header {
+    text-align: center;
+    color: #432c85;
+    font-size: 50px;
+    font-weight: 200;
+    letter-spacing: .1em;
+    transform: translate(149 56);
+}
+
+:host /deep/ ng2-smart-table tbody > tr > td{
+  text-align: left;
+}
+
+:host /deep/ ng2-smart-table thead th{
+  text-align: left;
+}
diff --git a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.spec.ts b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.spec.ts
new file mode 100644 (file)
index 0000000..681aa20
--- /dev/null
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { AnrXappComponent } from './anr-xapp.component';
+
+describe('AnrXappComponent', () => {
+  let component: AnrXappComponent;
+  let fixture: ComponentFixture<AnrXappComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ AnrXappComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(AnrXappComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});
diff --git a/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts b/webapp-frontend/src/app/anr-xapp/anr-xapp.component.ts
new file mode 100644 (file)
index 0000000..63b4e31
--- /dev/null
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-anr-xapp',
+  templateUrl: './anr-xapp.component.html',
+  styleUrls: ['./anr-xapp.component.scss']
+})
+export class AnrXappComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}
index 3620c0e..edfe38f 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 796d6b3..15c8832 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index fabd258..e9dc34d 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 import { BrowserModule } from '@angular/platform-browser';
 // tslint:disable-next-line:max-line-length
 import { MatIconModule, MatCardModule, MatListModule, MatSidenavModule,
-    MatButtonToggleModule, MatSliderModule, MatGridListModule, MatSlideToggleModule, 
-    MatExpansionModule, MatTabsModule, MatDialogModule, MatFormFieldModule, 
+    MatButtonToggleModule, MatSliderModule, MatGridListModule, MatSlideToggleModule,
+    MatExpansionModule, MatTabsModule, MatDialogModule, MatFormFieldModule,
     MatButtonModule, MatInputModule, MatSnackBarModule} from '@angular/material';
 import { BrowserAnimationsModule} from '@angular/platform-browser/animations';
 import { NgModule } from '@angular/core';
 import { Ng2SmartTableModule } from 'ng2-smart-table';
-import { MatRadioModule } from '@angular/material/radio'; 
+import { MatRadioModule } from '@angular/material/radio';
 import { ChartsModule } from 'ng2-charts';
 import { MDBBootstrapModule } from 'angular-bootstrap-md';
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -39,10 +39,11 @@ import { UiService } from './services/ui/ui.service';
 import { AdminService } from './services/admin/admin.service';
 import { CatalogService } from './services/catalog/catalog.service';
 import { ControlService } from './services/control/control.service';
-import { SignalService } from './services/signal/signal.service';
+import { DashboardService } from './services/dashboard/dashboard.service';
+import { E2ManagerService } from './services/e2-mgr/e2-mgr.service';
 import { SidenavListComponent } from './navigation/sidenav-list/sidenav-list.component';
 import { ControlComponent } from './control/control.component';
-import { SignalComponent, AppRANConnectDialog } from './signal/signal.component';
+import { SignalComponent, RANConnectDialogComponent } from './signal/signal.component';
 import { StatsComponent } from './stats/stats.component';
 import { AdminComponent } from './admin/admin.component';
 import { CatalogCardComponent } from './ui/catalog-card/catalog-card.component';
@@ -53,6 +54,7 @@ import { XappComponent } from './xapp/xapp.component';
 import { ConfigEventComponent } from './ui/config-event/config-event.component';
 import { ConfirmDialogComponent } from './ui/confirm-dialog/confirm-dialog.component';
 import { FooterComponent } from './footer/footer.component';
+import { AnrXappComponent } from './anr-xapp/anr-xapp.component';
 
 
 @NgModule({
@@ -71,9 +73,10 @@ import { FooterComponent } from './footer/footer.component';
     ModalEventComponent,
     XappComponent,
     ConfigEventComponent,
-    AppRANConnectDialog,
+    RANConnectDialogComponent,
     ConfirmDialogComponent,
     FooterComponent,
+    AnrXappComponent,
   ],
     imports: [
     BrowserModule,
@@ -119,17 +122,18 @@ import { FooterComponent } from './footer/footer.component';
     MatInputModule
     ],
     entryComponents: [
-    AppRANConnectDialog,
     ConfirmDialogComponent,
+    RANConnectDialogComponent
     ],
   providers: [
       UiService,
       AdminService,
       CatalogService,
       ControlService,
-      SignalService
+      DashboardService,
+      E2ManagerService
     ],
   bootstrap: [AppComponent]
 })
-export class AppModule { };
+export class AppModule { }
 
index 7f64be6..2658fc8 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index f01b6b0..1dbd4b6 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
-import { Component, OnInit } from '@angular/core'
-import { Observable } from 'rxjs/Rx'
-import { VersionService } from '../services/version/version.service'
-import { DashboardSuccessTransport } from '../interfaces/dashboard.types'
+import { Component, OnInit } from '@angular/core';
+import { DashboardService } from '../services/dashboard/dashboard.service';
+import { DashboardSuccessTransport } from '../interfaces/dashboard.types';
 
 @Component({
   selector: 'app-footer',
@@ -33,13 +32,13 @@ import { DashboardSuccessTransport } from '../interfaces/dashboard.types'
  */
 export class FooterComponent implements OnInit {
 
-  public dashboardVersion : string
+  dashboardVersion: string;
+
   // Inject the service
-  constructor(public versionService: VersionService) { }
+  constructor(private dashboardService: DashboardService) { }
 
   ngOnInit() {
-    this.versionService.getDashboardVersion().subscribe((res : DashboardSuccessTransport) => this.dashboardVersion = res.data)
+    this.dashboardService.getVersion().subscribe((res: DashboardSuccessTransport) => this.dashboardVersion = res.data);
   }
 
 }
index 5c3cf3f..4aa833b 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 0e07ceb..f0a5a43 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 6bb7534..01a9d72 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 1790bf9..70256d2 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 1fa4c33..999ddb3 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index d94b39b..6ebd79b 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/webapp-frontend/src/app/services/ac-xapp/ac-xapp.service.spec.ts b/webapp-frontend/src/app/services/ac-xapp/ac-xapp.service.spec.ts
new file mode 100644 (file)
index 0000000..4b04374
--- /dev/null
@@ -0,0 +1,12 @@
+import { TestBed } from '@angular/core/testing';
+
+import { AcXappService } from './ac-xapp.service';
+
+describe('AcXappService', () => {
+  beforeEach(() => TestBed.configureTestingModule({}));
+
+  it('should be created', () => {
+    const service: AcXappService = TestBed.get(AcXappService);
+    expect(service).toBeTruthy();
+  });
+});
diff --git a/webapp-frontend/src/app/services/ac-xapp/ac-xapp.service.ts b/webapp-frontend/src/app/services/ac-xapp/ac-xapp.service.ts
new file mode 100644 (file)
index 0000000..740fcbc
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+
+ import { Injectable } from '@angular/core';
+ import { HttpClient } from '@angular/common/http';
+ import { Observable } from 'rxjs';
+import { ACAdmissionIntervalControl, ACAdmissionIntervalControlAck } from '../../interfaces/ac-xapp.types';
+import { DashboardSuccessTransport } from '../../interfaces/dashboard.types';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class AcXappService {
+
+  private basePath = 'api/xapp/ac/';
+
+  constructor(private httpClient: HttpClient) {
+    // injects to variable httpClient
+  }
+
+  /**
+   * Gets A1 Mediator client version details
+   * @returns Observable that should yield a SuccessTransport object
+   */
+  getVersion() {
+    // Remember that AC traffic goes via A1!
+    return this.httpClient.get<DashboardSuccessTransport>(this.basePath + 'version');
+  }
+
+  /**
+   * Puts control admission time parameters to AC via A1
+   * @param policy an instance of ACAdmissionIntervalControl
+   * @returns Observable that should yield an ACAdmissionIntervalControlAck
+   */
+  putCaTime(policy: ACAdmissionIntervalControl): Observable<ACAdmissionIntervalControlAck> {
+    return this.httpClient.put<ACAdmissionIntervalControlAck>(this.basePath + 'catime', policy);
+  }
+
+}
index 2d3de0f..acc9f43 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,6 +17,7 @@
  * limitations under the License.
  * ========================LICENSE_END===================================
  */
+
 import { TestBed } from '@angular/core/testing';
 
 import { AdminService } from './admin.service';
diff --git a/webapp-frontend/src/app/services/anr-xapp/anr-xapp.service.spec.ts b/webapp-frontend/src/app/services/anr-xapp/anr-xapp.service.spec.ts
new file mode 100644 (file)
index 0000000..a36dd8b
--- /dev/null
@@ -0,0 +1,32 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+
+ import { TestBed } from '@angular/core/testing';
+
+import { AnrXappService } from './anr-xapp.service';
+
+describe('AnrXappService', () => {
+  beforeEach(() => TestBed.configureTestingModule({}));
+
+  it('should be created', () => {
+    const service: AnrXappService = TestBed.get(AnrXappService);
+    expect(service).toBeTruthy();
+  });
+});
diff --git a/webapp-frontend/src/app/services/anr-xapp/anr-xapp.service.ts b/webapp-frontend/src/app/services/anr-xapp/anr-xapp.service.ts
new file mode 100644 (file)
index 0000000..f9403f1
--- /dev/null
@@ -0,0 +1,118 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+
+import { Injectable } from '@angular/core';
+import { HttpClient, HttpParams } from '@angular/common/http';
+import { Observable } from 'rxjs';
+import { DashboardSuccessTransport } from '../../interfaces/dashboard.types';
+import { ANRNeighborCellRelation, ANRNeighborCellRelationMod } from '../../interfaces/anr-xapp.types';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class AnrXappService {
+
+  private basePath = 'api/xapp/anr/';
+  private cellPath = 'cell/cellIdentifier/';
+
+  constructor(private httpClient: HttpClient) {
+    // injects to variable httpClient
+  }
+
+  /**
+   * Gets ANR xApp client version details
+   * @returns Observable that should yield a DashboardSuccessTransport
+   */
+  getVersion(): Observable<DashboardSuccessTransport> {
+    return this.httpClient.get<DashboardSuccessTransport>(this.basePath + 'version');
+  }
+
+  /**
+   * Performs a liveness probe
+   * @returns Observable that should yield a response code (no data)
+   */
+  getHealthAlive(): Observable<any> {
+    return this.httpClient.get(this.basePath + 'health/alive');
+  }
+
+  /**
+   * Performs a readiness probe
+   * @returns Observable that should yield a response code (no data)
+   */
+  getHealthReady(): Observable<any> {
+    return this.httpClient.get(this.basePath + 'health/ready');
+  }
+
+  /**
+   * Query NCRT of all cells, all or one gNB(s)
+   * @param ggnbId Optional parameter for the gNB ID
+   * @param startIndex Optional parameter for the start index
+   * @param limit Optional parameter for the limit (page size)
+   * @returns Observable of ANRNeighborCellRelation
+   */
+  getNcrtInfo(ggnbId?: string, startIndex?: string, limit?: number): Observable<ANRNeighborCellRelation[]> {
+    const queryParams = new HttpParams();
+    if (ggnbId) {
+      queryParams.set('ggnbid', ggnbId);
+    }
+    if (startIndex) {
+      queryParams.set('startIndex', startIndex);
+    }
+    if (limit) {
+      queryParams.set('limit', limit.toString());
+    }
+    return this.httpClient.get<ANRNeighborCellRelation[]>(this.basePath + 'cell', { params: queryParams } );
+  }
+
+  /**
+   * Query NCRT of a single serving cell, all or one gNB(s)
+   * @param cellId cell ID
+   * @param ggnbid Optional parameter for the gNB ID
+   * @param startIndex Optional parameter for the start index
+   * @param limit Optional parameter for the limit (page size)
+   * @returns Observable of ANRNeighborCellRelation
+   */
+  getCellNcrtInfo(cellId: string, ggnbId?: string, startIndex?: string, limit?: number): Observable<ANRNeighborCellRelation[]> {
+    const queryParams = new HttpParams();
+    if (ggnbId) {
+      queryParams.set('ggnbid', ggnbId);
+    }
+    if (startIndex) {
+      queryParams.set('startIndex', startIndex);
+    }
+    if (limit) {
+      queryParams.set('limit', limit.toString());
+    }
+    return this.httpClient.get<ANRNeighborCellRelation[]>(this.basePath + this.cellPath + cellId, { params: queryParams } );
+  }
+
+  /**
+   * Modify neighbor cell relations based on Source Cell NR CGI and Target Cell NR PCI / NR CGI
+   * @param cellId cell ID
+   * @param table Array of ANRNeighborCellRelationMod
+   * @returns Observable that should yield a response code (no data)
+   */
+  modifyNcrt(cellId: string, table: ANRNeighborCellRelationMod []): Observable<any> {
+    return this.httpClient.put(this.basePath + this.cellPath + cellId, table);
+  }
+
+  /** TODO: deleteNcrt */
+
+}
index 586df92..4946f24 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -33,10 +33,8 @@ export class CatalogService {
     return this.httpClient.get('api/xappmgr/xapps');
   }
 
-  deployXapp(name) {
-    let xappInfo: XMXappInfo = {
-      xAppName: name
-    };
+  deployXapp(name: string) {
+    const xappInfo: XMXappInfo = { xAppName: name };
     return this.httpClient.post('api/xappmgr/xapps', xappInfo, { observe: 'response' });
   }
 
index 41819c4..24b4024 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,28 +26,27 @@ export class ControlService {
     constructor(private http: HttpClient) {
     }
 
-    getxAppInstances(xAppInstances) {  
+    getxAppInstances(xAppInstances) {
     return this.http.get('api/xappmgr/xapps').subscribe(
         (val: any[]) => {
             xAppInstances(this.fetchInstance(val));
-            } 
+            }
         );
-        
     }
 
     undeployxApp(xapp) {
-        return this.http.delete(('api/xappmgr/xapps/' + xapp),{ observe: 'response' })
+        return this.http.delete(('api/xappmgr/xapps/' + xapp), { observe: 'response' });
     }
 
     fetchInstance(allxappdata) {
-        var xAppInstances = []
-        for (const  xappindex in allxappdata) {
-            var instancelist = allxappdata[xappindex].instances;
+        const xAppInstances = [];
+        for (const xappindex in allxappdata) {
+            const instancelist = allxappdata[xappindex].instances;
             for (const instanceindex in instancelist) {
-                var instance = instancelist[instanceindex];
+                const instance = instancelist[instanceindex];
                 instance.xapp = allxappdata[xappindex].name;
                 xAppInstances.push(instance);
-            }          
+            }
         }
         return xAppInstances;
     }
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  */
 import { TestBed } from '@angular/core/testing';
 
-import { VersionService } from './version.service';
+import { DashboardService } from './dashboard.service';
 
-describe('VersionService', () => {
+describe('DashboardService', () => {
   beforeEach(() => TestBed.configureTestingModule({}));
 
   it('should be created', () => {
-    const service: VersionService = TestBed.get(VersionService);
+    const service: DashboardService = TestBed.get(DashboardService);
     expect(service).toBeTruthy();
   });
 });
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 import { Injectable } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
 
-@Injectable()
-export class SignalService {
-  
+@Injectable({
+  providedIn: 'root'
+})
+
+/**
+ * Services to query the dashboard's healthcheck controller.
+ */
+export class DashboardService {
+
+  private basePath = 'api/dashboard/';
+
   constructor(private httpClient: HttpClient) {
     // injects to variable httpClient
   }
 
-  getAll() {
-    return this.httpClient.get('api/e2mgr/setup');
-  }
-
-  x2Setup(req) {
-    return this.httpClient.post('api/e2mgr/x2Setup', req);
+ /**
+   * Checks app health
+   * @returns Observable that should yield a DashboardSuccessTransport
+   */
+  getHealth() {
+    return this.httpClient.get(this.basePath + 'health');
   }
 
-  endcSetup(req) {
-    return this.httpClient.post('api/e2mgr/endcSetup', req);
+  /**
+   * Gets Dashboard version details
+   * @returns Observable that should yield a DashboardSuccessTransport object
+   */
+  getVersion() {
+    return this.httpClient.get(this.basePath + 'version');
   }
 
 }
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  */
 import { TestBed } from '@angular/core/testing';
 
-import { SignalService } from './signal.service';
+import { E2ManagerService } from './e2-mgr.service';
 
 describe('CatalogService', () => {
   beforeEach(() => TestBed.configureTestingModule({}));
 
   it('should be created', () => {
-    const service: SignalService = TestBed.get(SignalService);
+    const service: E2ManagerService
+   = TestBed.get(E2ManagerService
+    );
     expect(service).toBeTruthy();
   });
 });
diff --git a/webapp-frontend/src/app/services/e2-mgr/e2-mgr.service.ts b/webapp-frontend/src/app/services/e2-mgr/e2-mgr.service.ts
new file mode 100644 (file)
index 0000000..1c1a534
--- /dev/null
@@ -0,0 +1,65 @@
+/*-
+ * ========================LICENSE_START=================================
+ * O-RAN-SC
+ * %%
+ * Copyright (C) 2019 AT&T Intellectual Property and Nokia
+ * %%
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================LICENSE_END===================================
+ */
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { E2SetupRequest } from '../../interfaces/e2-mgr.types';
+
+@Injectable()
+export class E2ManagerService {
+
+  private basePath = 'api/e2mgr/';
+
+  constructor(private httpClient: HttpClient) {
+    // injects to variable httpClient
+  }
+
+  /**
+   * Gets E2 manager client version details
+   * @returns Observable that should yield a DashboardSuccessTransport object
+   */
+  getE2ManagerVersion() {
+    return this.httpClient.get(this.basePath + 'version');
+  }
+
+  /**
+   * Gets setup request history
+   * @returns Observable that should yield an array of objects
+   */
+  getAll() {
+    return this.httpClient.get(this.basePath + 'setup');
+  }
+
+  /**
+   * Sends a request to setup an ENDC/gNodeB connection
+   * @returns Observable
+   */
+  endcSetup(req: E2SetupRequest) {
+    return this.httpClient.post(this.basePath + 'endcSetup', req);
+  }
+
+  /**
+   * Sends a request to setup an X2/eNodeB connection
+   * @returns Observable
+   */
+  x2Setup(req: E2SetupRequest) {
+    return this.httpClient.post(this.basePath + 'x2Setup', req);
+  }
+
+}
index 1dcce6f..255dbca 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,9 +19,9 @@
  */
 import { Injectable } from '@angular/core';
 import { HttpClient } from '@angular/common/http';
-import { HttpHeaders } from "@angular/common/http";
-import { Observable } from "rxjs";
-import { HttpErrorResponse } from "@angular/common/http";
+import { HttpHeaders } from '@angular/common/http';
+import { Observable } from 'rxjs';
+import { HttpErrorResponse } from '@angular/common/http';
 
 @Injectable({
     providedIn: 'root'
@@ -49,11 +49,10 @@ export class StatsService {
               'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept, Authorization'
             })
           };
-    
-    constructor(private httpClient: HttpClient) { 
-        //this.loadConfig();
-        //this.getLoad();
-        
+
+    constructor(private httpClient: HttpClient) {
+        // this.loadConfig();
+        // this.getLoad();
     }
 
     getMetrics() {
@@ -67,7 +66,7 @@ export class StatsService {
     }
 
     getLoad(): Observable<number> {
-        //this.loadMetrics = this.getRandomValue();
+        // this.loadMetrics = this.getRandomValue();
         this.httpClient.get(this.hostURL + this.loadPath).subscribe((res) => {
             console.log(res);
             console.log('stats.service.getLoad(): ' + res['load']);
@@ -76,9 +75,9 @@ export class StatsService {
         });
         return this.load;
     }
-    
+
     putLoad(value: number) {
-        //this.loadMetrics = this.getRandomValue();
+        // this.loadMetrics = this.getRandomValue();
         const jsonValue = '{ "load": ' + value + ' }';
         console.log(jsonValue);
         this.httpClient.put(this.hostURL + this.loadPath, jsonValue , this.httpOptions).subscribe((res) => {
@@ -87,14 +86,14 @@ export class StatsService {
     }
 
     putDelay(value: number) {
-        //this.loadMetrics = this.getRandomValue();
+        // this.loadMetrics = this.getRandomValue();
         const jsonValue = '{ "delay": ' + value + ' }';
         console.log(jsonValue);
         this.httpClient.put(this.hostURL + this.delayPath, jsonValue , this.httpOptions).subscribe((res) => {
             console.log(res);
         });
     }
-    
+
     getCpuMetrics() {
         this.cpuMetrics = this.getRandomValue();
         return this.cpuMetrics;
@@ -103,23 +102,23 @@ export class StatsService {
     getRandomValue() {
         return Math.round((Math.random() * (20 - 0)) + 0);
     }
-    
+
     saveConfig(key: string, value: string) {
-        if(key == 'jsonURL')
+        if (key === 'jsonURL') {
             this.baseJSONServerUrl = value;
+        }
+        console.log('save this.baseJSONServerUrl ' + this.baseJSONServerUrl);
+        const jsonValue = '{"id": "' + key + '", "value": "' + value + '"}';
+        console.log(jsonValue);
+        this.httpClient.put(this.baseJSONServerUrl + '/config/' + key , jsonValue, this.httpOptions).subscribe((res) => {
+            console.log(res);
+        });
 
-            console.log('save this.baseJSONServerUrl '+this.baseJSONServerUrl);
-            const jsonValue = '{"id": "' + key + '", "value": "' + value + '"}';
-            console.log(jsonValue);
-            this.httpClient.put(this.baseJSONServerUrl + '/config/' + key , jsonValue, this.httpOptions).subscribe((res) => {
-                console.log(res);
-            });
 
-        
     }
-    
+
     loadConfig() {
-        console.log('load this.baseJSONServerUrl '+this.baseJSONServerUrl);
+        console.log('load this.baseJSONServerUrl ' + this.baseJSONServerUrl);
         const httpOptions = {
                 headers: new HttpHeaders({
                   'Content-Type':  'application/json'
index 0eccc63..2c38c31 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,7 +20,7 @@
 
 import { Injectable } from '@angular/core';
 import { MatDialog } from '@angular/material';
-import { ConfirmDialogComponent } from './../../ui/confirm-dialog/confirm-dialog.component'
+import { ConfirmDialogComponent } from './../../ui/confirm-dialog/confirm-dialog.component';
 
 @Injectable({
   providedIn: 'root'
@@ -32,7 +32,7 @@ export class ConfirmDialogService {
   openConfirmDialog(msg) {
     return this.dialog.open(ConfirmDialogComponent, {
       width: '480px',
-      position: { top: "100px" },
+      position: { top: '100px' },
       data: {
         message: msg
       }
index 0c2c2fb..3760229 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index 36d8742..30f8021 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,20 +32,20 @@ export class NotificationService {
     duration: 3000,
     horizontalPosition: 'right',
     verticalPosition: 'top'
-  }
+  };
 
 
-  success(msg) {
+  success(msg: string) {
     this.config['panelClass'] = ['notification', 'success', 'default'];
     this.snackBar.open(msg, '', this.config);
   }
 
-  warn(msg) {
+  warn(msg: string) {
     this.config['panelClass'] = ['notification', 'warn', 'default'];
     this.snackBar.open(msg, '', this.config);
   }
 
-  error(msg) {
+  error(msg: string) {
     this.config['panelClass'] = ['notification', 'error', 'default'];
     this.snackBar.open(msg, '', this.config);
   }
index 8547e77..ab082af 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
index a496c70..617cff9 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/webapp-frontend/src/app/services/version/version.service.ts b/webapp-frontend/src/app/services/version/version.service.ts
deleted file mode 100644 (file)
index 2a3ec5e..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ========================LICENSE_START=================================
- * O-RAN-SC
- * %%
- * Copyright (C) 2019 AT&T Intellectual Property and Nokia
- * %%
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================LICENSE_END===================================
- */
-import { Injectable } from '@angular/core'
-import { HttpClient } from '@angular/common/http'
-
-@Injectable({
-  providedIn: 'root'
-})
-export class VersionService {
-
-  constructor(private httpClient : HttpClient) {
-    // injects to variable httpClient
-  }
-
-  /**
-   * Gets an Observable with version details
-   * @returns {Observable<SuccessTransport>} with Dashboard version
-   */
-  getDashboardVersion() {
-    return this.httpClient.get('api/dashboard/version')
-  }
-
-  /**
-   * Gets an Observable with version details
-   * @returns {Observable<SuccessTransport>} with A1 Mediator version
-   */
-  getA1MediatorVersion() {
-    // Remember that AC traffic goes via A1
-    return this.httpClient.get('api/xapp/ac/version')
-  }
-
-  /**
-   * Gets an Observable with version details
-   * @returns {Observable<SuccessTransport>} with ANR xApp version
-   */
-  getAnrXappVersion() {
-    return this.httpClient.get('api/xapp/anr/version')
-  }
-
-  /**
-   * Gets an Observable with version details
-   * @returns {Observable<SuccessTransport>} with E2 Manager version
-   */
-  getE2ManagerVersion() {
-    return this.httpClient.get('api/e2mgr/version')
-  }
-
-  /**
-   * Gets an Observable with version details
-   * @returns {Observable<SuccessTransport>} with XApp Manager version
-   */
-  getXappManagerVersion(){
-    return this.httpClient.get('api/xappmgr/version')
-  }
-
-}
index c0b0d86..a8e17ce 100644 (file)
@@ -25,8 +25,8 @@
 <form [formGroup]="ranDialogForm" novalidate autocomplete="off" (ngSubmit)="setupConnection(ranDialogForm.value)">
   <div mat-dialog-content>
     <div name="rantype">
-      <label id="request-type-radio-group-label">Select the RAN type</label>
-      <mat-radio-group aria-label="Select the RAN type" formControlName="ranType">
+      <label id="request-type-radio-group-label">Select the RAN type:</label>
+      <mat-radio-group aria-label="RAN type" formControlName="ranType">
         <mat-radio-button value="endc">EN-DC</mat-radio-button>
         <mat-radio-button value="x2">X2</mat-radio-button>
       </mat-radio-group>
index 5a9b925..77593ec 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,13 +22,76 @@ import { LocalDataSource } from 'ng2-smart-table';
 import { Router } from '@angular/router';
 import { MatDialog, MatDialogConfig, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
 import { MatFormFieldModule } from '@angular/material';
-import { MatRadioModule } from '@angular/material/radio'; 
+import { MatRadioModule } from '@angular/material/radio';
 import { FormGroup, FormControl, FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
 import { HttpClient } from '@angular/common/http';
-import { Observable } from 'rxjs/Rx';
-import { SignalService } from '../services/signal/signal.service';
+import { E2ManagerService } from '../services/e2-mgr/e2-mgr.service';
 import { E2SetupRequest } from '../interfaces/e2-mgr.types';
 
+@Component({
+  selector: 'app-signal-ranconnect-dialog',
+  templateUrl: 'signal.component.ranconnect-dialog.html',
+  styleUrls: ['signal.component.css']
+})
+
+export class RANConnectDialogComponent implements OnInit {
+
+  public ranDialogForm: FormGroup;
+
+  constructor(
+      public dialogRef: MatDialogRef<RANConnectDialogComponent>,
+      private service: E2ManagerService
+    ,
+      @Inject(MAT_DIALOG_DATA) public data: E2SetupRequest) {  }
+
+  ngOnInit() {
+    const namePattern = /^([A-Z]){4}([0-9]){6}$/;
+    const ipPattern = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/;
+    const portPattern = /^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/;
+    this.ranDialogForm = new FormGroup({
+      ranType: new FormControl('endc'),
+      ranName: new FormControl('', [Validators.required, Validators.pattern(namePattern)]),
+      ranIp: new FormControl('', [Validators.required, Validators.pattern(ipPattern)]),
+      ranPort: new FormControl('', [Validators.required, Validators.pattern(portPattern)])
+    });
+  }
+
+  onCancel() {
+    this.dialogRef.close();
+  }
+
+  public setupConnection = (ranFormValue) => {
+    if (this.ranDialogForm.valid) {
+      this.executeSetupConnection(ranFormValue);
+    }
+  }
+
+  private executeSetupConnection = (ranFormValue) => {
+    const setupRequest: E2SetupRequest = {
+      ranName: ranFormValue.ranName,
+      ranIp:   ranFormValue.ranIp,
+      ranPort: ranFormValue.ranPort
+    };
+    if (ranFormValue.ranType === 'endc') {
+      this.service.endcSetup(setupRequest).subscribe((val: any[]) => {});
+    } else {
+      this.service.x2Setup(setupRequest).subscribe((val: any[]) => {});
+    }
+    this.dialogRef.close();
+  }
+
+  public hasError(controlName: string, errorName: string) {
+    if (this.ranDialogForm.controls[controlName].hasError(errorName)) { return true; }
+    return false;
+  }
+
+  public validateControl(controlName: string) {
+    if (this.ranDialogForm.controls[controlName].invalid && this.ranDialogForm.controls[controlName].touched) { return true; }
+    return false;
+  }
+
+} // class RANConnectDialogComponent
+
 @Component({
   selector: 'app-signal',
   templateUrl: 'signal.component.html',
@@ -75,15 +138,16 @@ export class SignalComponent {
 
   source: LocalDataSource = new LocalDataSource();
 
-  constructor(private service: SignalService, public dialog: MatDialog, private http: HttpClient) {
+  constructor(private service: E2ManagerService
+  , public dialog: MatDialog, private http: HttpClient) {
     this.service.getAll().subscribe((val: any[]) => this.source.load(val));
   }
 
   openRanConnectDialog() {
-    const dialogRef = this.dialog.open(AppRANConnectDialog, {
+    const dialogRef = this.dialog.open(RANConnectDialogComponent, {
       width: '450px',
       data: { }
-    })
+    });
     dialogRef.afterClosed().subscribe(result => {
       this.service.getAll().subscribe((val: any[]) => this.source.load(val));
     });
@@ -91,69 +155,3 @@ export class SignalComponent {
 
 }// class SignalComponent
 
-@Component({
-  selector: 'app-signal-ranconnect-dialog',
-  templateUrl: 'signal.component.ranconnect-dialog.html',
-  styleUrls: ['signal.component.css']
-})
-
-export class AppRANConnectDialog implements OnInit {
-
-  public ranDialogForm: FormGroup;
-
-  constructor(
-      public dialogRef: MatDialogRef<AppRANConnectDialog>,
-      private service: SignalService, 
-      @Inject(MAT_DIALOG_DATA) public data: E2SetupRequest) { 
-    }
-
-  ngOnInit() {
-    const namePattern = /^([A-Z]){4}([0-9]){6}$/;
-    const ipPattern = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/;
-    const portPattern = /^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/;
-    this.ranDialogForm = new FormGroup({
-      ranType: new FormControl('endc'),
-      ranName: new FormControl('', [Validators.required, Validators.pattern(namePattern)]),
-      ranIp: new FormControl('', [Validators.required, Validators.pattern(ipPattern)]),
-      ranPort: new FormControl('', [Validators.required, Validators.pattern(portPattern)])
-    });
-  }
-
-  onCancel() {
-    this.dialogRef.close();
-  }
-
-  public setupConnection = (ranFormValue) => {
-    if (this.ranDialogForm.valid) {
-      this.executeSetupConnection(ranFormValue);
-    }
-  }
-
-  private executeSetupConnection = (ranFormValue) => {
-    let setupRequest: E2SetupRequest = {
-      ranName: ranFormValue.ranName,
-      ranIp:   ranFormValue.ranIp,
-      ranPort: ranFormValue.ranPort
-    }
-    if (ranFormValue.ranType === 'endc') {
-      this.service.endcSetup(setupRequest).subscribe((val: any[]) => {});
-    }
-    else {
-      this.service.x2Setup(setupRequest).subscribe((val: any[]) => {});
-    }
-    this.dialogRef.close();
-  }
-
-  public hasError(controlName: string, errorName: string) {
-    if (this.ranDialogForm.controls[controlName].hasError(errorName))
-      return true;
-    return false;
-  }
-
-  public validateControl(controlName: string) {
-    if (this.ranDialogForm.controls[controlName].invalid && this.ranDialogForm.controls[controlName].touched)
-      return true;
-    return false;
-  }
-
-} // class AppRANConnectDialog
index 6e95b43..f337b73 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.