Newer
Older
CactusServer / src / main / java / cactusServer / resources / InstancesRest.java
n-fujimoto on 24 May 2018 2 KB 変更なし
package cactusServer.resources;

import java.util.Map;

import javax.ws.rs.DELETE;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import cactusServer.entities.Instance;
import cactusServer.models.Instances;


@Path("/instances")
public class InstancesRest {
	public InstancesRest() {

	}

	/*
	@Path("/test")
	@GET
	@Produces(MediaType.TEXT_PLAIN)
	public String hoge() {
		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("/areas")
//	@GET
//	@Produces(MediaType.APPLICATION_JSON)
//	public Instance getArea(@QueryParam("areaId") String areaId) {
//		return null;	
//	}
	

//	@GET
//	@Path("/characters")
//	@Produces(MediaType.APPLICATION_JSON)
//	public Instance getCharacter(@QueryParam("AccountUniqueId") String AccountUniqueId) {
//		return Instances.getInstance().getCharacter(AccountUniqueId);
//	}
//	
//	
//	@POST
//	@Path("/{createCharacter}")
//	@Produces(MediaType.APPLICATION_JSON)
//	public Instance createCharacter(@QueryParam("characterUniqueId") String characterUniqueId) {
//		return Instances.getInstance().createCharacter(characterUniqueId);
//	}
	


	@POST
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, Instance> create(@FormParam("name") String name) {
		Instance instance = new Instance(name);
		return Instances.getInstance().createInstance(instance);
	}
	
	

	/*
	@DELETE
	@Path("/destroyInstance")
	@Produces(MediaType.APPLICATION_JSON)
	public Instance destroy(@QueryParam("instanceId") String instanceId) {
		return Instances.getInstance().destroyInstance(instanceId);
	}*/

//
//		@Path("/{instanceId}")
//		@PUT
//		public Instance putInstance(@PathParam("InstanceId") String instanceId, @FormParam("areaId") int areaId, 
//				                    @FormParam("objectId") int objectId, @FormParam("characterId") String characterId) {
//			
//		}
	
}