Bug 6664 - upgrade draft15 to draft16 - renaming
[netconf.git] / restconf / sal-rest-connector / src / main / java / org / opendaylight / restconf / rest / services / api / RestconfModulesService.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.rest.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.netconf.sal.restconf.impl.NormalizedNodeContext;
18 import org.opendaylight.restconf.Draft16;
19 import org.opendaylight.restconf.utils.RestconfConstants;
20
21 /**
22  * Service provides information about the YANG modules and submodules.
23  */
24 public interface RestconfModulesService {
25
26     /**
27      * Get identifiers for the YANG data model modules supported by the server.
28      *
29      * @param uriInfo
30      *            - URI information
31      * @return {@link NormalizedNodeContext}
32      */
33     @GET
34     @Path("data/ietf-yang-library:modules-state")
35     @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
36             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
37     public NormalizedNodeContext getModules(@Context UriInfo uriInfo);
38
39     /**
40      * Valid only for mount points. Get identifiers for the YANG data model
41      * modules supported by the specific mount point.
42      *
43      * @param identifier
44      *            - path parameter
45      * @param uriInfo
46      *            - URI information
47      * @return {@link NormalizedNodeContext}
48      */
49     @GET
50     @Path("data/ietf-yang-library:modules-state/{identifier:.+}")
51     @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
52             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
53     public NormalizedNodeContext getModules(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
54
55     /**
56      * Get entry for each YANG data model module supported by the server. There
57      * must be an instance of this list for every YANG module that is used by
58      * the server.
59      *
60      * @param identifier
61      *            - path parameter
62      * @param uriInfo
63      *            - URI information
64      * @return {@link NormalizedNodeContext}
65      */
66     @GET
67     @Path("data/ietf-yang-library:modules-state/module/{identifier:.+}")
68     @Produces({ Draft16.MediaTypes.DATA + RestconfConstants.JSON, Draft16.MediaTypes.DATA, MediaType.APPLICATION_JSON,
69             MediaType.APPLICATION_XML, MediaType.TEXT_XML })
70     public NormalizedNodeContext getModule(@PathParam("identifier") String identifier, @Context UriInfo uriInfo);
71 }