Merge "Added flags for flow removed event"
[controller.git] / opendaylight / md-sal / sal-rest-connector / src / main / java / org / opendaylight / controller / sal / rest / api / RestconfService.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.rest.api;
9
10 import static org.opendaylight.controller.sal.restconf.impl.MediaTypes.API;
11
12 import javax.ws.rs.GET;
13 import javax.ws.rs.POST;
14 import javax.ws.rs.PUT;
15 import javax.ws.rs.Path;
16 import javax.ws.rs.PathParam;
17 import javax.ws.rs.Produces;
18 import javax.ws.rs.core.Response;
19
20 import org.opendaylight.controller.sal.restconf.impl.StructuredData;
21 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
22
23 /**
24  *   The URI hierarchy for the RESTCONF resources consists of an entry
25  *   point container, 3 top-level resources, and 1 field.  Refer to
26  *  Section 5 for details on each URI.
27  *    <ul>
28  *    <li><b>/restconf</b> - {@link #getRoot()}
29  *     <ul><li><b>/config</b> 
30  *         <li><b>/operational</b> - {@link #readAllData()} - Added in Draft02
31  *         <li><b>/datastore</b> - {@link #readAllData()}
32  *         <ul>
33  *            <li>/(top-level-data-nodes) (config=true or false)
34  *         </ul>
35  *         <li>/modules
36  *          <ul><li>/module
37  *              <li>/name
38  *              <li>/revision
39  *              <li>/namespace
40  *              <li>/feature
41  *             <li>/deviation
42  *          </ul>
43  *          <li>/operations
44  *          <ul>
45  *             <li>/(custom protocol operations)
46  *          </ul>
47  *         <li>/version (field)
48  *     </ul>
49  */
50 @Path("/")
51 public interface RestconfService extends RestconfServiceLegacy {
52
53     public static final String XML = "+xml";
54     public static final String JSON = "+json";
55
56     @GET
57     public Object getRoot();
58
59     @GET
60     @Path("/modules")
61     @Produces({API+JSON,API+XML})
62     public StructuredData getModules();
63
64     @POST
65     @Path("/operations/{identifier}")
66     @Produces({Draft02.MediaTypes.API+JSON,Draft02.MediaTypes.API+XML,API+JSON,API+XML})
67     public StructuredData invokeRpc(@PathParam("identifier") String identifier, CompositeNode payload);
68     
69     @GET
70     @Path("/config/{identifier:.+}")
71     @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML})
72     public StructuredData readConfigurationData(@PathParam("identifier") String identifier);
73     
74     @PUT
75     @Path("/config/{identifier:.+}")
76     @Produces({API+JSON,API+XML})
77     public Response createConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
78
79     @POST
80     @Path("/config/{identifier:.+}")
81     @Produces({API+JSON,API+XML})
82     public Response updateConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
83
84     @GET
85     @Path("/operational/{identifier:.+}")
86     @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML})
87     public StructuredData readOperationalData(@PathParam("identifier") String identifier);
88
89     @PUT
90     @Path("/operational/{identifier:.+}")
91     @Produces({API+JSON,API+XML})
92     public Response createOperationalData(@PathParam("identifier") String identifier, CompositeNode payload);
93
94     @POST
95     @Path("/operational/{identifier:.+}")
96     @Produces({API+JSON,API+XML})
97     public Response updateOperationalData(@PathParam("identifier") String identifier, CompositeNode payload);
98
99 }