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=012b51fb5e339b6a0a4332e44d146b72f7e7ee76;hb=a4f760dabea4b4387b9f3f0090e0768432c4a2e5;hp=0f566f5df72e36bd9e401ec8613585cafc460e13;hpb=b5daa3678322a764f9b0e2483f82781f4d39d263;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 0f566f5df7..012b51fb5e 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
@@ -7,14 +7,14 @@
*/
package org.opendaylight.controller.sal.rest.api;
-import static org.opendaylight.controller.sal.restconf.impl.MediaTypes.API;
-
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.core.MediaType;
+import javax.ws.rs.core.Response;
import org.opendaylight.controller.sal.restconf.impl.StructuredData;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;
@@ -25,7 +25,9 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
* Section 5 for details on each URI.
*
* - /restconf - {@link #getRoot()}
- *
- /datastore - {@link #readAllData()}
+ *
- /config
+ *
- /operational - {@link #readAllData()} - Added in Draft02
+ *
- /datastore - {@link #readAllData()}
*
* - /(top-level-data-nodes) (config=true or false)
*
@@ -44,8 +46,8 @@ import org.opendaylight.yangtools.yang.data.api.CompositeNode;
* - /version (field)
*
*/
-@Path("restconf")
-public interface RestconfService {
+@Path("/")
+public interface RestconfService extends RestconfServiceLegacy {
public static final String XML = "+xml";
public static final String JSON = "+json";
@@ -54,32 +56,40 @@ public interface RestconfService {
public Object getRoot();
@GET
- @Path("/datastore")
- @Produces({API+JSON,API+XML})
- public Object readAllData();
+ @Path("/modules")
+ @Produces({Draft01.MediaTypes.API+JSON,Draft01.MediaTypes.API+XML,
+ Draft02.MediaTypes.API+JSON,Draft02.MediaTypes.API+XML})
+ public StructuredData getModules();
+ @POST
+ @Path("/operations/{identifier}")
+ @Produces({Draft01.MediaTypes.DATA+JSON,Draft01.MediaTypes.DATA+XML,
+ Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
+ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
+ public StructuredData invokeRpc(@PathParam("identifier") String identifier, CompositeNode payload);
+
@GET
- @Path("/datastore/{identifier}")
- @Produces({API+JSON,API+XML})
- public StructuredData readData(@PathParam("identifier") String identifier);
+ @Path("/config/{identifier:.+}")
+ @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
+ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
+ public StructuredData readConfigurationData(@PathParam("identifier") String identifier);
+
+ @POST
+ @Path("/config/{identifier:.+}")
+ @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
+ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
+ public Response createConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
@PUT
- @Path("/datastore/{identifier}")
- @Produces({API+JSON,API+XML})
- public Object createConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
-
- @POST
- @Path("/datastore/{identifier}")
- @Produces({API+JSON,API+XML})
- public Object updateConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
+ @Path("/config/{identifier:.+}")
+ @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
+ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
+ public Response updateConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
@GET
- @Path("/modules")
- @Produces({API+JSON,API+XML})
- public Object getModules();
+ @Path("/operational/{identifier:.+}")
+ @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
+ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
+ public StructuredData readOperationalData(@PathParam("identifier") String identifier);
- @POST
- @Path("/operations/{identifier}")
- @Produces({API+JSON,API+XML})
- public StructuredData invokeRpc(@PathParam("identifier") String identifier, CompositeNode payload);
}