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
|
@GET
|
||||||
@RolesAllowed("ROOT")
|
@RolesAllowed("ROOT")
|
||||||
@Path("/{id}/container-admin-lookup")
|
@Path("/{id}/container-admin")
|
||||||
public Response getStatusContainer(@PathParam("id") Long jiId,
|
public Response getStatusContainer(@PathParam("id") Long jiId,
|
||||||
@QueryParam("userId") Long userId) {
|
@QueryParam("instId") Long instId) {
|
||||||
return Response.ok(jiService.getStatusContainer(jiId, userId)).build();
|
// TODO : add securtiy if needed ?
|
||||||
|
return Response.ok(jiService.getStatusContainerInst(jiId, instId)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
|
|||||||
@ -47,8 +47,12 @@ public class JiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Ji getJi(Long id) { return jiRepository.findById(id); }
|
public Ji getJi(Long id) { return jiRepository.findById(id); }
|
||||||
public Long getJiSiteId(Long id) { return jiRepository.findById(id).site.id; }
|
public Long getJiSiteId(Long id) {
|
||||||
public List<Instance> getAllInstancesJi(Long jiId) { return jiRepository.findById(jiId).instances; }
|
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 "Not created";
|
||||||
return retour;
|
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) {
|
public String getStatusContainers(Long jiId) {
|
||||||
Ji ji = jiRepository.findById(jiId);
|
Ji ji = jiRepository.findById(jiId);
|
||||||
String retour = "";
|
String retour = "";
|
||||||
@ -164,7 +180,7 @@ public class JiService {
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/// Last but not least, be able do delete every container and instance
|
/// Last but not least, be able do delete every container and instance
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteContainer(Long instanceId) {
|
public void deleteContainer(Long instanceId) {
|
||||||
instanceService.deleteContainer(instanceId);
|
instanceService.deleteContainer(instanceId);
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit a24db1f53f2ebf96aa3ca679a3e2364feabb3527
|
Subproject commit 014a476177062cbf8582033e84714b3adce2d517
|
||||||
Loading…
x
Reference in New Issue
Block a user