fix: api fixes on admin container status get
This commit is contained in:
parent
aac2a1ffc7
commit
68b50d63ff
@ -105,10 +105,11 @@ public class InstanceEndpoints {
|
||||
|
||||
@GET
|
||||
@RolesAllowed("ROOT")
|
||||
@Path("/{id}/container-admin-lookup")
|
||||
@Path("/{id}/container-admin")
|
||||
public Response getStatusContainer(@PathParam("id") Long jiId,
|
||||
@QueryParam("userId") Long userId) {
|
||||
return Response.ok(jiService.getStatusContainer(jiId, userId)).build();
|
||||
@QueryParam("instId") Long instId) {
|
||||
// TODO : add securtiy if needed ?
|
||||
return Response.ok(jiService.getStatusContainerInst(jiId, instId)).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
|
||||
@ -47,8 +47,12 @@ public class JiService {
|
||||
}
|
||||
|
||||
public Ji getJi(Long id) { return jiRepository.findById(id); }
|
||||
public Long getJiSiteId(Long id) { return jiRepository.findById(id).site.id; }
|
||||
public List<Instance> getAllInstancesJi(Long jiId) { return jiRepository.findById(jiId).instances; }
|
||||
public Long getJiSiteId(Long id) {
|
||||
return jiRepository.findById(id).site.id;
|
||||
}
|
||||
public List<Instance> getAllInstancesJi(Long jiId) {
|
||||
return jiRepository.findById(jiId).instances;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -127,7 +131,19 @@ public class JiService {
|
||||
return "Not created";
|
||||
return retour;
|
||||
}
|
||||
|
||||
public String getStatusContainerInst(Long jiId, Long instId) {
|
||||
Ji ji = jiRepository.findById(jiId);
|
||||
Instance instance = instanceService.getInstance(instId);
|
||||
String retour = "";
|
||||
if (instance.containerId.equals("Not created"))
|
||||
return "Not created";
|
||||
retour = instanceService.getStatusContainer(instance.id)
|
||||
.toString()
|
||||
.replaceAll(".*status=([^,]+).*", "$1");
|
||||
if (retour == "")
|
||||
return "Not created";
|
||||
return retour;
|
||||
}
|
||||
public String getStatusContainers(Long jiId) {
|
||||
Ji ji = jiRepository.findById(jiId);
|
||||
String retour = "";
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit a24db1f53f2ebf96aa3ca679a3e2364feabb3527
|
||||
Subproject commit 014a476177062cbf8582033e84714b3adce2d517
|
||||
Loading…
x
Reference in New Issue
Block a user