use of com.emc.storageos.computesystemcontroller.ComputeSystemController in project coprhd-controller by CoprHD.
the class ClusterService method detachStorage.
/**
* Updates export groups that are referenced by the given cluster by removing the cluster
* reference and initiators belonging to hosts in this cluster. Volumes are left intact.
*
* @param id the URN of a ViPR Cluster
* @brief Detach storage from cluster
* @return OK if detaching completed successfully
* @throws DatabaseException when a DB error occurs
*/
@POST
@Path("/{id}/detach-storage")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.TENANT_ADMIN })
public TaskResourceRep detachStorage(@PathParam("id") URI id) throws DatabaseException {
Cluster cluster = queryObject(Cluster.class, id, true);
String taskId = UUID.randomUUID().toString();
Operation op = _dbClient.createTaskOpStatus(Cluster.class, id, taskId, ResourceOperationTypeEnum.DETACH_VCENTER_DATACENTER_STORAGE);
ComputeSystemController controller = getController(ComputeSystemController.class, null);
controller.detachClusterStorage(cluster.getId(), false, true, taskId);
return toTask(cluster, taskId, op);
}
Aggregations