use of com.cloud.api.response.PodResponse in project CloudStack-archive by CloudStack-extras.
the class CreatePodCmd method execute.
@Override
public void execute() {
Pod result = _configService.createPod(getZoneId(), getPodName(), getStartIp(), getEndIp(), getGateway(), getNetmask(), getAllocationState());
if (result != null) {
PodResponse response = _responseGenerator.createPodResponse(result, false);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create pod");
}
}
use of com.cloud.api.response.PodResponse in project CloudStack-archive by CloudStack-extras.
the class ListPodsByCmd method execute.
@Override
public void execute() {
List<? extends Pod> result = _mgr.searchForPods(this);
ListResponse<PodResponse> response = new ListResponse<PodResponse>();
List<PodResponse> podResponses = new ArrayList<PodResponse>();
for (Pod pod : result) {
PodResponse podResponse = _responseGenerator.createPodResponse(pod, showCapacities);
podResponse.setObjectName("pod");
podResponses.add(podResponse);
}
response.setResponses(podResponses);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.PodResponse in project cosmic by MissionCriticalCloud.
the class CreatePodCmd method execute.
// ///////////////////////////////////////////////////
// ///////////////// Accessors ///////////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final Pod result = _configService.createPod(getZoneId(), getPodName(), getStartIp(), getEndIp(), getGateway(), getNetmask(), getAllocationState());
if (result != null) {
final PodResponse response = _responseGenerator.createPodResponse(result, false);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create pod");
}
}
use of com.cloud.api.response.PodResponse in project cosmic by MissionCriticalCloud.
the class ListPodsByCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final Pair<List<? extends Pod>, Integer> result = _mgr.searchForPods(this);
final ListResponse<PodResponse> response = new ListResponse<>();
final List<PodResponse> podResponses = new ArrayList<>();
for (final Pod pod : result.first()) {
final PodResponse podResponse = _responseGenerator.createPodResponse(pod, showCapacities);
podResponse.setObjectName("pod");
podResponses.add(podResponse);
}
response.setResponses(podResponses, result.second());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
use of com.cloud.api.response.PodResponse in project cosmic by MissionCriticalCloud.
the class UpdatePodCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() {
final Pod result = _configService.editPod(this);
if (result != null) {
final PodResponse response = _responseGenerator.createPodResponse(result, false);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update pod");
}
}
Aggregations