51 lines
1.9 KiB
Java
51 lines
1.9 KiB
Java
|
|
package com.unisinsight.project.feign;
|
||
|
|
|
||
|
|
import com.unisinsight.project.config.FeignConfig;
|
||
|
|
import com.unisinsight.project.entity.dto.ApiResponse;
|
||
|
|
import com.unisinsight.project.entity.req.NetworkManageReq;
|
||
|
|
import com.unisinsight.project.entity.req.StoragePoolReq;
|
||
|
|
import org.springframework.cloud.openfeign.FeignClient;
|
||
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
||
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 第三方API客户端
|
||
|
|
*/
|
||
|
|
@FeignClient(
|
||
|
|
name = "external-api-client",
|
||
|
|
url = "${external.api.url:http://10.100.51.118:8000}",
|
||
|
|
configuration = FeignConfig.class
|
||
|
|
)
|
||
|
|
public interface ExternalApiClient {
|
||
|
|
|
||
|
|
@PostMapping("/api/v1/network/create")
|
||
|
|
ApiResponse createNetwork(@RequestBody NetworkManageReq networkManageReq);
|
||
|
|
|
||
|
|
@DeleteMapping("/api/v1/network/{network_name}")
|
||
|
|
ApiResponse deleteNetwork(@PathVariable("network_name") String networkName);
|
||
|
|
|
||
|
|
@PostMapping("/api/v1/network/update")
|
||
|
|
ApiResponse updateNetwork(@RequestBody NetworkManageReq networkManageReq);
|
||
|
|
|
||
|
|
@PostMapping("/api/v1/network/start")
|
||
|
|
ApiResponse startNetwork(@RequestBody NetworkManageReq networkManageReq);
|
||
|
|
|
||
|
|
@PostMapping("/api/v1/network/stop")
|
||
|
|
ApiResponse stopNetwork(@RequestBody NetworkManageReq networkManageReq);
|
||
|
|
|
||
|
|
@PostMapping("/api/v1/storage/pools")
|
||
|
|
ApiResponse createStorage(@RequestBody StoragePoolReq storagePoolReq);
|
||
|
|
|
||
|
|
@PostMapping("/api/v1/storage/pools/start")
|
||
|
|
ApiResponse startStorage(@RequestBody StoragePoolReq storagePoolReq);
|
||
|
|
|
||
|
|
@PostMapping("/api/v1/storage/pools/stop")
|
||
|
|
ApiResponse stopStorage(@RequestBody StoragePoolReq storagePoolReq);
|
||
|
|
|
||
|
|
@DeleteMapping("/api/v1/storage/pools/{pool_name}")
|
||
|
|
ApiResponse deleteStorage(@PathVariable("pool_name") String poolName);
|
||
|
|
|
||
|
|
}
|