Fix how rest port is obtained (#2263)
[aquarium] / src / test / resources / policy.yaml
1 aquariumpolicy:
2   resources:
3     - resource:
4       name: bandwidthup
5       unit: MB/hr
6       complex: false
7       costpolicy: continuous
8     - resource:
9       name: bandwidthdown
10       unit: MB/hr
11       complex: false
12       costpolicy: continuous
13     - resource:
14       name: vmtime
15       unit: Hour
16       complex: true
17       costpolicy: onoff
18       descriminatorfield: vmid
19     - resource:
20       name: diskspace
21       unit: MB/hr
22       complex: false
23       costpolicy: continuous
24     - resource:
25       name: bookpages
26       unit: pages
27       complex: false
28       costpolicy: discrete
29     - resource:
30       name: refills
31       unit: credits
32       complex: false
33       costpolicy: once
34
35   implicitvars:
36     - price
37     - volume
38
39   algorithms:
40     - algorithm:
41       name: default
42       bandwidthup: $price times $volume
43       bandwidthdown: $price times $volume
44       vmtime: $price times $volume
45       diskspace: $price times $volume
46       bookpages: $price times $volume
47       refills: $price times $volume
48       effective:
49         from: 0
50     - algorithm:
51       name: freedisk
52       overrides: default
53       diskspace: 0
54       effective:
55         repeat:
56           - start: "00 00 12 * *"
57             end:   "00 00 14 * *"
58           - start: "00 00 18 * *"
59             end:   "00 00 20 * *"
60         from: 0
61         to: 1424442196 # Fri, 20 Feb 2015 14:23:16 GMT
62
63   pricelists:
64     - pricelist: 
65       name: default
66       bandwidthup: 0.01
67       bandwidthdown: 0.02
68       vmtime: 0.1
69       diskspace: 0.05
70       bookpages: 0.1
71       refills: 1
72       effective:
73         from: 0
74     - pricelist: 
75       name: everyTue2
76       overrides: default
77       bandwidthup: 0.01
78       bandwidthdown: 0.02
79       vmtime: 0.1
80       diskspace: 0.05
81       effective:
82         repeat:
83           - start: "00 02 * * Tue"
84             end:   "00 02 * * Wed"
85         from: 0
86     - pricelist:
87       name: foobar
88       overrides: default
89       bandwidthup: 0.04
90       bandwidthdown: 0.04
91       vmtime: 0.6
92       diskspace: 0.05
93       effective:
94         repeat:
95           - start: "00 12 * * *"
96             end:   "00 14 * * *"
97           - start: "00 18 * * *"
98             end:   "00 20 * * *"
99         from: 0
100
101   creditplans:
102     - creditplan:
103       name: default
104       credits: 100
105       at: "00 00 1 * *"
106       effective:
107         from: 0
108     - creditplan:
109       name: every10days
110       at: "00 00 1,10,20,30 * *"
111       credits: 20
112       effective:
113         from: 0
114
115   agreements:
116     - agreement:
117       name: default
118       algorithm: default
119       pricelist: default
120       creditplan: default
121
122     - agreement:
123       overrides: default
124       name: scaledbandwidth
125       pricelist: foobar
126       algorithm:
127         bandwidthup: |
128                 if $volume gt 15 then
129                   $volume times $price
130                 elsif $volume gt 15 and volume lt 30 then
131                   $volume times $price times 1.2
132                 else
133                   $volume times price times 1.4
134                 end
135
136     - agreement:
137       overrides: default
138       name: onemonthexperiment
139       creditplan:
140         at: "00 00 * * *"
141         credits: 100
142         effective:
143           from: 1322061528 #Wed 23 Nov 2011 17:18
144           to: 1324661839 #Fri, 23 Dec 2011 17:37
145
146     - agreement:
147       overrides: default
148       name: complextimeslots
149       creditplan: every10days
150       pricelist: foobar
151       algorithm: freedisk
152