diff options
author | 2018-11-06 19:21:32 +0800 | |
---|---|---|
committer | 2018-11-06 19:22:06 +0800 | |
commit | e844150490b7d437da1693c52294720f59121d64 (patch) | |
tree | b17a4b2bf38a0859eaa6db955eb10d0d4cb7af11 /usecaseui-portal/src/app/services/services-list/services-list.component.ts | |
parent | 3aa2334e116c1e7921ed46958ff5fed1c70fad7e (diff) |
e2eService Scale finsh
Change-Id: Ib7e5e792c6434a832bc120295888f78af555f4b6
Issue-ID: USECASEUI-163
Signed-off-by: guochuyicmri <guochuyi@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/services/services-list/services-list.component.ts')
-rw-r--r-- | usecaseui-portal/src/app/services/services-list/services-list.component.ts | 64 |
1 files changed, 62 insertions, 2 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 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; |