Add yanglib API for non-revision model
[netconf.git] / netconf / yanglib / src / main / java / org / opendaylight / yanglib / api / YangLibService.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.yanglib.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.MediaType;
15 import org.opendaylight.yangtools.yang.common.YangConstants;
16
17 /**
18  * Service provides YANG schema sources for modules from yang library.
19  */
20 @Path("/")
21 @Produces({ MediaType.TEXT_PLAIN, YangConstants.RFC6020_YANG_MEDIA_TYPE })
22 public interface YangLibService {
23
24     /**
25      * Get module's source for each module from yang library.
26      * @param name Module's name
27      * @param revision Module's revision
28      * @return Module's source
29      */
30     @GET
31     @Path("/schemas/{modelName}/{revision:([0-9\\-]*)}")
32     String getSchema(@PathParam("modelName") String name, @PathParam("revision") String revision);
33
34     /**
35      * Get module's source for each module from yang library without a revision.
36      * @param name Module's name
37      * @return Module's source
38      */
39     @GET
40     @Path("/schemas/{modelName}")
41     String getSchema(@PathParam("modelName") String name);
42 }