develop
yuemian 2024-09-04 15:17:53 +08:00
parent 19bd1bc2bc
commit 3be319a59a
4 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -41,6 +41,7 @@ public class TianyiPhysicalProvider extends TianyiProvider {
if (!CollectionUtils.isEmpty(zoneList)) {
List<JSONObject> 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());

View File

@ -10,6 +10,7 @@ public interface PhysicalServerService {
GeneralResult<GridBean<PhysicalServer>> list(Pager pager, RequestContext context);
GeneralResult listAll();
GeneralResult<PhysicalServer> detail(Long id);

View File

@ -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<PhysicalServer> detail(Long id) {
try {