Implement the model for ECS
[alto.git] / alto-core / resourcepool / api / src / main / yang / alto-resourcepool.yang
1 module alto-resourcepool {
2     yang-version 1;
3
4     namespace "urn:opendaylight:alto:core:resourcepool";
5
6     prefix "alto-resourcepool";
7
8     import "alto-basic-types" {
9         prefix "alto-types";
10     }
11
12     import "yang-ext" {
13         prefix "yang-ext";
14     }
15
16     import "ietf-inet-types" {
17         prefix "ietf-inet";
18     }
19
20     organization "Yale University";
21
22     contact "alto-dev@lists.opendaylight.org";
23
24     revision "2015-09-21" {
25         description "Initial revision of alto resourcepool";
26     }
27
28     identity "service-context" {
29         description
30             "The context identifier for a certain ALTO service";
31     }
32
33     identity "resource-type" {
34         description
35             "The basic type identity for ALTO resourcepool";
36     }
37
38     identity "capability-category" {
39         description
40             "The basic identity for capability categories";
41     }
42
43     grouping "capability-spec" {
44         leaf "category" {
45             type identityref {
46                 base "capability-category";
47             }
48         }
49
50         choice "spec" {
51         }
52     }
53
54     grouping "resource-desc" {
55         leaf "resource-id" {
56             type alto-types:resource-id;
57         }
58
59         leaf "local" {
60             type boolean;
61             default true;
62         }
63
64         leaf "uri" {
65             type ietf-inet:uri;
66         }
67
68         leaf "type" {
69             type identityref {
70                 base "resource-type";
71             }
72         }
73
74         list "capability" {
75             uses "capability-spec";
76         }
77
78         list "dependency" {
79             leaf "resource-id" {
80                 type alto-types:resource-id;
81             }
82         }
83     }
84
85     grouping "resource-service" {
86         leaf "service-instance" {
87             type instance-identifier;
88         }
89     }
90
91     container "resource-pool" {
92         config false;
93
94         list "resource" {
95             key "resource-id";
96
97             yang-ext:context-instance "service-context";
98
99             uses "resource-desc";
100
101             uses "resource-service";
102
103             leaf "refcount" {
104                 type uint16;
105             }
106
107             leaf "tag" {
108                 type alto-types:tag;
109             }
110         }
111     }
112
113     rpc "add-resource" {
114         input {
115             uses "resource-desc";
116
117             uses "resource-service";
118         }
119     }
120
121     rpc "remove-resource" {
122         input {
123             leaf "resource-id" {
124                 type alto-types:resource-id;
125             }
126         }
127     }
128
129     rpc "update-resource" {
130         input {
131             uses "resource-desc";
132
133             uses "resource-service";
134         }
135     }
136
137     rpc "verify-resource" {
138         input {
139             uses "resource-desc";
140
141             uses "resource-service";
142         }
143     }
144 }