X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frest%2Fapi%2FRestconfService.java;h=37e9b6d0b3c10227896c01edf4d86f6bf3fa2598;hb=abf2977f78315abecb4f643e96cb091010ea3c20;hp=4d9b198795f093c53834f6977447191f2b122136;hpb=1ee71ae58a03de1c1f8fd8c789e7921508ba9f59;p=controller.git
diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/api/RestconfService.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/api/RestconfService.java
index 4d9b198795..37e9b6d0b3 100644
--- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/api/RestconfService.java
+++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/api/RestconfService.java
@@ -10,42 +10,44 @@ package org.opendaylight.controller.sal.rest.api;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
+import javax.ws.rs.Encoded;
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.Encoded;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
-
+import org.opendaylight.controller.sal.restconf.impl.NormalizedNodeContext;
import org.opendaylight.controller.sal.restconf.impl.StructuredData;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;
+import org.opendaylight.yangtools.yang.data.api.Node;
+
/**
- * The URI hierarchy for the RESTCONF resources consists of an entry
- * point container, 4 top-level resources, and 1 field.
- *
- * - /restconf - {@link #getRoot()}
- *
+ * The URI hierarchy for the RESTCONF resources consists of an entry point container, 4 top-level resources, and 1
+ * field.
+ *
+ * - /restconf - {@link #getRoot()}
+ *
* - /config - {@link #readConfigurationData(String)}
* {@link #updateConfigurationData(String, CompositeNode)}
* {@link #createConfigurationData(CompositeNode)}
* {@link #createConfigurationData(String, CompositeNode)}
- * {@link #deleteConfigurationData(String)}
- *
- /operational - {@link #readOperationalData(String)}
- *
- /modules - {@link #getModules()}
- *
+ * {@link #deleteConfigurationData(String)}
+ *
- /operational - {@link #readOperationalData(String)}
+ *
- /modules - {@link #getModules()}
+ *
*
- /operations - {@link #invokeRpc(String, CompositeNode)}
* {@link #invokeRpc(String, CompositeNode)}
- *
- /version (field)
- *
- *
+ * - /version (field)
+ *
+ *
*/
@Path("/")
public interface RestconfService {
@@ -58,80 +60,84 @@ public interface RestconfService {
@GET
@Path("/modules")
- @Produces({Draft02.MediaTypes.API+XML, Draft02.MediaTypes.API+JSON,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData getModules();
+ @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public NormalizedNodeContext getModules(@Context UriInfo uriInfo);
@GET
@Path("/modules/{identifier:.+}")
- @Produces({Draft02.MediaTypes.API+XML, Draft02.MediaTypes.API+JSON,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData getModules(@PathParam("identifier") String identifier);
+ @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public NormalizedNodeContext getModules(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
@GET
@Path("/modules/module/{identifier:.+}")
- @Produces({Draft02.MediaTypes.API+XML, Draft02.MediaTypes.API+JSON,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData getModule(@PathParam("identifier") String identifier);
+ @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public NormalizedNodeContext getModule(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
@GET
@Path("/operations")
- @Produces({Draft02.MediaTypes.API+XML, Draft02.MediaTypes.API+JSON,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData getOperations();
+ @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public StructuredData getOperations(@Context UriInfo uriInfo);
@GET
@Path("/operations/{identifier:.+}")
- @Produces({Draft02.MediaTypes.API+XML, Draft02.MediaTypes.API+JSON,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData getOperations(@PathParam("identifier") String identifier);
+ @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public NormalizedNodeContext getOperations(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
@POST
@Path("/operations/{identifier:.+}")
- @Produces({Draft02.MediaTypes.OPERATION+JSON, Draft02.MediaTypes.OPERATION+XML,
- Draft02.MediaTypes.DATA+JSON, Draft02.MediaTypes.DATA+XML,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- @Consumes({Draft02.MediaTypes.OPERATION+JSON, Draft02.MediaTypes.OPERATION+XML,
- Draft02.MediaTypes.DATA+JSON, Draft02.MediaTypes.DATA+XML,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData invokeRpc(@Encoded @PathParam("identifier") String identifier, CompositeNode payload);
+ @Produces({ Draft02.MediaTypes.OPERATION + JSON, Draft02.MediaTypes.OPERATION + XML,
+ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ @Consumes({ Draft02.MediaTypes.OPERATION + JSON, Draft02.MediaTypes.OPERATION + XML,
+ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public StructuredData invokeRpc(@Encoded @PathParam("identifier") String identifier, CompositeNode payload,
+ @Context UriInfo uriInfo);
@POST
@Path("/operations/{identifier:.+}")
- @Produces({Draft02.MediaTypes.OPERATION+JSON, Draft02.MediaTypes.OPERATION+XML,
- Draft02.MediaTypes.DATA+JSON, Draft02.MediaTypes.DATA+XML,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData invokeRpc(@Encoded @PathParam("identifier") String identifier, @DefaultValue("") String noPayload);
+ @Produces({ Draft02.MediaTypes.OPERATION + JSON, Draft02.MediaTypes.OPERATION + XML,
+ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public StructuredData invokeRpc(@Encoded @PathParam("identifier") String identifier,
+ @DefaultValue("") String noPayload, @Context UriInfo uriInfo);
@GET
@Path("/config/{identifier:.+}")
- @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData readConfigurationData(@Encoded @PathParam("identifier") String identifier);
+ @Produces({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public NormalizedNodeContext readConfigurationData(@Encoded @PathParam("identifier") String identifier,
+ @Context UriInfo uriInfo);
@GET
@Path("/operational/{identifier:.+}")
- @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData readOperationalData(@Encoded @PathParam("identifier") String identifier);
+ @Produces({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public NormalizedNodeContext readOperationalData(@Encoded @PathParam("identifier") String identifier,
+ @Context UriInfo uriInfo);
@PUT
@Path("/config/{identifier:.+}")
- @Consumes({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public Response updateConfigurationData(@Encoded @PathParam("identifier") String identifier, CompositeNode payload);
+ @Consumes({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public Response updateConfigurationData(@Encoded @PathParam("identifier") String identifier, Node> payload);
@POST
@Path("/config/{identifier:.+}")
- @Consumes({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public Response createConfigurationData(@Encoded @PathParam("identifier") String identifier, CompositeNode payload);
+ @Consumes({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public Response createConfigurationData(@Encoded @PathParam("identifier") String identifier, Node> payload);
@POST
@Path("/config")
- @Consumes({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public Response createConfigurationData(CompositeNode payload);
+ @Consumes({ Draft02.MediaTypes.DATA + JSON, Draft02.MediaTypes.DATA + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public Response createConfigurationData(Node> payload);
@DELETE
@Path("/config/{identifier:.+}")
@@ -143,9 +149,8 @@ public interface RestconfService {
@GET
@Path("/streams")
- @Produces({Draft02.MediaTypes.API+XML, Draft02.MediaTypes.API+JSON,
- MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
- public StructuredData getAvailableStreams();
-
+ @Produces({ Draft02.MediaTypes.API + JSON, Draft02.MediaTypes.API + XML, MediaType.APPLICATION_JSON,
+ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+ public NormalizedNodeContext getAvailableStreams(@Context UriInfo uriInfo);
}