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
9 @**********************************************************
10 * Twirl YangTemplate for generating yang snippets. *
11 * Twirl is transformed to Scala and compiled. Then, *
12 * it can be called from Java with particular input *
13 * parameters to render desired output code. *
14 ***********************************************************@
16 @import org.opendaylight.yangtools.yang.model.api.RpcDefinition
17 @import org.opendaylight.yangtools.yang.model.api.Module
18 @import org.opendaylight.yangtools.yang.model.api.Status
20 @(rpc: RpcDefinition, module: Module)
21 rpc @{rpc.getQName().getLocalName()} {
22 @if(rpc.getDescription().isPresent()) {
23 "@{rpc.getDescription().get()}";
25 @if(rpc.getGroupings() != null && !rpc.getGroupings().isEmpty()) {
26 @yangTemplateWriteGroupingDefs(rpc.getGroupings(), module)
28 @if(rpc.getInput() != null && rpc.getInput().getChildNodes != null && !rpc.getInput().getChildNodes().isEmpty()) {
30 @yangTemplateWriteDataSchemaNodes(rpc.getInput().getChildNodes, module)
33 @if(rpc.getOutput() != null && rpc.getOutput().getChildNodes != null && !rpc.getOutput().getChildNodes().isEmpty()) {
35 @yangTemplateWriteDataSchemaNodes(rpc.getOutput().getChildNodes, module)
38 @if(rpc.getReference().isPresent()) {
39 reference "@{rpc.getReference().get()}";
41 @if(rpc.getStatus() != Status.CURRENT) {
42 status @{rpc.getStatus()};