Search in sources :

Example 1 with InstanceGroupResponse

use of org.apache.cloudstack.api.response.InstanceGroupResponse in project cloudstack by apache.

the class CreateVMGroupCmd method execute.

@Override
public void execute() {
    InstanceGroup result = _userVmService.createVmGroup(this);
    if (result != null) {
        InstanceGroupResponse response = _responseGenerator.createInstanceGroupResponse(result);
        response.setResponseName(getCommandName());
        setResponseObject(response);
    } else {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create vm instance group");
    }
}
Also used : ServerApiException(org.apache.cloudstack.api.ServerApiException) InstanceGroupResponse(org.apache.cloudstack.api.response.InstanceGroupResponse) InstanceGroup(com.cloud.vm.InstanceGroup)

Example 2 with InstanceGroupResponse

use of org.apache.cloudstack.api.response.InstanceGroupResponse in project cloudstack by apache.

the class UpdateVMGroupCmd method execute.

@Override
public void execute() {
    InstanceGroup result = _mgr.updateVmGroup(this);
    if (result != null) {
        InstanceGroupResponse response = _responseGenerator.createInstanceGroupResponse(result);
        response.setResponseName(getCommandName());
        setResponseObject(response);
    } else {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update vm instance group");
    }
}
Also used : ServerApiException(org.apache.cloudstack.api.ServerApiException) InstanceGroupResponse(org.apache.cloudstack.api.response.InstanceGroupResponse) InstanceGroup(com.cloud.vm.InstanceGroup)

Example 3 with InstanceGroupResponse

use of org.apache.cloudstack.api.response.InstanceGroupResponse in project cloudstack by apache.

the class InstanceGroupJoinDaoImpl method newInstanceGroupResponse.

@Override
public InstanceGroupResponse newInstanceGroupResponse(InstanceGroupJoinVO group) {
    InstanceGroupResponse groupResponse = new InstanceGroupResponse();
    groupResponse.setId(group.getUuid());
    groupResponse.setName(group.getName());
    groupResponse.setCreated(group.getCreated());
    ApiResponseHelper.populateOwner(groupResponse, group);
    groupResponse.setObjectName("instancegroup");
    return groupResponse;
}
Also used : InstanceGroupResponse(org.apache.cloudstack.api.response.InstanceGroupResponse)

Aggregations

InstanceGroupResponse (org.apache.cloudstack.api.response.InstanceGroupResponse)3 InstanceGroup (com.cloud.vm.InstanceGroup)2 ServerApiException (org.apache.cloudstack.api.ServerApiException)2