pod query param

This commit is contained in:
jiangzhongxiang 2019-05-24 18:08:31 +08:00
parent c7d7875705
commit 30b86c5d11
2 changed files with 37 additions and 6 deletions

View File

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

View File

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