2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.restconf.restful.services.api;
10 import javax.ws.rs.Consumes;
11 import javax.ws.rs.DELETE;
12 import javax.ws.rs.Encoded;
13 import javax.ws.rs.GET;
14 import javax.ws.rs.POST;
15 import javax.ws.rs.PUT;
16 import javax.ws.rs.Path;
17 import javax.ws.rs.PathParam;
18 import javax.ws.rs.Produces;
19 import javax.ws.rs.core.Context;
20 import javax.ws.rs.core.MediaType;
21 import javax.ws.rs.core.Response;
22 import javax.ws.rs.core.UriInfo;
23 import org.opendaylight.restconf.Rfc8040;
24 import org.opendaylight.restconf.common.context.NormalizedNodeContext;
25 import org.opendaylight.restconf.common.patch.Patch;
26 import org.opendaylight.restconf.common.patch.PatchContext;
27 import org.opendaylight.restconf.common.patch.PatchStatusContext;
28 import org.opendaylight.restconf.utils.RestconfConstants;
31 * The "{+restconf}/data" subtree represents the datastore resource type, which is a collection of
32 * configuration data and state data nodes.
34 * @deprecated move to splitted module restconf-nb-rfc8040
37 public interface RestconfDataService {
40 * Get target data resource.
46 * @return {@link NormalizedNodeContext}
49 @Path("/data/{identifier:.+}")
50 @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
51 MediaType.APPLICATION_XML, MediaType.TEXT_XML })
52 Response readData(@Encoded @PathParam("identifier") String identifier, @Context UriInfo uriInfo);
55 * Get target data resource from data root.
59 * @return {@link NormalizedNodeContext}
63 @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
64 MediaType.APPLICATION_XML, MediaType.TEXT_XML })
65 Response readData(@Context UriInfo uriInfo);
68 * Create or replace the target data resource.
73 * data node for put to config DS
74 * @return {@link Response}
77 @Path("/data/{identifier:.+}")
78 @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
79 MediaType.APPLICATION_XML, MediaType.TEXT_XML })
80 Response putData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload,
81 @Context UriInfo uriInfo);
84 * Create a data resource in target.
92 * @return {@link Response}
95 @Path("/data/{identifier:.+}")
96 @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
97 MediaType.APPLICATION_XML, MediaType.TEXT_XML })
98 Response postData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload,
99 @Context UriInfo uriInfo);
102 * Create a data resource.
108 * @return {@link Response}
112 @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
113 MediaType.APPLICATION_XML, MediaType.TEXT_XML })
114 Response postData(NormalizedNodeContext payload, @Context UriInfo uriInfo);
117 * Delete the target data resource.
121 * @return {@link Response}
124 @Path("/data/{identifier:.+}")
125 Response deleteData(@Encoded @PathParam("identifier") String identifier);
128 * Ordered list of edits that are applied to the target datastore by the
137 * @return {@link PatchStatusContext}
140 @Path("/data/{identifier:.+}")
141 @Consumes({ Rfc8040.MediaTypes.PATCH + RestconfConstants.JSON, Rfc8040.MediaTypes.PATCH + RestconfConstants.XML })
142 @Produces({ Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
143 Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
144 PatchStatusContext patchData(@Encoded @PathParam("identifier") String identifier, PatchContext context,
145 @Context UriInfo uriInfo);
148 * Ordered list of edits that are applied to the datastore by the server.
154 * @return {@link PatchStatusContext}
158 @Consumes({ Rfc8040.MediaTypes.PATCH + RestconfConstants.JSON, Rfc8040.MediaTypes.PATCH + RestconfConstants.XML })
159 @Produces({ Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.JSON,
160 Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.XML })
161 PatchStatusContext patchData(PatchContext context, @Context UriInfo uriInfo);