use of org.apache.cloudstack.api.response.OutOfBandManagementResponse in project cloudstack by apache.
the class EnableOutOfBandManagementForClusterCmd method execute.
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public final void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
final Cluster cluster = _resourceService.getCluster(getClusterId());
if (cluster == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find cluster by ID: " + getClusterId());
}
OutOfBandManagementResponse response = outOfBandManagementService.enableOutOfBandManagement(cluster);
CallContext.current().setEventDetails("Cluster Id:" + cluster.getId() + " out-of-band management enabled: true");
CallContext.current().putContextParameter(Cluster.class, cluster.getUuid());
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.OutOfBandManagementResponse in project cloudstack by apache.
the class EnableOutOfBandManagementForHostCmd method execute.
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public final void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
final Host host = _resourceService.getHost(getHostId());
if (host == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find host by ID: " + getHostId());
}
OutOfBandManagementResponse response = outOfBandManagementService.enableOutOfBandManagement(host);
CallContext.current().setEventDetails("Host Id:" + host.getId() + " out-of-band management enabled: true");
CallContext.current().putContextParameter(Host.class, host.getUuid());
response.setId(host.getUuid());
response.setResponseName(getCommandName());
setResponseObject(response);
}
use of org.apache.cloudstack.api.response.OutOfBandManagementResponse in project cloudstack by apache.
the class EnableOutOfBandManagementForZoneCmd method execute.
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public final void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
final DataCenter zone = _resourceService.getZone(getZoneId());
if (zone == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find zone by ID: " + getZoneId());
}
OutOfBandManagementResponse response = outOfBandManagementService.enableOutOfBandManagement(zone);
CallContext.current().setEventDetails("Zone Id:" + zone.getId() + " out-of-band management enabled: true");
CallContext.current().putContextParameter(DataCenter.class, zone.getUuid());
response.setResponseName(getCommandName());
setResponseObject(response);
}
Aggregations