|
186 | 186 | destroyVMgracePeriod: autoscaleVmProfile.destroyvmgraceperiod, |
187 | 187 | securityGroups: securityGroups, |
188 | 188 | diskOfferingId: diskOfferingId, |
189 | | - snmpCommunity: autoscaleVmProfile.snmpcommunity, |
190 | | - snmpPort: autoscaleVmProfile.snmpport, |
| 189 | + snmpCommunity: autoscaleVmProfile.counterparam.snmpcommunity, |
| 190 | + snmpPort: autoscaleVmProfile.counterparam.snmpport, |
191 | 191 | username: autoscaleVmProfile.autoscaleuserid, |
192 | 192 | context: { |
193 | 193 | autoscaleVmGroup: autoscaleVmGroup, |
|
1075 | 1075 | destroyvmgraceperiod: args.data.destroyVMgracePeriod, |
1076 | 1076 | snmpcommunity: args.data.snmpCommunity, |
1077 | 1077 | snmpport: args.data.snmpPort |
1078 | | - }; |
| 1078 | + }; |
| 1079 | + |
| 1080 | + var allParamNames=$.map(data,function(value,key){ |
| 1081 | + return key; |
| 1082 | + }); |
| 1083 | + |
| 1084 | + var notParams =['zoneid','serviceofferingid','templateid','destroyvmgraceperiod']; |
| 1085 | + var index=0; |
| 1086 | + $(allParamNames).each(function() { |
| 1087 | + var param='counterparam[' + index + ']'; |
| 1088 | + var name = this.toString(); |
| 1089 | + var value = data[name]; |
| 1090 | + if(!value || $.inArray(name,notParams) >-1 ) return true; |
| 1091 | + data[param+ '.name']=name; |
| 1092 | + data[param+ '.value']=value; |
| 1093 | + index++; |
| 1094 | + delete data[name]; |
| 1095 | + |
| 1096 | + return true; |
| 1097 | + }); |
| 1098 | + |
1079 | 1099 |
|
1080 | 1100 | if(args.data.username != null && args.data.username.length > 0) { |
1081 | 1101 | $.extend(data, { |
|
1138 | 1158 | destroyvmgraceperiod: args.data.destroyVMgracePeriod, |
1139 | 1159 | snmpcommunity: args.data.snmpCommunity, |
1140 | 1160 | snmpport: args.data.snmpPort |
1141 | | - }; |
| 1161 | + }; |
| 1162 | + |
| 1163 | + var allParamNames=$.map(data,function(value,key){ |
| 1164 | + return key; |
| 1165 | + }); |
| 1166 | + |
| 1167 | + var notParams =['id','templateid','destroyvmgraceperiod']; |
| 1168 | + var index=0; |
| 1169 | + $(allParamNames).each(function() { |
| 1170 | + var param='counterparam[' + index + ']'; |
| 1171 | + var name = this.toString(); |
| 1172 | + var value = data[name]; |
| 1173 | + if(!value || $.inArray(name,notParams) >-1 ) return true; |
| 1174 | + data[param+ '.name']=name; |
| 1175 | + data[param+ '.value']=value; |
| 1176 | + index++; |
| 1177 | + delete data[name]; |
| 1178 | + |
| 1179 | + return true; |
| 1180 | + }); |
| 1181 | + |
| 1182 | + |
| 1183 | + |
1142 | 1184 |
|
1143 | 1185 | if(args.data.username != null && args.data.username.length > 0) { |
1144 | 1186 | $.extend(data, { |
|
0 commit comments