Authored by qinchao

主机管理

... ... @@ -277,6 +277,44 @@ public class MObjectInfoCtrl {
return modelList;
}
@RequestMapping(value = "/asyMobjectHost")
public BaseResponse asyMobjectHost(int moTypeId) {
TypeInfo typeInfo=typeInfoService.queryTypeInfo(moTypeId);
if(typeInfo!=null&&StringUtils.isNotBlank(typeInfo.getTags())){
MObjectInfoReq mObjectInfoReq = new MObjectInfoReq();
mObjectInfoReq.setTypeIds(""+typeInfo.getTypeId());
mObjectInfoReq.setMoTags(typeInfo.getDescr());
//根据typeinfo的主机标签查询出主机
List<String> hostTagsList=new ArrayList<String>();
List<Integer> cloudTagsList=new ArrayList<Integer>();
if(StringUtils.isNotBlank(typeInfo.getCloudTags())){
for(String cloudTag:typeInfo.getCloudTags().split(",")){
if("1".equalsIgnoreCase(cloudTag)){
cloudTagsList.add(1);
}else if("2".equalsIgnoreCase(cloudTag)){
cloudTagsList.add(2);
}else if("3".equalsIgnoreCase(cloudTag)){
cloudTagsList.add(3);
}else if("0".equalsIgnoreCase(cloudTag)){
cloudTagsList=new ArrayList<Integer>(); //全部云
break;
}
}
}
for(String hostTag:typeInfo.getTags().split(",")){
if(StringUtils.isNotBlank(hostTag)){
hostTagsList.add(hostTag);
}
}
if(hostTagsList.size()>0){
//List<HostInfo> newhostInfos =hostInfoMapper.selectHostInfosByTagListAndCloudTypeList(hostTagsList,cloudTagsList);
}
// mObjectInfoReq.setMoHostIp();
}
return null;
}
@RequestMapping(value = "/add", method = RequestMethod.POST)
public BaseResponse addMObject(@RequestBody MObjectInfoReq request) {
... ...
... ... @@ -18,6 +18,8 @@ public class TypeInfo implements Serializable{
private int typeParentId;
private String cloudTags;//云标签
private String tags;//主机标签
private String descr;//节点的特殊信息
... ...