|
|
|
@ -10,16 +10,19 @@
|
|
|
|
|
*/
|
|
|
|
|
package com.platform.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import org.apache.log4j.Logger;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
|
|
|
|
|
import com.platform.glusterfs.ClusterInfo;
|
|
|
|
|
import com.platform.glusterfs.VolumeInfo;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <一句话功能简述>
|
|
|
|
|
* 显示集群信息
|
|
|
|
|
* <功能详细描述>
|
|
|
|
|
* @author liliy
|
|
|
|
|
* @version [版本号,2016年9月8日]
|
|
|
|
@ -28,8 +31,9 @@ import com.platform.glusterfs.ClusterInfo;
|
|
|
|
|
*/
|
|
|
|
|
@Controller
|
|
|
|
|
public class ShowGlusterfsController {
|
|
|
|
|
public static Logger log = Logger.getLogger(ShowGlusterfsController.class);
|
|
|
|
|
/**
|
|
|
|
|
* <一句话功能简述>
|
|
|
|
|
* 显示集群节点以及状态
|
|
|
|
|
* <功能详细描述>
|
|
|
|
|
* @return
|
|
|
|
|
* @see [类、类#方法、类#成员]
|
|
|
|
@ -40,5 +44,32 @@ public class ShowGlusterfsController {
|
|
|
|
|
return peer_status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <一句话功能简述>
|
|
|
|
|
* <功能详细描述>
|
|
|
|
|
* @return
|
|
|
|
|
* @see [类、类#方法、类#成员]
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping("/showVolumeStatus")
|
|
|
|
|
public Map<String,String> showVolumeStatus(){
|
|
|
|
|
VolumeInfo volumeInfo=new VolumeInfo();
|
|
|
|
|
Map<String, String> volume_status=new HashMap<String, String>();
|
|
|
|
|
List<String> volumes=volumeInfo.showAllVolumeName();
|
|
|
|
|
if(volumes==null){
|
|
|
|
|
log.error("showAllVolumeName is error!");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
for(String vol:volumes){
|
|
|
|
|
String status=volumeInfo.getVolumeStatus(vol);
|
|
|
|
|
if(status==null){
|
|
|
|
|
log.error("getVolumeStatus is error!");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
volume_status.put(vol, status);
|
|
|
|
|
}
|
|
|
|
|
return volume_status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|