created new endpoint to fetch an instances owner
This commit is contained in:
parent
68b50d63ff
commit
07f133d9db
@ -112,6 +112,15 @@ public class InstanceEndpoints {
|
||||
return Response.ok(jiService.getStatusContainerInst(jiId, instId)).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@RolesAllowed("ROOT")
|
||||
@Path("/{id}/instance-owner")
|
||||
public Response getOwnerInstance(@PathParam("id") Long jiId,
|
||||
@QueryParam("instId") Long instId) {
|
||||
// TODO : add securtiy if needed ?
|
||||
return Response.ok(jiService.getOwnerInst(jiId, instId)).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Authenticated
|
||||
@Path("/{id}/container")
|
||||
|
||||
@ -144,6 +144,12 @@ public class JiService {
|
||||
return "Not created";
|
||||
return retour;
|
||||
}
|
||||
|
||||
public String getOwnerInst(Long jiId, Long instId) {
|
||||
Instance instance = instanceService.getInstance(instId);
|
||||
return instance.owner.name;
|
||||
}
|
||||
|
||||
public String getStatusContainers(Long jiId) {
|
||||
Ji ji = jiRepository.findById(jiId);
|
||||
String retour = "";
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 014a476177062cbf8582033e84714b3adce2d517
|
||||
Subproject commit e0b950f1c4bccbc6fcfbda072e00a430c081338e
|
||||
Loading…
x
Reference in New Issue
Block a user