created new endpoint to fetch an instances owner

This commit is contained in:
Arthur Wambst 2025-10-20 20:35:28 +02:00
parent 68b50d63ff
commit 07f133d9db
No known key found for this signature in database
3 changed files with 16 additions and 1 deletions

View File

@ -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")

View File

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