use of com.cloud.dc.Pod 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.dc.Pod 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.dc.Pod in project cloudstack by apache.
the class LoadBalanceRuleHandler method deployLoadBalancerVM.
private DomainRouterVO deployLoadBalancerVM(final Long networkId, final IPAddressVO ipAddr) {
final NetworkVO network = _networkDao.findById(networkId);
final DataCenter dc = _dcDao.findById(network.getDataCenterId());
final Long podId = getPodIdForDirectIp(ipAddr);
final Pod pod = podId == null ? null : _podDao.findById(podId);
final Map<VirtualMachineProfile.Param, Object> params = new HashMap<VirtualMachineProfile.Param, Object>(1);
params.put(VirtualMachineProfile.Param.ReProgramGuestNetworks, true);
final Account owner = _accountService.getActiveAccountByName("system", new Long(1));
final DeployDestination dest = new DeployDestination(dc, pod, null, null);
s_logger.debug("About to deploy ELB vm ");
try {
final DomainRouterVO elbVm = deployELBVm(network, dest, owner, params);
if (elbVm == null) {
throw new InvalidParameterValueException("Could not deploy or find existing ELB VM");
}
s_logger.debug("Deployed ELB vm = " + elbVm);
return elbVm;
} catch (final Throwable t) {
s_logger.warn("Error while deploying ELB VM: ", t);
return null;
}
}
use of com.cloud.dc.Pod in project cloudstack by apache.
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(ApiErrorCode.INTERNAL_ERROR, "Failed to create pod");
}
}
use of com.cloud.dc.Pod in project cloudstack by apache.
the class UpdatePodCmd method execute.
@Override
public void execute() {
Pod result = _configService.editPod(this);
if (result != null) {
PodResponse response = _responseGenerator.createPodResponse(result, false);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update pod");
}
}
Aggregations