RESTCONF RFC8040 Notifications support for application/yang-data+xml 04/89704/4
authorLukas Baca <lbaca@luminanetworks.com>
Tue, 12 May 2020 14:43:31 +0000 (16:43 +0200)
committerTomas Cere <tomas.cere@pantheon.tech>
Thu, 4 Jun 2020 13:04:21 +0000 (13:04 +0000)
In "https://tools.ietf.org/html/rfc8040" have GET,PUT,POST,PATCH
possibility to use Accept: application/yang-data+xml

JIRA: NETCONF-684
Change-Id: I25c165b7c2672f7ad7bacbd95c4c5a9634b69122
Signed-off-by: Lukas Baca <lbaca@luminanetworks.com>
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/api/RestconfDataService.java

index 1c5b17c0b8071d9d3dfe6ed2d7b570a4cd7d0a74..f655a58f1b81d4379a5698cecde25411d5bbc10e 100644 (file)
@@ -46,8 +46,8 @@ public interface RestconfDataService extends UpdateHandlers {
      */
     @GET
     @Path("/data/{identifier:.+}")
-    @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
-            MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+    @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA + RestconfConstants.XML,
+            Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
     Response readData(@Encoded @PathParam("identifier") String identifier, @Context UriInfo uriInfo);
 
     /**
@@ -59,8 +59,8 @@ public interface RestconfDataService extends UpdateHandlers {
      */
     @GET
     @Path("/data")
-    @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
-            MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+    @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA + RestconfConstants.XML,
+            Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
     Response readData(@Context UriInfo uriInfo);
 
     /**
@@ -74,8 +74,8 @@ public interface RestconfDataService extends UpdateHandlers {
      */
     @PUT
     @Path("/data/{identifier:.+}")
-    @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
-            MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+    @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA + RestconfConstants.XML,
+            Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
     Response putData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload,
             @Context UriInfo uriInfo);
 
@@ -92,8 +92,8 @@ public interface RestconfDataService extends UpdateHandlers {
      */
     @POST
     @Path("/data/{identifier:.+}")
-    @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
-            MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+    @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA + RestconfConstants.XML,
+            Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
     Response postData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload,
             @Context UriInfo uriInfo);
 
@@ -108,8 +108,8 @@ public interface RestconfDataService extends UpdateHandlers {
      */
     @POST
     @Path("/data")
-    @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
-            MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+    @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA + RestconfConstants.XML,
+            Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
     Response postData(NormalizedNodeContext payload, @Context UriInfo uriInfo);
 
     /**
@@ -173,8 +173,8 @@ public interface RestconfDataService extends UpdateHandlers {
      */
     @Patch
     @Path("/data/{identifier:.+}")
-    @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
-            MediaType.APPLICATION_XML, MediaType.TEXT_XML })
+    @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA + RestconfConstants.XML,
+            Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
     Response patchData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload,
                        @Context UriInfo uriInfo);
 }