diff options
author | Tao Shen <shentao@chinamobile.com> | 2018-11-07 00:11:08 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-11-07 00:11:08 +0000 |
commit | 70606dfe5caf3b460a10cbc1bde400e1e75e6535 (patch) | |
tree | 80d409821c09ceb50e0f8f7b0916957370240631 /usecaseui-portal/src/app/services/services-list/services-list.component.ts | |
parent | 2ab49df337f320a6fca9a96ffb46c582f574f3c7 (diff) | |
parent | e844150490b7d437da1693c52294720f59121d64 (diff) |
Merge "e2eService Scale finsh"
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; |