console.log(customer);
console.log(serviceType);
console.log(serviceInstance);
-
+
ServiceTemplateService.getScaleServiceDialog(customer.name,serviceType.name,serviceInstance.serviceInstanceId,function(data){
console.log(data.data);
ctrl.nsData = data.data;
// console.log(ctrl)
})
ctrl.scaleTypes = ["SCALE_NS","SCALE_VNF"];
- ctrl.scaleType = "";
ctrl.scalingDirections = ["SCALE_IN","SCALE_OUT"];
- ctrl.scalingDirection = "";
- ctrl.aspectId = null;
- ctrl.numberOfStep = null;
ctrl.ok = function () {
+ let resources = [];
+ ctrl.nsData.forEach(function(item){
+ resources.push({
+ "resourceInstanceId": item.netWorkServiceId,
+ "scaleType": item.scaleType,
+ "scaleNsData": {
+ "scaleNsByStepsData": {
+ "aspectId": item.aspectId,
+ "numberOfSteps": item.numberOfStep,
+ "scalingDirection": item.scalingDirection
+ }
+ }
+ })
+ })
var requestBody = {
"service":{
"serviceInstanceName": serviceInstance.serviceInstanceName,
- "serviceType": serviceType,
+ "serviceType": serviceType.value,
"globalSubscriberId": serviceInstance.serviceInstanceId,
- "resources": [
- {
- "resourceInstanceId": "ns111",
- "scaleType": ctrl.scaleType,
- "scaleNsData": {
- "scaleNsByStepsData": {
- "aspectId": ctrl.aspectId,
- "numberOfSteps": ctrl.numberOfStep,
- "scalingDirection": ctrl.scalingDirection
- }
- }
- }
- ]
+ "resources": resources
}
};
var errorMessage = function () {
<span class="required">*</span>
</label>
<div class="col-sm-7">
- <input type="text" id="svcName" name="svcName" class="form-control" placeholder="aspectId" maxlength="256" ng-model="ctrl.aspectId"/>
+ <input type="text" id="svcName" name="svcName" class="form-control" placeholder="aspectId" maxlength="256" ng-model="nsdata.aspectId"/>
</div>
</div>
<div class="mT15 form-group" style="margin-left:25px;">
<span class="required">*</span>
</label>
<div class="col-sm-7">
- <input type="text" id="svcDesc" name="" class="form-control" placeholder="numberOfStep" maxlength="256" ng-model="ctrl.numberOfStep"/>
+ <input type="text" id="svcDesc" name="" class="form-control" placeholder="numberOfStep" maxlength="256" ng-model="nsdata.numberOfStep"/>
</div>
</div>
<div class="form-group" style="margin-left:25px;margin-bottom:15px;">
<span class="required">*</span>
</label>
<div class="col-sm-7">
- <select class="form-control" style="padding-top: 0px;padding-bottom: 0px;" id="svcTempl" name="svcTempl" ng-change="" ng-model="ctrl.scaleType" ng-options="template for template in ctrl.scaleTypes">
+ <select class="form-control" style="padding-top: 0px;padding-bottom: 0px;" id="svcTempl" name="svcTempl" ng-change="" ng-model="nsdata.scaleType" ng-options="template for template in ctrl.scaleTypes">
<option value="">--select--</option>
</select>
</div>
<span class="required">*</span>
</label>
<div class="col-sm-7">
- <select class="form-control" style="padding-top: 0px;padding-bottom: 0px;" id="svcTempl" name="svcTempl" ng-change="" ng-model="ctrl.scalingDirection" ng-options="template for template in ctrl.scalingDirections">
+ <select class="form-control" style="padding-top: 0px;padding-bottom: 0px;" id="svcTempl" name="svcTempl" ng-change="" ng-model="nsdata.scalingDirection" ng-options="template for template in ctrl.scalingDirections">
<option value="">--select--</option>
</select>
</div>