Implement the model for ECS
[alto.git] / alto-core / standard-service-models / model-endpointcost / api / src / main / yang / alto-model-endpointcost-rfc7285.yang
1 module alto-model-endpointcost-rfc7285 {
2     yang-version 1;
3
4     namespace "urn:opendaylight:alto:service:model:endpointcost:rfc7285";
5
6     prefix "alto-model-endpointcost-rfc7285";
7
8     import "alto-basic-types" {
9         prefix "alto-types";
10     }
11
12     import "alto-resourcepool" {
13         prefix "alto-resourcpool";
14     }
15
16     import "alto-model-base" {
17         prefix "base";
18     }
19
20     import "alto-model-networkmap" {
21         prefix "networkmap";
22     }
23
24     import "alto-model-endpointcost" {
25         prefix "endpointcost";
26     }
27
28     import "ietf-inet-types" {
29         prefix "ietf-inet";
30     }
31
32     organization "Yale University";
33
34     contact "alto-dev@lists.opendaylight.org";
35
36     revision "2015-10-21" {
37         description "Initial revision of alto endpointcost";
38     }
39
40     grouping "typed-address-data" {
41         choice "address" {
42         }
43     }
44
45     grouping "endpoint-filter-data" {
46         container "endpoint-filter" {
47             list "source" {
48                 uses "typed-address-data";
49             }
50
51             list "destination" {
52                 uses "typed-address-data";
53             }
54         }
55     }
56
57     identity "filter-type-endpointfilter" {
58         base "endpointcost:filter-type-base";
59     }
60
61     augment "/base:query/base:input/base:request/endpointcost:endpointcost-request-data/endpointcost:endpointcost-request/endpointcost:filter" {
62         case "endpoint-filter-data" {
63             uses "endpoint-filter-data";
64         }
65     }
66
67     identity "endpointcost-response-type-endpointcostmap" {
68         base "endpointcost:endpointcost-response-type-base";
69     }
70
71     grouping "endpointcostmap-response-data" {
72         container "endpoint-cost-map" {
73             list "endpoint-cost-list" {
74                 uses "typed-address-data";
75
76                 list "endpoint-destination-cost" {
77                     uses "typed-address-data";
78
79                     choice "cost" {
80                     }
81                 }
82             }
83         }
84     }
85
86     augment "/base:query/base:output/base:response/endpointcost:endpointcost-response-data/endpointcost:endpointcost-response/endpointcost:data/" {
87         case "endpoint-cost-map-data" {
88             uses "endpointcostmap-response-data";
89         }
90     }
91
92     grouping "ipv4-address-data" {
93         leaf "ipv4" {
94             type ietf-inet:ipv4-address;
95         }
96     }
97
98     grouping "ipv6-address-data" {
99         leaf "ipv6" {
100             type ietf-inet:ipv6-address;
101         }
102     }
103
104     augment "/base:query/base:input/base:request/endpointcost:endpointcost-request-data/endpointcost:endpointcost-request/endpointcost:filter/endpoint-filter-data/endpoint-filter/source/address" {
105         case ipv4 {
106             uses "ipv4-address-data";
107         }
108
109         case ipv6 {
110             uses "ipv6-address-data";
111         }
112     }
113
114     augment "/base:query/base:input/base:request/endpointcost:endpointcost-request-data/endpointcost:endpointcost-request/endpointcost:filter/endpoint-filter-data/endpoint-filter/destination/address" {
115         case ipv4 {
116             uses "ipv4-address-data";
117         }
118
119         case ipv6 {
120             uses "ipv6-address-data";
121         }
122     }
123
124
125     augment "/base:query/base:output/base:response/endpointcost:endpointcost-response-data/endpointcost:endpointcost-response/endpointcost:data/endpoint-cost-map-data/endpoint-cost-map/endpoint-cost-list/address" {
126         case ipv4 {
127             uses "ipv4-address-data";
128         }
129
130         case ipv6 {
131             uses "ipv6-address-data";
132         }
133     }
134
135     augment "/base:query/base:output/base:response/endpointcost:endpointcost-response-data/endpointcost:endpointcost-response/endpointcost:data/endpoint-cost-map-data/endpoint-cost-map/endpoint-cost-list/endpoint-destination-cost/address" {
136         case ipv4 {
137             uses "ipv4-address-data";
138         }
139
140         case ipv6 {
141             uses "ipv6-address-data";
142         }
143     }
144
145     augment "/base:query/base:output/base:response/endpointcost:endpointcost-response-data/endpointcost:endpointcost-response/endpointcost:data/endpoint-cost-map-data/endpoint-cost-map/endpoint-cost-list/endpoint-destination-cost/cost" {
146         case numerical {
147             leaf "cost" {
148                 type decimal64 {
149                     fraction-digits 4;
150                 }
151             }
152         }
153
154        case ordinal {
155             leaf "cost" {
156                 type int32;
157             }
158         }
159     }
160 }