2 * Copyright (c) 2013 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.yangtools;
10 import javax.ws.rs.Consumes;
11 import javax.ws.rs.DELETE;
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.QueryParam;
19 import javax.ws.rs.core.MediaType;
20 import javax.ws.rs.core.Response;
21 import org.opendaylight.yangtools.draft.Draft01;
22 import org.opendaylight.yangtools.draft.Draft02;
23 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
26 public interface RestRestconfService {
28 public static final String IDENTIFIER = "identifier";
29 public static final String INPUT = "input";
30 public static final String XML = "+xml";
31 public static final String JSON = "+json";
34 public Object getRoot();
38 @Produces({Draft01.MediaTypes.API+JSON,Draft01.MediaTypes.API+XML,
39 Draft02.MediaTypes.API+JSON,Draft02.MediaTypes.API+XML})
40 public String getModules();
43 @Path("/operations/{identifier}")
44 @Produces({Draft01.MediaTypes.DATA+JSON,Draft01.MediaTypes.DATA+XML,
45 Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
46 MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
47 @Consumes({Draft01.MediaTypes.DATA+JSON,Draft01.MediaTypes.DATA+XML,
48 Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
49 MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
50 public String invokeRpc(@PathParam(IDENTIFIER) String identifier, @QueryParam(INPUT) CompositeNode payload);
53 @Path("/operations/{identifier}")
54 @Produces({Draft01.MediaTypes.DATA+JSON,Draft01.MediaTypes.DATA+XML,
55 Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
56 MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
57 public String invokeRpc(@PathParam(IDENTIFIER) String identifier);
60 @Path("/config/{identifier:.+}")
61 @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
62 MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
63 public String readConfigurationData(@PathParam(IDENTIFIER) String identifier);
66 @Path("/operational/{identifier:.+}")
67 @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
68 MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
69 public String readOperationalData(@PathParam(IDENTIFIER) String identifier);
72 @Path("/config/{identifier:.+}")
73 @Consumes({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
74 MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
75 public Response updateConfigurationData(@PathParam(IDENTIFIER) String identifier,@QueryParam(INPUT) CompositeNode payload);
78 @Path("/config/{identifier:.+}")
79 @Consumes({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
80 MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
81 public Response createConfigurationData(@PathParam(IDENTIFIER) String identifier, @QueryParam(INPUT) CompositeNode payload);
85 @Consumes({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML,
86 MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML})
87 public Response createConfigurationData( @QueryParam(INPUT) CompositeNode payload);
90 @Path("/config/{identifier:.+}")
91 public Response deleteConfigurationData(@PathParam(IDENTIFIER) String identifier);