package org.safehaus.subutai.core.registry.rest;


import javax.ws.rs.DELETE;
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 javax.ws.rs.core.Response;


public interface RestService {

    @GET
    @Path("templates/{templateName}")
    @Produces({ MediaType.APPLICATION_JSON })
    public String getTemplate( @PathParam("templateName") String templateName );

    @POST
    @Path("templates")
    public Response registerTemplate( @QueryParam("config") String configFilePath,
                                      @QueryParam("packages") String packagesFilePath,
                                      @QueryParam("md5sum") String md5sum );

    @DELETE
    @Path("templates/{templateName}")
    public Response unregisterTemplate( @PathParam("templateName") String templateName );

    @GET
    @Path("templates/{templateName}/{lxcArch}")
    @Produces({ MediaType.APPLICATION_JSON })
    public String getTemplate( @PathParam("templateName") String templateName, @PathParam("lxcArch") String lxcArch );

    @GET
    @Path("templates/{childTemplateName}/parent")
    @Produces({ MediaType.APPLICATION_JSON })
    public String getParentTemplate( @PathParam("childTemplateName") String childTemplateName );

    @GET
    @Path("templates/{childTemplateName}/{lxcArch}/parent")
    @Produces({ MediaType.APPLICATION_JSON })
    public String getParentTemplate( @PathParam("childTemplateName") String childTemplateName,
                                     @PathParam("lxcArch") String lxcArch );

    @GET
    @Path("templates/{childTemplateName}/parents")
    @Produces({ MediaType.APPLICATION_JSON })
    public String getParentTemplates( @PathParam("childTemplateName") String childTemplateName );

    @GET
    @Path("templates/{childTemplateName}/{lxcArch}/parents")
    @Produces({ MediaType.APPLICATION_JSON })
    public String getParentTemplates( @PathParam("childTemplateName") String childTemplateName,
                                      @PathParam("lxcArch") String lxcArch );

    @GET
    @Path("templates/{parentTemplateName}/children")
    @Produces({ MediaType.APPLICATION_JSON })
    public String getChildTemplates( @PathParam("parentTemplateName") String parentTemplateName );

    @GET
    @Path("templates/{parentTemplateName}/{lxcArch}/children")
    @Produces({ MediaType.APPLICATION_JSON })
    public String getChildTemplates( @PathParam("parentTemplateName") String parentTemplateName,
                                     @PathParam("lxcArch") String lxcArch );

    @GET
    @Path("templates/tree")
    @Produces({ MediaType.APPLICATION_JSON })
    public String getTemplateTree();

    @GET
    @Path("templates/{templateName}/is-used-on-fai")
    @Produces({ MediaType.APPLICATION_JSON })
    public String isTemplateInUse( @PathParam("templateName") String templateName );

    @PUT
    @Path("templates/{templateName}/fai/{faiHostname}/is-used/{isInUse}")
    @Produces({ MediaType.APPLICATION_JSON })
    public Response setTemplateInUse( @PathParam("faiHostname") String faiHostname,
                                      @PathParam("templateName") String templateName,
                                      @PathParam("isInUse") String isInUse );

    @GET
    @Path("templates")
    @Produces({ MediaType.APPLICATION_JSON })
    public String listTemplates();


    @GET
    @Path("templates/{lxcArch}")
    @Produces({ MediaType.APPLICATION_JSON })
    public String listTemplates( @PathParam("lxcArch") String lxcArch );


    @GET
    @Path("templates/plain-list")
    @Produces({ MediaType.TEXT_PLAIN })
    public String listTemplatesPlain();

    @GET
    @Path("templates/{lxcArch}/plain-list")
    @Produces({ MediaType.TEXT_PLAIN })
    public String listTemplatesPlain( @PathParam("lxcArch") String lxcArch );
}
@@ -996,32 +996,37 @@
 /%7BtemplateName%7D/
+arch/
 %7BlxcArch%7D%22)%0A    
@@ -1013,32 +1013,32 @@
 rch/%7BlxcArch%7D%22)%0A
-
     @Produces(%7B 
@@ -1432,32 +1432,37 @@
 ldTemplateName%7D/
+arch/
 %7BlxcArch%7D/parent
@@ -1930,32 +1930,37 @@
 ldTemplateName%7D/
+arch/
 %7BlxcArch%7D/parent
@@ -2443,16 +2443,21 @@
 teName%7D/
+arch/
 %7BlxcArch
@@ -3520,32 +3520,37 @@
 Path(%22templates/
+arch/
 %7BlxcArch%7D%22)%0A    
@@ -3791,32 +3791,32 @@
 in();%0A%0A    @GET%0A
-
     @Path(%22templ
@@ -3820,16 +3820,21 @@
 mplates/
+arch/
 %7BlxcArch

Fix REST of Registry