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.controller.sal.rest.api;
10 import static org.opendaylight.controller.sal.restconf.impl.MediaTypes.API;
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;
19 import org.opendaylight.controller.sal.restconf.impl.StructuredData;
20 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
23 * The URI hierarchy for the RESTCONF resources consists of an entry
24 * point container, 3 top-level resources, and 1 field. Refer to
25 * Section 5 for details on each URI.
27 * <li><b>/restconf</b> - {@link #getRoot()}
28 * <ul><li><b>/datastore</b> - {@link #readAllData()}
30 * <li>/(top-level-data-nodes) (config=true or false)
42 * <li>/(custom protocol operations)
44 * <li>/version (field)
48 public interface RestconfService {
50 public static final String XML = "+xml";
51 public static final String JSON = "+json";
54 public Object getRoot();
58 @Produces({API+JSON,API+XML})
59 public Object readAllData();
62 @Path("/datastore/{identifier:.+}")
63 @Produces({API+JSON,API+XML})
64 public StructuredData readData(@PathParam("identifier") String identifier);
67 @Path("/datastore/{identifier:.+}")
68 @Produces({API+JSON,API+XML})
69 public Object createConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
72 @Path("/datastore/{identifier:.+}")
73 @Produces({API+JSON,API+XML})
74 public Object updateConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
78 @Produces({API+JSON,API+XML})
79 public Object getModules();
82 @Path("/operations/{identifier}")
83 @Produces({API+JSON,API+XML})
84 public StructuredData invokeRpc(@PathParam("identifier") String identifier, CompositeNode payload);