From 16d9612603c2ebf670745f2160178d4d0e7cd59c Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Sun, 31 Jan 2016 10:29:06 +0100 Subject: [PATCH] Support for YANG language --- lib/linguist/languages.yml | 7 +++++ samples/YANG/sfc-lisp-impl.yang | 55 +++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 samples/YANG/sfc-lisp-impl.yang diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 306dfe9d..9903f2c9 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3901,6 +3901,13 @@ YAML: - .yaml-tmlanguage ace_mode: yaml +YANG: + type: data + extensions: + - .yang + tm_scope: none + ace_mode: text + Yacc: type: programming extensions: diff --git a/samples/YANG/sfc-lisp-impl.yang b/samples/YANG/sfc-lisp-impl.yang new file mode 100644 index 00000000..761d9829 --- /dev/null +++ b/samples/YANG/sfc-lisp-impl.yang @@ -0,0 +1,55 @@ +module sfc-lisp-impl { + + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:config:sfc-lisp:impl"; + prefix "sfc-lisp-impl"; + + import config { prefix config; revision-date 2013-04-05; } + import rpc-context { prefix rpcx; revision-date 2013-06-17; } + import opendaylight-md-sal-binding { prefix mdsal; revision-date 2013-10-28; } + + + description + "This module contains the base YANG definitions for + sfc-lisp implementation."; + + revision "2015-04-27" { + description + "Initial revision."; + } + + // This is the definition of the service implementation as a module identity + identity sfc-lisp-impl { + base config:module-type; + + // Specifies the prefix for generated java classes. + config:java-name-prefix SfcLisp; + } + + + // Augments the 'configuration' choice node under modules/module. + augment "/config:modules/config:module/config:configuration" { + case sfc-lisp-impl { + when "/config:modules/config:module/config:type = 'sfc-lisp-impl'"; + + //wires in the data-broker service + container data-broker { + uses config:service-ref { + refine type { + mandatory false; + config:required-identity mdsal:binding-async-data-broker; + } + } + } + + container rpc-registry { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity mdsal:binding-rpc-registry; + } + } + } + } + } +} \ No newline at end of file