diff options
author | root <preethamshyam.sathiyaseelan@us.fujitsu.com> | 2020-02-19 06:02:26 +0000 |
---|---|---|
committer | root <preethamshyam.sathiyaseelan@us.fujitsu.com> | 2020-02-19 06:21:39 +0000 |
commit | 8b413dccc18d361ac78e0d9f49e1dd761a79a258 (patch) | |
tree | e8a47090a1643a73be4027b2dd5c69f135aced8c /usecaseui-portal/src/app/core | |
parent | 7343c79b3fbba637700e92e06f09b39a9707131f (diff) |
Changes for MDONS usecase
Added MDONS creation and Detail show pages and logic
Change-Id: If830fc0399af561e712b8deff745c8bd88e8117d
Issue-ID: USECASEUI-371
Signed-off-by: root <preethamshyam.sathiyaseelan@us.fujitsu.com>
Diffstat (limited to 'usecaseui-portal/src/app/core')
-rw-r--r-- | usecaseui-portal/src/app/core/services/serviceList.service.ts | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/usecaseui-portal/src/app/core/services/serviceList.service.ts b/usecaseui-portal/src/app/core/services/serviceList.service.ts index 1ada669f..945d60c2 100644 --- a/usecaseui-portal/src/app/core/services/serviceList.service.ts +++ b/usecaseui-portal/src/app/core/services/serviceList.service.ts @@ -17,6 +17,7 @@ import { Injectable } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; import { servicesTableData,baseUrl } from '../models/dataInterface'; +import { retry, catchError } from 'rxjs/operators'; @Injectable() export class ServiceListService { @@ -52,11 +53,17 @@ export class ServiceListService { pnfDetail: this.baseUrl + "/uui-sotn/getPnfInfo/", connectivity: this.baseUrl + "/uui-sotn/getConnectivityInfo/", vpnBinding: this.baseUrl + "/uui-sotn/getPinterfaceByVpnId/", + getNIList: this.baseUrl + "/uui-lcm/getAllNI/" }; //The following APIs are optimizable + //get all unni + getAllNI(type) { + return this.http.get<any>(this.url.getNIList+type); + } + // Get all customers getAllCustomers() { return this.http.get<any>(this.url.customers); @@ -89,8 +96,11 @@ export class ServiceListService { } // Create interface createInstance(requestBody, createParams) { - return this.http.post<any>(this.url.createService + createParams, requestBody); + return this.http.post<any>(this.url.createService + createParams, requestBody).pipe( + catchError(this.handleError) + ); } + // NS CreateInstance step one nsCreateInstance(requestBody) { return this.http.post<any>(this.url.ns_createService, requestBody); @@ -136,7 +146,7 @@ export class ServiceListService { inputs: "" }; return this.http.post<any>(this.url.nstemplateParameters, body); - } else if (type == "e2e") { + } else if (type == "e2e" || type == "MDONS") { let params = new HttpParams({ fromObject: {"toscaModelPath":template.toscaModelURL} }); let url = this.url.e2etemplateParameters.replace("*_*", template.uuid); return this.http.get<any>(url,{params}); @@ -209,5 +219,17 @@ export class ServiceListService { return this.http.get<any>(url); } - + + handleError(error) { + let errorMessage = ''; + if (error.error instanceof ErrorEvent) { + // client-side error + errorMessage = `Error: ${error.error.message}`; + } else { + // server-side error + errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}`; + } + console.log("errorMessage : "+errorMessage); + return Observable.throw(error); + } } |