use of com.cloud.network.as.AutoScaleVmGroup in project cloudstack by apache.
the class ListAutoScaleVmGroupsCmd method execute.
@Override
public void execute() {
if (id != null && (loadBalancerId != null || profileId != null || policyId != null))
throw new InvalidParameterValueException("When id is specified other parameters need not be specified");
List<? extends AutoScaleVmGroup> autoScaleGroups = _autoScaleService.listAutoScaleVmGroups(this);
ListResponse<AutoScaleVmGroupResponse> response = new ListResponse<AutoScaleVmGroupResponse>();
List<AutoScaleVmGroupResponse> responses = new ArrayList<AutoScaleVmGroupResponse>();
if (autoScaleGroups != null) {
for (AutoScaleVmGroup autoScaleVmGroup : autoScaleGroups) {
AutoScaleVmGroupResponse autoScaleVmGroupResponse = _responseGenerator.createAutoScaleVmGroupResponse(autoScaleVmGroup);
autoScaleVmGroupResponse.setObjectName("autoscalevmgroup");
responses.add(autoScaleVmGroupResponse);
}
}
response.setResponses(responses);
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of com.cloud.network.as.AutoScaleVmGroup in project cloudstack by apache.
the class DisableAutoScaleVmGroupCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
AutoScaleVmGroup result = _autoScaleService.disableAutoScaleVmGroup(getId());
if (result != null) {
AutoScaleVmGroupResponse response = _responseGenerator.createAutoScaleVmGroupResponse(result);
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to disable AutoScale Vm Group");
}
}
Aggregations