* Added example yang to affinity project at the correct location (src/main/yang).
[affinity.git] / src / main / yang / affinity-topology.yang
1 module affinity-topology { 
2     namespace "urn:opendaylight:affinity";
3     prefix affinity;
4
5     import ietf-inet-types { prefix inet; }
6     import ietf-yang-types { prefix yang; }
7     import yang-ext { prefix ext; }
8
9     revision "2013-09-16" {
10         description "Initial revision of affinity model";
11     }
12
13     typedef affinity-group-ref {
14         type instance-identifier;
15     }
16
17     typedef affinity-link-ref {
18         type instance-identifier;
19     }
20
21     grouping affinity-group {
22         leaf id {
23             type string;
24         }       
25         list affinity-identifier {
26             key id;
27             leaf id {
28                 type string;
29             }
30             leaf address {
31                 description "Mac or Inet address";
32                 type union {
33                     type inet:ip-address;
34                     type yang:mac-address;
35                 }
36             }
37         }
38     }
39
40     grouping affinity-link {
41         leaf id {
42             type string;
43         }
44         leaf from-affinity-group {
45             type affinity-group-ref;
46         }
47         leaf to-affinity-group {
48             type affinity-group-ref;
49         }
50         leaf attribute {
51             type string;
52         }
53     }
54
55     identity affinity-group-context {
56         description "Identity used to mark affinity-group context";
57     }
58     identity affinity-link-context {
59         description "Identity used to mark affinity-link context";
60     }
61
62     container affinity-topology {
63         list affinity-group {
64             key id;
65             ext:context-instance "affinity-group-context";
66             uses affinity-group;
67         }
68         list affinity-link {
69             key id;
70             ext:context-instance "affinity-link-context";
71             uses affinity-link;
72         }
73     }
74
75     rpc get-affinity-groups {
76         output {
77             list affinity-group {
78                 key id;
79                 uses affinity-group;
80             }
81         }
82     }
83     rpc get-affinity-links {
84         
85     }
86     rpc get-affinity-group {
87         
88     }
89     rpc get-affinity-link {
90         
91     }
92 }
93
94