forked from mfontani/Net-RackSpace-CloudServers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO
296 lines (272 loc) · 6.48 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
Create new server
Using POST to /servers, sample JSON from docs:
{
"server" : {
"name" : "new-server-test",
"imageId" : 2,
"flavorId" : 1,
"metadata" : {
"My Server Name" : "Apache1"
},
"personality" : [
{
"path" : "/etc/banner.txt",
"contents" :
"ICAgICAgDQoiQSBjbG91ZCBkb2VzIG5vdCBrbm93IHdoeSBpdCBtb3ZlcyBpbiBqdXN0IHN1Y2
ggYSBkaXJlY3Rpb24gYW5kIGF0IHN1Y2ggYSBzcGVlZC4uLkl0IGZlZWxzIGFuIGltcHVsc2lvb
i4uLnRoaXMgaXMgdGhlIHBsYWNlIHRvIGdvIG5vdy4gQnV0IHRoZSBza3kga25vd3MgdGhlIHJl
YXNvbnMgYW5kIHRoZSBwYXR0ZXJucyBiZWhpbmQgYWxsIGNsb3VkcywgYW5kIHlvdSB3aWxsIGt
ub3csIHRvbywgd2hlbiB5b3UgbGlmdCB5b3Vyc2VsZiBoaWdoIGVub3VnaCB0byBzZWUgYmV5b2
5kIGhvcml6b25zLiINCg0KLVJpY2hhcmQgQmFjaA=="
}
]
}
}
# Note from docs:
# The max size of the file path data is 255 bytes while the max size
# of the file contents is 10KB
# the file contents should be encoded as a Base64 string and the 10KB
# limit refers to the number of bytes in the decoded data not the
# number of characters in the encoded data.
# Nice to have:
# Servers in the same shared IP group can share public IPs for various
# high availability and load balancing configurations. To launch an HA
# server, include the optional sharedIpGroupId element and the server
# will be launched into that shared IP group.
# sharedIpGroupId is an optional parameter and for optimal performance,
# should ONLY be specified when intending to share IPs between servers.
Update server info
Using POST to /servers/id to change admin password:
{ "server" :
{
"name" : "new-server-test",
"adminPass" : "newPassword"
}
}
# NOTE: no response is provided
Delete server
Using DELETE to /servers/id => normal response 202, no response.
List servers' IPs:
Using GET to /servers/id/ips
{
"addresses" : {
"public" : [
"67.23.10.132",
"67.23.10.131"
],
"private" : [
"10.176.42.16"
]
}
}
List servers' PUBLIC IPs:
using GET to /servers/id/ips/public
{
"public" : [
"67.23.10.132",
"67.23.10.131"
]
}
List servers' PRIVATE IPs:
using GET to /servers/id/ips/private
{
"private" : [
" 10.176.42.16"
]
}
Reboot server: (SOFT/HARD)
Using POST to /servers/id/action
{ "reboot": { "type": "HARD" } } # power button
{ "reboot": { "type": "SOFT" } } # restarts
No response returned
List flavors
GET /flavors # ID and name only
GET /flavors/detail # all info
{
"flavors" : [
{
"id" : 1,
"name" : "256 MB Server",
"ram" : 256,
"disk" : 10
},
{
"id" : 2,
"name" : "512 MB Server",
"ram" : 512,
"disk" : 20
}
]
}
GET /flavors/id # all info
{
"flavor" : {
"id" : 1,
"name" : "256 MB Server",
"ram" : 256,
"disk" : 10
}
}
List images:
GET /images # ID and name only
GET /images/deatil # all info
{
"images" : [
{
"id" : 2,
"name" : "CentOS 5.2",
"updated" : "2010-10-10T12:00:00Z",
"created" : "2010-08-10T12:00:00Z",
"status" : "ACTIVE"
},
{
"id" : 743,
"name" : "My Server Backup",
"serverId" : 12,
"updated" : "2010-10-10T12:00:00Z",
"created" : "2010-08-10T12:00:00Z",
"status" : "SAVING",
"progress" : 80
}
]
}
Get image details
GET /images/id
{
"image" : {
"id" : 2,
"name" : "CentOS 5.2",
"serverId" : 12,
"updated" : "2010-10-10T12:00:00Z",
"created" : "2010-08-10T12:00:00Z",
"status" : "SAVING",
"progress" : 80
}
}
Nice to have:
Share an IP address to the specified server
Using PUT to /servers/id/ips/public/address
JSON:
{
"shareIp" : {
"sharedIpGroupId" : 1234,
"configureServer" : true
}
}
Unshare IP address with specified server
Using DELETE to /servers/id/ips/public/address
No parameters, no response (normal 202)
Rebuild server:
Using POST to /servers/id/action
{ "rebuild": { "imageId": 2 } }
Resize server:
Using POST to /servers/id/action
{ "resize": { "flavorId": 3 } }
Confirm pending resize:
Using POST to /servers/id/action
{ "confirmResize": null }
Revert pending resize:
Using POST to /servers/id/action
{ "revertResize": null }
Create image:
POST to /images
{
"image" : {
"serverId" : 12,
"name" : "Just in case"
}
}
response:
{
"image" : {
"id" : 22,
"serverId" : 12,
"name" : "Just in case",
"created" : "2010-10-10T12:00:00Z",
"status" : "SAVING",
"progress" : 0
}
}
Get Backup schedules
GET /servers/id/backup_schedule
{
"backupSchedule" : {
"enabled" : true,
"weekly" : "THURSDAY",
"daily" : "H_0400_0600"
}
}
Create/Update Backup schedule
POST /servers/id/backup_schedule
Delete Backup schedule
POST /servers/id/backup_schedule
Shared IP groups
Rate Limits
Verb URI RegEx Default
POST * .* 10/min
POST */servers ^/servers 50/day
PUT * .* 10/min
GET *changes-since* changes-since 3/min
DELETE * .* 100/min
Absolute Limits
Limit Default
Maximum total amount of RAM (GB) 50
Maximum number of shared IP groups 25
Maximum number of members per shared IP group 25
GET /limits
{
"limits" : {
"rate" : [
{
"verb" : "POST",
"URI" : "*",
"regex" : ".*",
"value" : 10,
"remaining" : 2,
"unit" : "MINUTE",
"resetTime" : 1244425439
},
{
"verb" : "POST",
"URI" : "*/servers",
"regex" : "^/servers",
"value" : 50,
"remaining" : 49,
"unit" : "DAY",
"resetTime" : 1244511839
},
{
"verb" : "PUT",
"URI" : "*",
"regex" : ".*",
"value" : 10,
"remaining" : 2,
"unit" : "MINUTE",
"resetTime" : 1244425439
},
{
"verb" : "GET",
"URI" : "*changes-since*",
"regex" : "changes-since",
"value" : 3,
"remaining" : 3,
"unit" : "MINUTE",
"resetTime" : 1244425439
},
{
"verb" : "DELETE",
"URI" : "*",
"regex" : ".*",
"value" : 100,
"remaining" : 100,
"unit" : "MINUTE",
"resetTime" : 1244425439
}
],
"absolute" : {
"maxTotalRAMSize" : 51200,
"maxIPGroups" : 50,
"maxIPGroupMembers" : 25
}
}
}