use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class DeleteNetworkCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("Network Id: " + id);
boolean result = _networkService.deleteNetwork(id);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete network");
}
}
use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class DeleteNetworkOfferingCmd method execute.
@Override
public void execute() {
boolean result = _configService.deleteNetworkOffering(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete service offering");
}
}
use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class DeletePhysicalNetworkCmd method execute.
@Override
public void execute() {
UserContext.current().setEventDetails("Physical Network Id: " + id);
boolean result = _networkService.deletePhysicalNetwork(getId());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete physical network");
}
}
use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class DeletePoolCmd method execute.
@Override
public void execute() {
boolean result = _storageService.deletePool(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
StoragePool pool = _storageService.getStoragePool(id);
if (pool != null && pool.getStatus() == StoragePoolStatus.Removed) {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to finish storage pool removal. The storage pool will not be used but cleanup is needed");
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete storage pool");
}
}
}
use of com.cloud.api.ServerApiException in project CloudStack-archive by CloudStack-extras.
the class DeleteProjectCmd method execute.
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public void execute() {
UserContext.current().setEventDetails("Project Id: " + id);
boolean result = _projectService.deleteProject(id);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete project");
}
}
Aggregations