mirror of https://github.com/apache/cloudstack.git
73 lines
2.5 KiB
Java
73 lines
2.5 KiB
Java
package com.cloud.api.commands;
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
import com.cloud.api.BaseCmd;
|
|
import com.cloud.api.BaseCmd.Manager;
|
|
import com.cloud.api.Implementation;
|
|
import com.cloud.api.Parameter;
|
|
|
|
@Implementation(method="deleteHost", manager=Manager.StorageManager)
|
|
public class DeletePoolCmd extends BaseCmd {
|
|
public static final Logger s_logger = Logger.getLogger(DeletePoolCmd.class.getName());
|
|
private static final String s_name = "deletepoolresponse";
|
|
|
|
/////////////////////////////////////////////////////
|
|
//////////////// API parameters /////////////////////
|
|
/////////////////////////////////////////////////////
|
|
|
|
@Parameter(name="id", type=CommandType.LONG, required=true)
|
|
private Long id;
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
/////////////////// Accessors ///////////////////////
|
|
/////////////////////////////////////////////////////
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
/////////////// API Implementation///////////////////
|
|
/////////////////////////////////////////////////////
|
|
|
|
@Override
|
|
public String getName() {
|
|
return s_name;
|
|
}
|
|
|
|
// @Override
|
|
// public List<Pair<String, Object>> execute(Map<String, Object> params) {
|
|
// Long poolId = (Long) params.get(BaseCmd.Properties.ID.getName());
|
|
//
|
|
// //verify parameters
|
|
// StoragePoolVO sPool = getManagementServer().findPoolById(poolId);
|
|
// if (sPool == null) {
|
|
// throw new ServerApiException(BaseCmd.PARAM_ERROR, "Unable to find pool by id " + poolId);
|
|
// }
|
|
//
|
|
// if (sPool.getPoolType().equals(StoragePoolType.LVM)) {
|
|
// throw new ServerApiException(BaseCmd.UNSUPPORTED_ACTION_ERROR, "Unable to delete local storage id: " + poolId);
|
|
// }
|
|
//
|
|
// boolean deleted = true;
|
|
// try {
|
|
// deleted = getManagementServer().deletePool(poolId);
|
|
//
|
|
// } catch (Exception ex) {
|
|
// s_logger.error("Exception deleting pool", ex);
|
|
// throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
|
|
// }
|
|
// if (!deleted) {
|
|
// throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Volumes exist on primary storage, unable to delete");
|
|
// }
|
|
//
|
|
// List<Pair<String, Object>> returnValues = new ArrayList<Pair<String, Object>>();
|
|
// returnValues.add(new Pair<String, Object>(BaseCmd.Properties.SUCCESS.getName(), "true"));
|
|
//
|
|
// return returnValues;
|
|
// }
|
|
}
|