2 * Copyright (c) 2016 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.yanglib.api;
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;
18 * Service provides YANG schema sources for modules from yang library.
21 @Produces({ YangConstants.RFC6020_YANG_MEDIA_TYPE, MediaType.TEXT_PLAIN })
22 public interface YangLibService {
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
31 @Path("/schemas/{modelName}/{revision:([0-9\\-]*)}")
32 String getSchema(@PathParam("modelName") String name, @PathParam("revision") String revision);
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
40 @Path("/schemas/{modelName}")
41 String getSchema(@PathParam("modelName") String name);