diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/controller/PhysicalServerController.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/controller/PhysicalServerController.java index 8a55b155..4533ad8b 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/controller/PhysicalServerController.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/controller/PhysicalServerController.java @@ -40,6 +40,12 @@ public class PhysicalServerController { return physicalServerService.list(pager, context); } + @Operation(tags = {"CMC", "CSC"}, summary = "获取物理机列表") + @GetMapping(value = "/listAll") + public GeneralResult listAll() { + return physicalServerService.listAll(); + } + @Operation(tags = {"CMC", "CSC"}, summary = "添加物理机") @PostMapping diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/compute/TianyiPhysicalProvider.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/compute/TianyiPhysicalProvider.java index 333787f4..2f486192 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/compute/TianyiPhysicalProvider.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/provider/compute/TianyiPhysicalProvider.java @@ -41,6 +41,7 @@ public class TianyiPhysicalProvider extends TianyiProvider { if (!CollectionUtils.isEmpty(zoneList)) { List results = new ArrayList<>(); for (JSONObject zone : zoneList) { + log.info("zoneName:" + zone.getString("name")); String apiUrl = "/v4/ebm/list"; JSONObject body = new JSONObject(); body.put("regionID", this.getRegionId()); diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/service/PhysicalServerService.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/service/PhysicalServerService.java index b9fbea75..75949a62 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/service/PhysicalServerService.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/service/PhysicalServerService.java @@ -10,6 +10,7 @@ public interface PhysicalServerService { GeneralResult> list(Pager pager, RequestContext context); + GeneralResult listAll(); GeneralResult detail(Long id); diff --git a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/service/impl/PhysicalServerServiceImpl.java b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/service/impl/PhysicalServerServiceImpl.java index 84caf05b..d910f93e 100644 --- a/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/service/impl/PhysicalServerServiceImpl.java +++ b/bocloud.ctstack.plugin/src/main/java/com/bocloud/ctstack/plugin/service/impl/PhysicalServerServiceImpl.java @@ -79,6 +79,14 @@ public class PhysicalServerServiceImpl implements PhysicalServerService { } } + @Override + public GeneralResult listAll() { + CloudVendor vendor = cloudVendorRepository.query(1L); + TianyiPhysicalProvider physicalProvider = new TianyiPhysicalProvider(butlerConfig.regionButler(vendor.getUuid(), "2022guizhou_syj")); + GeneralResult result = physicalProvider.list(); + return null; + } + @Override public GeneralResult detail(Long id) { try {