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>
* 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
--------------------------
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;
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)
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;
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());
}
@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) {
@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,
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());
}
+
}
/.settings
/target/
/.mvn/wrapper/maven-wrapper.jar
-/.vscode
+**/.vscode
### STS ###
.apt_generated
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)">
* 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.
--- /dev/null
+<!--
+ ========================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>
+
--- /dev/null
+/*-
+ * ========================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;
+}
--- /dev/null
+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();
+ });
+});
--- /dev/null
+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() {
+ }
+
+}
* 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.
* 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.
* 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';
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';
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({
ModalEventComponent,
XappComponent,
ConfigEventComponent,
- AppRANConnectDialog,
+ RANConnectDialogComponent,
ConfirmDialogComponent,
FooterComponent,
+ AnrXappComponent,
],
imports: [
BrowserModule,
MatInputModule
],
entryComponents: [
- AppRANConnectDialog,
ConfirmDialogComponent,
+ RANConnectDialogComponent
],
providers: [
UiService,
AdminService,
CatalogService,
ControlService,
- SignalService
+ DashboardService,
+ E2ManagerService
],
bootstrap: [AppComponent]
})
-export class AppModule { };
+export class AppModule { }
* 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.
* 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',
*/
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);
}
}
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
--- /dev/null
+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();
+ });
+});
--- /dev/null
+/*-
+ * ========================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);
+ }
+
+}
* 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 { TestBed } from '@angular/core/testing';
import { AdminService } from './admin.service';
--- /dev/null
+/*-
+ * ========================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();
+ });
+});
--- /dev/null
+/*-
+ * ========================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 */
+
+}
* 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.
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' });
}
* 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.
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;
}
* 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();
});
});
* 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');
}
}
* 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();
});
});
--- /dev/null
+/*-
+ * ========================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);
+ }
+
+}
* 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';
-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'
'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() {
}
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']);
});
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) => {
}
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;
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'
* 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 { 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'
openConfirmDialog(msg) {
return this.dialog.open(ConfirmDialogComponent, {
width: '480px',
- position: { top: "100px" },
+ position: { top: '100px' },
data: {
message: msg
}
* 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.
* 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.
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);
}
* 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.
* 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.
+++ /dev/null
-/*-
- * ========================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')
- }
-
-}
<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>
* 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 { 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',
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));
});
}// 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
* 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.