From e844150490b7d437da1693c52294720f59121d64 Mon Sep 17 00:00:00 2001 From: guochuyicmri Date: Tue, 6 Nov 2018 19:21:32 +0800 Subject: e2eService Scale finsh Change-Id: Ib7e5e792c6434a832bc120295888f78af555f4b6 Issue-ID: USECASEUI-163 Signed-off-by: guochuyicmri --- usecaseui-portal/src/app/myhttp.service.ts | 14 +++++ .../services-list/services-list.component.css | 2 +- .../services-list/services-list.component.html | 32 +++++++++-- .../services-list/services-list.component.less | 2 +- .../services-list/services-list.component.ts | 64 +++++++++++++++++++++- 5 files changed, 105 insertions(+), 9 deletions(-) diff --git a/usecaseui-portal/src/app/myhttp.service.ts b/usecaseui-portal/src/app/myhttp.service.ts index b2ab91be..45cb8955 100644 --- a/usecaseui-portal/src/app/myhttp.service.ts +++ b/usecaseui-portal/src/app/myhttp.service.ts @@ -52,6 +52,8 @@ export class MyhttpService { // vnfInfo: this.baseUrl + "/vnfInfo.json?", // progress:this.baseUrl + "/progress.json?", // nsProgress:this.baseUrl + "nsProgress.json?", + // e2eScale:this.baseUrl + "/e2eScale.json?", + // e2e_nsdata:this.baseUrl + "/e2e_nsdata.json?", // allottedResource:this.baseUrl + "/allotted-resources2.json?", // pnfDetail:this.baseUrl + "/pnfdetail-domain.json?", @@ -89,6 +91,8 @@ export class MyhttpService { vnfInfo: this.baseUrl + "/uui-lcm/VnfInfo/", progress:this.baseUrl + "/uui-lcm/services/" + "*_*" + "/operations/", nsProgress:this.baseUrl + "/uui-lcm/jobs/getNsLcmJobStatus/"+ "*_*" + "?responseId=", + e2eScale: this.baseUrl + "/services/scaleServices/", + e2e_nsdata: this.baseUrl + "/getServiceInstanceById/customerId/", allottedResource:this.baseUrl + "/uui-sotn/getAllottedResources", pnfDetail:this.baseUrl + "/uui-sotn/getPnfInfo/", @@ -219,6 +223,16 @@ export class MyhttpService { return this.http.post(this.url.ns_healService + id,requestBody); } + // scale + scaleE2eService(id,requestBody){ + // return this.http.get(this.url.e2eScale + id); + return this.http.post(this.url.e2eScale + id,requestBody); + } + getE2e_nsData(paramsObj){ + let params = new HttpParams({fromObject:paramsObj}); + return this.http.get(this.url.e2e_nsdata,{params}); + } + // Query progress interface getProgress(obj){ let url = this.url.progress.replace("*_*",obj.serviceId) + obj.operationId; diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.css b/usecaseui-portal/src/app/services/services-list/services-list.component.css index 1f9d051a..15793838 100644 --- a/usecaseui-portal/src/app/services/services-list/services-list.component.css +++ b/usecaseui-portal/src/app/services/services-list/services-list.component.css @@ -96,7 +96,7 @@ hr { font-size: 12px; color: green; } -.list nz-table tbody td span.stopping { +.list nz-table tbody td span.scaling { font-size: 12px; color: purple; } diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.html b/usecaseui-portal/src/app/services/services-list/services-list.component.html index 616d5b39..fa875c0f 100644 --- a/usecaseui-portal/src/app/services/services-list/services-list.component.html +++ b/usecaseui-portal/src/app/services/services-list/services-list.component.html @@ -115,17 +115,17 @@ {{data.status || "Active"}} - + 'scaling':data.status=='Scaling','healing':data.status=='Healing'}">{{data.status || "Active"}} + - + - + @@ -145,6 +145,28 @@ + + +

Are you sure heal this instance?

+ Instance ID: {{ thisService["service-instance-id"] || thisService["nsInstanceId"] || thisService["vnfInstanceId"]}} +
+

{{ item.netWorkServiceName }}


+ Scale Type: + + + + + AspectId: + + Number Of Steps: + + Scaling Direction: + + + + +
+

Are you sure delete this instance?

Instance ID: {{ thisService["service-instance-id"] || thisService["nsInstanceId"] }} diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.less b/usecaseui-portal/src/app/services/services-list/services-list.component.less index 3d9962d2..40c00231 100644 --- a/usecaseui-portal/src/app/services/services-list/services-list.component.less +++ b/usecaseui-portal/src/app/services/services-list/services-list.component.less @@ -99,7 +99,7 @@ hr { font-size: 12px; color: green; } - span.stopping { + span.scaling { font-size: 12px; color: purple; } 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 9da7cf9c..373583ea 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 @@ -167,9 +167,49 @@ export class ServicesListComponent implements OnInit { } thisService = {}; //The current service of the operation - scaleService(){ - console.log("scaleService!"); + e2e_nsData:Object[]; + scaleModelVisible = false; + scaleService(service){ + this.thisService = service; + this.scaleModelVisible = true; + let paramsObj = { + customerId:this.customerSelected.id, + serviceType:this.serviceTypeSelected.name, + serviceId:service["service-instance-id"] + } + this.myhttp.getE2e_nsData(paramsObj) + .subscribe((data)=>{ + this.e2e_nsData = data; + }) + } + scaleOk(){ + this.scaleModelVisible = false; + let requestBody = { + "service": { + "serviceInstanceName": this.thisService["service-instance-name"], + "serviceType": this.serviceTypeSelected.name, + "globalSubscriberId": this.customerSelected.id, + "resources": this.e2e_nsData.map((item)=>{ + return { + "resourceInstanceId": item["netWorkServiceId"], + "scaleType": item["scaleType"], + "scaleNsData": { + "scaleNsByStepsData": { + "aspectId": item["aspectId"], + "numberOfSteps": item["numberOfSteps"], + "scalingDirection": item["scalingDirection"] + } + } + } + }) + } + } + this.scaleE2eService(this.thisService,requestBody); } + scaleCancel(){ + this.scaleModelVisible = false; + } + updataService(){ console.log("updataService!"); } @@ -511,6 +551,26 @@ export class ServicesListComponent implements OnInit { return mypromise; } + scaleE2eService(service,requestBody){ + let id = service["service-instance-id"]; + service.rate = 0; + service.status = "Scaling"; + this.myhttp.scaleE2eService(id,requestBody) + .subscribe((data)=>{ + let obj = { + serviceId:id, + operationId:data.operationId + } + let updata = (prodata)=>{ + service.rate = prodata.progress; + } + this.queryProgress(obj,updata).then(()=>{ + service.rate = 100; + service.status = "Active"; + }) + }) + } + healNsVnfService(service,requestBody){ console.log(service); service.rate = 0; -- cgit 1.2.3-korg