summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal
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
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')
-rw-r--r--usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts2
-rw-r--r--usecaseui-portal/src/app/myhttp.service.ts2
-rw-r--r--usecaseui-portal/src/app/services/services-list/services-list.component.ts35
3 files changed, 33 insertions, 6 deletions
diff --git a/usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts b/usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts
index d45978ae..3cbc12ae 100644
--- a/usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts
+++ b/usecaseui-portal/src/app/components/e2e-creation/e2e-creation.component.ts
@@ -190,7 +190,7 @@ export class E2eCreationComponent implements OnInit {
let vnfparams = {
vnfProfileId: vnf.properties.id,
locationConstraints: {
- vimid: vnf.value.id,
+ vimId: vnf.value.name + "_" + vnf.value.id,
}
}
this.ns_service2.locationConstraints.push(vnfparams);
diff --git a/usecaseui-portal/src/app/myhttp.service.ts b/usecaseui-portal/src/app/myhttp.service.ts
index 7c77e973..fda6d0f8 100644
--- a/usecaseui-portal/src/app/myhttp.service.ts
+++ b/usecaseui-portal/src/app/myhttp.service.ts
@@ -182,7 +182,7 @@ export class MyhttpService {
}
nsCreateInstance2(params, requestBody) {
// return this.http.get<any>(this.url.ns_createService2 + params); //Local simulation
- return this.http.post<any>(this.url.ns_createService + params, requestBody);
+ return this.http.post<any>(this.url.ns_createService2 + params, requestBody);
}
// Input parameter name conversion
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);
})
})