X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fcode-generator%2Fsamples%2Fmaven-code-gen-sample%2Fsrc%2Fmain%2Fyang%2Fdemo-topology.yang;fp=opendaylight%2Fsal%2Fyang-prototype%2Fcode-generator%2Fcode-generator-demo%2Fsrc%2Fmain%2Fresources%2Ftest-topology.yang;h=4fef1cddd255fd2311237595ea4211b3f9be42a5;hp=797ab2ced24d6d799f4c81a90da677ee27ab7a68;hb=refs%2Fchanges%2F03%2F703%2F1;hpb=4731ee462f09ad75d31a175b0dd5abfa11eb2b6a diff --git a/opendaylight/sal/yang-prototype/code-generator/code-generator-demo/src/main/resources/test-topology.yang b/opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/demo-topology.yang similarity index 66% rename from opendaylight/sal/yang-prototype/code-generator/code-generator-demo/src/main/resources/test-topology.yang rename to opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/demo-topology.yang index 797ab2ced2..4fef1cddd2 100644 --- a/opendaylight/sal/yang-prototype/code-generator/code-generator-demo/src/main/resources/test-topology.yang +++ b/opendaylight/sal/yang-prototype/code-generator/samples/maven-code-gen-sample/src/main/yang/demo-topology.yang @@ -1,13 +1,9 @@ -// vi: set smarttab sw=4 tabstop=4: -module abstract-topology { +module demo-topology { yang-version 1; - namespace "pre:simple.test.demo"; + namespace "urn:model.1demo-275topology.4.5.my"; prefix "tp"; - import ietf-inet-types { prefix "inet"; } - import abstract-prefixes { prefix "abs-pref"; } - - organization "OPEN DAYLIGHT"; + organization "OPEN DAYLIGHT"; contact "http://www.opendaylight.org/"; description " @@ -16,30 +12,9 @@ module abstract-topology { not designed to be used solely for network representation. This module SHOULD be used as base module in defining the network topology. "; - - revision "2012-02-08" { - reference " WILL BE DEFINED LATER"; - } - - typedef topology-id-ref { - type leafref { - path "/tp:topology/tp:topology-id"; - } - description "This type is used for leafs that reference topology identifier instance."; - } - typedef network-node-id-ref { - type leafref { - path "/tp:topology/tp:network-nodes/tp:network-node/tp:node-id"; - } - description "This type is used for leafs that reference network node instance."; - } - - typedef link-id-ref { - type leafref { - path "/tp:topology/tp:network-links/tp:network-link/tp:link-id"; - } - description "This type is used for leafs that reference network link instance."; + revision "2013-02-08"{ + reference " WILL BE DEFINED LATER"; } container topology { @@ -51,7 +26,7 @@ module abstract-topology { "; leaf topology-id { - type inet:uri; + type string; description " It is presumed that datastore will contain many topologies. To distinguish between topologies it is vital to have UNIQUE @@ -66,14 +41,40 @@ module abstract-topology { key "node-id"; leaf node-id { - type inet:uri; + type string; description "The Topology identifier of network-node."; } - - container attributes { + + list network-interface { + key "interface-id"; + + leaf interface-id { + type uint8; + } + + leaf interface-address { + type string; + } + } + + container node-attributes { description " Additional attributes that can Network Node contains. "; + + leaf geo-latitude { + type decimal64 { + fraction-digits 2; + } + config true; + } + + leaf geo-longitude { + type decimal64 { + fraction-digits 2; + } + config true; + } } } } @@ -93,30 +94,28 @@ module abstract-topology { key "link-id"; leaf link-id { - type inet:uri; + type string; description ""; } container source { leaf node-id { - type node-id-ref; + type string; description "Source node identifier."; } } container destination { leaf node-id { - type node-id-ref; + type string; description "Destination node identifier."; } } - container attributes { + container link-attributes { description "Aditional attributes that can Network Link contains."; } } } } - - //TODO: add base operations -} +} \ No newline at end of file