Provide a module to manage resources manually.
[alto.git] / alto-basic / manual-maps / api / src / main / yang / alto-costmap-config.yang
1 module alto-costmap-config {
2     yang-version 1;
3
4     namespace "urn:opendaylight:alto:basic:manual:maps:costmap";
5
6     prefix "alto-costmap-config";
7
8     import "ietf-inet-types" {
9         prefix "ietf-inet";
10     }
11
12     import "alto-basic-types" {
13         prefix "alto-types";
14     }
15
16     organization "Yale University";
17
18     contact "alto-dev@lists.opendaylight.org";
19
20     revision "2015-10-21" {
21         description "Initial revision of alto-costmap-config model";
22     }
23
24     grouping cost-map-meta {
25         uses alto-types:dependent-vtags {
26             refine dependent-vtags {
27                 max-elements 1;
28             }
29         }
30     }
31
32     grouping cost-map {
33         leaf "resource-id" {
34             mandatory true;
35             type alto-types:resource-id;
36         }
37         leaf tag {
38             mandatory ture;
39             type alto-types:tag;
40         }
41
42         container meta {
43             must "current()";
44             uses cost-map-meta;
45         }
46
47         list "map" {
48             leaf src {
49                 type alto-types:pid-name;
50             }
51             key "src";
52             list dst-costs {
53                 leaf dst {
54                     type alto-types:pid-name;
55                 }
56                 key "dst";
57                 choice cost {
58                     case type-numerical {
59                         leaf cost-value {
60                             type decimal64 {
61                                 fraction-digits 4;
62                             }
63                         }
64                     }
65                     case type-ordinal {
66                         leaf cost-value {
67                             type int32;
68                         }
69                     }
70                 }
71             }
72         }
73     }
74 }