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.md.sal.common.api.TransactionStatus;
20 import org.opendaylight.controller.sal.restconf.impl.StructuredData;
21 import org.opendaylight.yangtools.yang.common.RpcResult;
22 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
25 * The URI hierarchy for the RESTCONF resources consists of an entry
26 * point container, 3 top-level resources, and 1 field. Refer to
27 * Section 5 for details on each URI.
29 * <li><b>/restconf</b> - {@link #getRoot()}
30 * <ul><li><b>/config</b>
31 * <li><b>/operational</b> - {@link #readAllData()} - Added in Draft02
32 * <li><b>/datastore</b> - {@link #readAllData()}
34 * <li>/(top-level-data-nodes) (config=true or false)
46 * <li>/(custom protocol operations)
48 * <li>/version (field)
52 public interface RestconfService extends RestconfServiceLegacy {
54 public static final String XML = "+xml";
55 public static final String JSON = "+json";
58 public Object getRoot();
63 @Produces({API+JSON,API+XML})
64 public StructuredData getModules();
67 @Path("/operations/{identifier}")
68 @Produces({Draft02.MediaTypes.API+JSON,Draft02.MediaTypes.API+XML,API+JSON,API+XML})
69 public StructuredData invokeRpc(@PathParam("identifier") String identifier, CompositeNode payload);
73 @Path("/config/{identifier:.+}")
74 @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML})
75 public StructuredData readConfigurationData(@PathParam("identifier") String identifier);
80 @Path("/config/{identifier:.+}")
81 @Produces({API+JSON,API+XML})
82 public RpcResult<TransactionStatus> createConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
85 @Path("/config/{identifier:.+}")
86 @Produces({API+JSON,API+XML})
87 public RpcResult<TransactionStatus> updateConfigurationData(@PathParam("identifier") String identifier, CompositeNode payload);
90 @Path("/operational/{identifier:.+}")
91 @Produces({Draft02.MediaTypes.DATA+JSON,Draft02.MediaTypes.DATA+XML})
92 public StructuredData readOperationalData(@PathParam("identifier") String identifier);
95 @Path("/operational/{identifier:.+}")
96 @Produces({API+JSON,API+XML})
97 public RpcResult<TransactionStatus> createOperationalData(@PathParam("identifier") String identifier, CompositeNode payload);
100 @Path("/operational/{identifier:.+}")
101 @Produces({API+JSON,API+XML})
102 public RpcResult<TransactionStatus> updateOperationalData(@PathParam("identifier") String identifier, CompositeNode payload);