|
@@ -277,6 +277,44 @@ public class MObjectInfoCtrl { |
|
@@ -277,6 +277,44 @@ public class MObjectInfoCtrl { |
277
|
return modelList;
|
277
|
return modelList;
|
278
|
}
|
278
|
}
|
279
|
|
279
|
|
|
|
280
|
+ @RequestMapping(value = "/asyMobjectHost")
|
|
|
281
|
+ public BaseResponse asyMobjectHost(int moTypeId) {
|
|
|
282
|
+ TypeInfo typeInfo=typeInfoService.queryTypeInfo(moTypeId);
|
|
|
283
|
+ if(typeInfo!=null&&StringUtils.isNotBlank(typeInfo.getTags())){
|
|
|
284
|
+ MObjectInfoReq mObjectInfoReq = new MObjectInfoReq();
|
|
|
285
|
+ mObjectInfoReq.setTypeIds(""+typeInfo.getTypeId());
|
|
|
286
|
+ mObjectInfoReq.setMoTags(typeInfo.getDescr());
|
|
|
287
|
+ //根据typeinfo的主机标签查询出主机
|
|
|
288
|
+ List<String> hostTagsList=new ArrayList<String>();
|
|
|
289
|
+ List<Integer> cloudTagsList=new ArrayList<Integer>();
|
|
|
290
|
+ if(StringUtils.isNotBlank(typeInfo.getCloudTags())){
|
|
|
291
|
+ for(String cloudTag:typeInfo.getCloudTags().split(",")){
|
|
|
292
|
+ if("1".equalsIgnoreCase(cloudTag)){
|
|
|
293
|
+ cloudTagsList.add(1);
|
|
|
294
|
+ }else if("2".equalsIgnoreCase(cloudTag)){
|
|
|
295
|
+ cloudTagsList.add(2);
|
|
|
296
|
+ }else if("3".equalsIgnoreCase(cloudTag)){
|
|
|
297
|
+ cloudTagsList.add(3);
|
|
|
298
|
+ }else if("0".equalsIgnoreCase(cloudTag)){
|
|
|
299
|
+ cloudTagsList=new ArrayList<Integer>(); //全部云
|
|
|
300
|
+ break;
|
|
|
301
|
+ }
|
|
|
302
|
+ }
|
|
|
303
|
+ }
|
|
|
304
|
+ for(String hostTag:typeInfo.getTags().split(",")){
|
|
|
305
|
+ if(StringUtils.isNotBlank(hostTag)){
|
|
|
306
|
+ hostTagsList.add(hostTag);
|
|
|
307
|
+ }
|
|
|
308
|
+ }
|
|
|
309
|
+ if(hostTagsList.size()>0){
|
|
|
310
|
+ //List<HostInfo> newhostInfos =hostInfoMapper.selectHostInfosByTagListAndCloudTypeList(hostTagsList,cloudTagsList);
|
|
|
311
|
+
|
|
|
312
|
+ }
|
|
|
313
|
+ // mObjectInfoReq.setMoHostIp();
|
|
|
314
|
+ }
|
|
|
315
|
+ return null;
|
|
|
316
|
+ }
|
|
|
317
|
+
|
280
|
|
318
|
|
281
|
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
319
|
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
282
|
public BaseResponse addMObject(@RequestBody MObjectInfoReq request) {
|
320
|
public BaseResponse addMObject(@RequestBody MObjectInfoReq request) {
|