|
|
package com.monitor.other.worksystem.ctrl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.model.DockerJenkinsRecord;
|
|
|
import com.model.DockerProjectModel;
|
|
|
import com.monitor.model.request.DockerJenkinsReq;
|
|
|
import com.monitor.model.response.BaseResponse;
|
...
|
...
|
@@ -48,7 +49,8 @@ public class DockerProjectCtrl { |
|
|
idList.add(Integer.parseInt(id.trim()));
|
|
|
}
|
|
|
}
|
|
|
return new BaseResponse<>(dockerProjectService.selectByIdList(idList));
|
|
|
List<DockerProjectModel> models= dockerProjectService.selectByIdList(idList);
|
|
|
return new BaseResponse<>(models);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -84,24 +86,33 @@ public class DockerProjectCtrl { |
|
|
*/
|
|
|
@RequestMapping("/queryJenkinsStatus")
|
|
|
@ResponseBody
|
|
|
public BaseResponse queryJenkinsStatus(String ticketID,String jobID,String status) {
|
|
|
dockerProjectService.jenkinsStatusUpdate(ticketID,jobID,status);
|
|
|
public BaseResponse queryJenkinsStatus(String id) {
|
|
|
DockerJenkinsRecord record=dockerProjectService.queryJenkinsById(id);
|
|
|
BaseResponse rnt=new BaseResponse();
|
|
|
if (record==null){
|
|
|
rnt.setCode(201);
|
|
|
rnt.setMessage("找不到Jenkins要更新的记录");
|
|
|
}else{
|
|
|
rnt.setMessage("Jenkins更新jobid:"+record.getJenkinsJobId());
|
|
|
rnt.setData(record.getJenkinsBuildStatus()==null?"":record.getJenkinsBuildStatus());
|
|
|
}
|
|
|
|
|
|
return rnt;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 发布docker服务
|
|
|
*/
|
|
|
@RequestMapping("/deployMirror")
|
|
|
@ResponseBody
|
|
|
public BaseResponse deployMirror() {
|
|
|
public BaseResponse deployMirror(@RequestBody DockerJenkinsReq dockerJenkinsReq) {
|
|
|
BaseResponse rtn=new BaseResponse();
|
|
|
|
|
|
String clusterId="cls-ro6kl3cp";
|
|
|
String namespace="";
|
|
|
String serviceName="node-yohoblk-wap";
|
|
|
String clusterId=dockerJenkinsReq.getClusterId();
|
|
|
String namespace=dockerJenkinsReq.getNamespace()==null?"":dockerJenkinsReq.getNamespace();
|
|
|
String serviceName=dockerJenkinsReq.getServiceName();
|
|
|
if(!dockerServerDeployService.checkAppIsExist(clusterId,namespace,serviceName)){
|
|
|
rtn.setCode(201);
|
|
|
rtn.setMessage("Docker服务不存在,请联系运维人员");
|
...
|
...
|
@@ -139,4 +150,19 @@ public class DockerProjectCtrl { |
|
|
return rtn;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 发布docker服务
|
|
|
*/
|
|
|
@RequestMapping("/queryDockerServerStatus")
|
|
|
@ResponseBody
|
|
|
public BaseResponse queryDockerServerStatus(@RequestBody DockerJenkinsReq dockerJenkinsReq) {
|
|
|
BaseResponse rtn=new BaseResponse();
|
|
|
String clusterId=dockerJenkinsReq.getClusterId();
|
|
|
String namespace=dockerJenkinsReq.getNamespace()==null?"":dockerJenkinsReq.getNamespace();
|
|
|
String serviceName=dockerJenkinsReq.getServiceName();
|
|
|
String status=dockerServerDeployService.queryAppStatus(clusterId,namespace,serviceName);
|
|
|
rtn.setData(status);
|
|
|
return rtn;
|
|
|
}
|
|
|
} |
...
|
...
|
|