Split Restconf implementations (draft02 and RFC) - base api
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / simple / services / api / RestconfOperationsService.java
1 /*
2  * Copyright (c) 2016 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.restconf.nb.rfc8040.simple.services.api;
9
10 import javax.ws.rs.GET;
11 import javax.ws.rs.Path;
12 import javax.ws.rs.PathParam;
13 import javax.ws.rs.Produces;
14 import javax.ws.rs.core.Context;
15 import javax.ws.rs.core.MediaType;
16 import javax.ws.rs.core.UriInfo;
17 import org.opendaylight.restconf.common.context.NormalizedNodeContext;
18 import org.opendaylight.restconf.nb.rfc8040.Rfc8040;
19 import org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants;
20
21 /**
22  * Container that provides access to the data-model specific operations
23  * supported by the server.
24  *
25  */
26 public interface RestconfOperationsService {
27
28     /**
29      * List of rpc or action operations supported by the server.
30      *
31      * @param uriInfo
32      *             URI information
33      * @return {@link NormalizedNodeContext}
34      */
35     @GET
36     @Path("/operations")
37     @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
38             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
39     NormalizedNodeContext getOperations(@Context UriInfo uriInfo);
40
41     /**
42      * Valid for mount points. List of operations supported by the server.
43      *
44      * @param identifier
45      *             path parameter
46      * @param uriInfo
47      *             URI information
48      * @return {@link NormalizedNodeContext}
49      */
50     @GET
51     @Path("/operations/{identifier:.+}")
52     @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON,
53             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
54     NormalizedNodeContext getOperations(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
55 }