summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/services
diff options
context:
space:
mode:
authorguochuyicmri <guochuyi@chinamobile.com>2018-11-15 19:01:42 +0800
committerguochuyicmri <guochuyi@chinamobile.com>2018-11-15 19:02:06 +0800
commitcc166a941f69030a467b9e2280fb7b9f08dca945 (patch)
treea1a8ecb553a90df3c2f21163a29d3433a9e3a50b /usecaseui-portal/src/app/services
parent5efb94a84946a5ea254f0fa91cd6f149373bd046 (diff)
fix NS Instance Instantiation for VF-C
Change-Id: I66f570114e6a946ab025ccdbb65e23b65854da3e Issue-ID: USECASEUI-160 Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/services')
-rw-r--r--usecaseui-portal/src/app/services/services-list/services-list.component.ts35
1 files changed, 31 insertions, 4 deletions
diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.ts b/usecaseui-portal/src/app/services/services-list/services-list.component.ts
index e742ee39..4e0770a3 100644
--- a/usecaseui-portal/src/app/services/services-list/services-list.component.ts
+++ b/usecaseui-portal/src/app/services/services-list/services-list.component.ts
@@ -519,7 +519,11 @@ export class ServicesListComponent implements OnInit {
// step1
this.myhttp.nsCreateInstance(obj.step1)
.subscribe((data)=>{
- console.log(data);
+ // console.log(data);
+ if(data.status == "FAILED"){
+ console.log("create ns service failed :" + JSON.stringify(data));
+ return false;
+ }
newData = { //
'service-instance-id':data.nsInstanceId,
'service-instance-name':obj.step1.nsName,
@@ -562,7 +566,10 @@ export class ServicesListComponent implements OnInit {
let mypromise = new Promise((res,rej)=>{
this.myhttp.createInstance(requestBody,createParams)
.subscribe((data)=>{
-
+ if(data.status == "FAILED"){
+ console.log("create e2e service failed :" + JSON.stringify(data));
+ return false;
+ }
res(data.service);
})
})
@@ -573,7 +580,7 @@ export class ServicesListComponent implements OnInit {
this.myhttp.nsCreateInstance2(id,obj)
.subscribe((data)=>{
if(data.status == "FAILED"){
- console.log("instantiate ns service data :" + JSON.stringify(data));
+ console.log("instantiate ns service failed :" + JSON.stringify(data));
return false;
}
res(data.jobId);
@@ -588,6 +595,10 @@ export class ServicesListComponent implements OnInit {
service.status = "Scaling";
this.myhttp.scaleE2eService(id,requestBody)
.subscribe((data)=>{
+ if(data.status == "FAILED"){
+ console.log("scale E2e service failed :" + JSON.stringify(data));
+ return false;
+ }
let obj = {
serviceId:id,
operationId:data.operationId
@@ -608,6 +619,10 @@ export class ServicesListComponent implements OnInit {
service.status = "Healing";
this.myhttp.healNsService(service.nsInstanceId,requestBody)
.subscribe((data)=>{
+ if(data.status == "FAILED"){
+ console.log("heal nsvnf service failed :" + JSON.stringify(data));
+ return false;
+ }
let jobid = data.jobId;
let updata = (prodata)=>{
service.rate = prodata.responseDescriptor.progress;
@@ -636,6 +651,10 @@ export class ServicesListComponent implements OnInit {
return new Promise((res,rej)=>{
this.myhttp.deleteInstance(params)
.subscribe((data)=>{
+ if(data.status == "FAILED"){
+ console.log("delete service failed :" + JSON.stringify(data));
+ return false;
+ }
let obj = {serviceId:params.serviceInstanceId,operationId:data.operationId}
let updata = (prodata)=>{
allprogress[prodata.operationId] = prodata.progress;
@@ -680,7 +699,11 @@ export class ServicesListComponent implements OnInit {
}).then(()=>{
this.myhttp.nsDeleteInstance(id)
.subscribe((data)=>{
- console.log(data);
+ // console.log(data);
+ if(data.status == "FAILED"){
+ console.log("delete ns service failed :" + JSON.stringify(data));
+ return false;
+ }
service.rate = 100;
service.status = "completed";
let hasUndone = this.tableData.some((item)=>{
@@ -699,6 +722,10 @@ export class ServicesListComponent implements OnInit {
let mypromise = new Promise((res,rej)=>{
this.myhttp.stopNsService(id,obj)
.subscribe((data)=>{
+ if(data.status == "FAILED"){
+ console.log("stop ns service failed :" + JSON.stringify(data));
+ return false;
+ }
res(data.jobId);
})
})