diff --git a/src/main/java/cactusServer/resources/InstancesRest.java b/src/main/java/cactusServer/resources/InstancesRest.java index fc9c3b7..ddafdb1 100644 --- a/src/main/java/cactusServer/resources/InstancesRest.java +++ b/src/main/java/cactusServer/resources/InstancesRest.java @@ -1,10 +1,17 @@ package cactusServer.resources; +import javax.ws.rs.FormParam; import javax.ws.rs.GET; +import javax.ws.rs.PUT; import javax.ws.rs.Path; +import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import cactusServer.entities.Instance; +import cactusServer.models.Instances; + + @Path("instances") public class InstancesRest { public InstancesRest() { @@ -18,15 +25,17 @@ return "deploy jenkins from tomcat"; } - + @Path("/{instanceId}") + @GET + @Produces(MediaType.APPLICATION_JSON) + public Instance getInstance(@PathParam("instanceId") String instanceId) { + return Instances.getInstance().getInstance(instanceId); + } - -// @Path("/{instanceId}") -// @GET -// @Produces(MediaType.APPLICATION_JSON) -// public Instance getInstance(@PathParam("instanceId") String instanceId) { -// //return Instances.ge +// @Path("/{instanceID}") +// @PUT +// public Instance putInstance(@PathParam("InstanceId") String instanceId, @FormParam("areaId") int areaId, +// @FormParam("objectId") int objectId, @FormParam("characterId") String characterId) { +// // } - - }