pod query param
This commit is contained in:
parent
c7d7875705
commit
30b86c5d11
|
@ -7,6 +7,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
@ -14,9 +15,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.educoder.bridge.common.constant.ApiResultCodeCsts;
|
||||
import com.educoder.bridge.common.model.ApiResult;
|
||||
import com.educoder.bridge.game.service.K8sService;
|
||||
import com.educoder.bridge.k8s.model.NodeQueryParam;
|
||||
import com.educoder.bridge.k8s.model.BridgePod;
|
||||
import com.educoder.bridge.k8s.model.PodQueryParam;
|
||||
|
||||
import io.fabric8.kubernetes.api.model.Node;
|
||||
import io.fabric8.kubernetes.api.model.Pod;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -40,11 +41,10 @@ public class PodController {
|
|||
*/
|
||||
@RequestMapping(path = "", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "获取Pod列表", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
||||
public ApiResult<List<Pod>> getPods() throws Exception {
|
||||
logger.info("获取Node列表");
|
||||
|
||||
ApiResult<List<Pod>> result = new ApiResult<>();
|
||||
public ApiResult<List<BridgePod>> getPods(@RequestBody(required = false) PodQueryParam param) throws Exception {
|
||||
logger.info("获取Pod列表");
|
||||
|
||||
ApiResult<List<BridgePod>> result = new ApiResult<>();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.educoder.bridge.k8s.model;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@ApiModel(value = "pod查询参数", description = "pod查询参数")
|
||||
public class PodQueryParam {
|
||||
|
||||
@ApiModelProperty(value = "pod name")
|
||||
private String name;
|
||||
private Map<String, String> labels;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Map<String, String> getLabels() {
|
||||
return labels;
|
||||
}
|
||||
|
||||
public void setLabels(Map<String, String> labels) {
|
||||
this.labels = labels;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue