use of org.apache.cloudstack.api.response.HostHAResponse in project cloudstack by apache.
the class DisableHAForHostCmd method setupResponse.
private void setupResponse(final boolean result, final String resourceUuid) {
final HostHAResponse response = new HostHAResponse();
response.setId(resourceUuid);
response.setEnabled(false);
response.setStatus(result);
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.HostHAResponse in project cloudstack by apache.
the class EnableHAForHostCmd method setupResponse.
private void setupResponse(final boolean result, final String resourceUuid) {
final HostHAResponse response = new HostHAResponse();
response.setId(resourceUuid);
response.setEnabled(true);
response.setStatus(result);
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.HostHAResponse in project cloudstack by apache.
the class ListHostHAResourcesCmd method setupResponse.
private void setupResponse(final List<HAConfig> hostHAConfigList) {
final ListResponse<HostHAResponse> response = new ListResponse<>();
final List<HostHAResponse> hostHAResponses = new ArrayList<>();
for (final HAConfig config : hostHAConfigList) {
final Host host = _resourceService.getHost(config.getResourceId());
if (host == null) {
continue;
}
final HostHAResponse hostHAResponse = new HostHAResponse();
hostHAResponse.setId(host.getUuid());
hostHAResponse.setEnabled(config.isEnabled());
hostHAResponse.setHaState(config.getState());
hostHAResponse.setProvider(config.getHaProvider());
hostHAResponses.add(hostHAResponse);
}
response.setResponses(hostHAResponses);
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.HostHAResponse in project cloudstack by apache.
the class ConfigureHAForHostCmd method setupResponse.
private void setupResponse(final boolean result, final String resourceUuid) {
final HostHAResponse response = new HostHAResponse();
response.setId(resourceUuid);
response.setProvider(getHaProvider().toLowerCase());
response.setResponseName(getCommandName());
setResponseObject(response);
}
Aggregations