Revision f590f930 commissioning/api/quotaholder.py
b/commissioning/api/quotaholder.py | ||
---|---|---|
29 | 29 |
Resource = Name(classname='Resource') |
30 | 30 |
Policy = Name(classname='Policy') |
31 | 31 |
|
32 |
Quantity = Nonnegative(classname='Quantity')
|
|
32 |
Quantity = Integer(classname='Quantity')
|
|
33 | 33 |
Capacity = Nonnegative(classname='Capacity') |
34 | 34 |
ImportLimit = Nonnegative(classname='ImportLimit') |
35 | 35 |
ExportLimit = Nonnegative(classname='ExportLimit') |
36 | 36 |
Imported = Nonnegative(classname='Imported') |
37 | 37 |
Exported = Nonnegative(classname='Exported') |
38 |
Regained = Nonnegative(classname='Regained') |
|
39 |
Released = Nonnegative(classname='Released') |
|
38 | 40 |
Flags = Nonnegative(classname='Flags') |
39 | 41 |
|
42 |
Timepoint = Text(classname='Timepoint', maxlen=24) |
|
43 |
Reason = Text( classname = 'Reason', |
|
44 |
regex = '(ACCEPT|REJECT):.*', |
|
45 |
maxlen = 128 ) |
|
40 | 46 |
|
41 | 47 |
class QuotaholderAPI(Specificator): |
42 | 48 |
|
... | ... | |
97 | 103 |
): |
98 | 104 |
|
99 | 105 |
holdings = ListOf( Entity, Resource, Policy, |
100 |
Imported, Exported, Flags )
|
|
106 |
Imported, Exported, Regained, Released, Flags )
|
|
101 | 107 |
return holdings |
102 | 108 |
|
103 | 109 |
def set_holding ( |
... | ... | |
129 | 135 |
Quantity, Capacity, |
130 | 136 |
ImportLimit, ExportLimit, |
131 | 137 |
Imported, Exported, |
138 |
Regained, Released, |
|
132 | 139 |
Flags) |
133 | 140 |
return quotas |
134 | 141 |
|
... | ... | |
202 | 209 |
rejected = ListOf(Entity) |
203 | 210 |
return rejected |
204 | 211 |
|
212 |
def get_timeline ( |
|
213 |
self, |
|
214 |
context = Context, |
|
215 |
after = Timepoint, |
|
216 |
before = Timepoint, |
|
217 |
entities = ListOf(Entity, Key) |
|
218 |
): |
|
219 |
|
|
220 |
timeline = ListOf( Dict( serial = Serial, |
|
221 |
source = Entity, |
|
222 |
target = Entity, |
|
223 |
resource = Resource, |
|
224 |
quantity = Quantity, |
|
225 |
issue_time = Timepoint, |
|
226 |
log_time = Timepoint, |
|
227 |
reason = Reason ) ) |
|
228 |
return timeline |
|
229 |
|
Also available in: Unified diff