Merge ~jsseidel/maas:jsseidel-blockdevices-api-annotations into maas:master
- Git
- lp:~jsseidel/maas
- jsseidel-blockdevices-api-annotations
- Merge into master
Proposed by
Spencer Seidel
Status: | Merged |
---|---|
Approved by: | Newell Jensen |
Approved revision: | b7435baff5cb57261b0cb6632a5e14685d3cd9a6 |
Merge reported by: | MAAS Lander |
Merged at revision: | not available |
Proposed branch: | ~jsseidel/maas:jsseidel-blockdevices-api-annotations |
Merge into: | maas:master |
Diff against target: |
820 lines (+619/-84) 2 files modified
src/maasserver/api/blockdevices.py (+311/-84) src/maasserver/api/examples/nodes.json (+308/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Newell Jensen (community) | Approve | ||
MAAS Lander | unittests | Pending | |
Review via email: mp+360026@code.launchpad.net |
Commit message
Added API annotations and examples to blockdevices.
Description of the change
To post a comment you must log in.
- b7435ba... by Spencer Seidel
-
Merge branch 'master' into jsseidel-
blockdevices- api-annotations
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/src/maasserver/api/blockdevices.py b/src/maasserver/api/blockdevices.py |
2 | index 3854b31..2815e9f 100644 |
3 | --- a/src/maasserver/api/blockdevices.py |
4 | +++ b/src/maasserver/api/blockdevices.py |
5 | @@ -82,9 +82,21 @@ class BlockDevicesHandler(OperationsHandler): |
6 | return ('blockdevices_handler', ["system_id"]) |
7 | |
8 | def read(self, request, system_id): |
9 | - """List all block devices belonging to a machine. |
10 | + """@description-title List block devices |
11 | + @description List all block devices belonging to a machine. |
12 | |
13 | - Returns 404 if the machine is not found. |
14 | + @param (string) "{system_id}" [required=true] The machine system_id. |
15 | + |
16 | + @success (http-status-code) "server-success" 200 |
17 | + @success (json) "success-json" A JSON object containing a list of block |
18 | + devices. |
19 | + @success-example "success-json" [exkey=block-devs-read] placeholder |
20 | + text |
21 | + |
22 | + @error (http-status-code) "404" 404 |
23 | + @error (content) "not-found" The requested machine is not found. |
24 | + @error-example "not-found" |
25 | + Not Found |
26 | """ |
27 | machine = Machine.objects.get_node_or_404( |
28 | system_id, request.user, NodePermission.view) |
29 | @@ -92,18 +104,37 @@ class BlockDevicesHandler(OperationsHandler): |
30 | |
31 | @admin_method |
32 | def create(self, request, system_id): |
33 | - """Create a physical block device. |
34 | - |
35 | - :param name: Name of the block device. |
36 | - :param model: Model of the block device. |
37 | - :param serial: Serial number of the block device. |
38 | - :param id_path: (optional) Only used if model and serial cannot be |
39 | - provided. This should be a path that is fixed and doesn't change |
40 | - depending on the boot order or kernel version. |
41 | - :param size: Size of the block device. |
42 | - :param block_size: Block size of the block device. |
43 | - |
44 | - Returns 404 if the node is not found. |
45 | + """@description-title Create a block device |
46 | + @description Create a physical block device. |
47 | + |
48 | + @param (string) "{system_id}" [required=true] The machine system_id. |
49 | + |
50 | + @param (string) "name" [required=true] Name of the block device. |
51 | + |
52 | + @param (string) "model" [required=false] Model of the block device. |
53 | + |
54 | + @param (string) "serial" [required=false] Serial number of the block |
55 | + device. |
56 | + |
57 | + @param (string) "id_path" [required=false] Only used if model and |
58 | + serial cannot be provided. This should be a path that is fixed and |
59 | + doesn't change depending on the boot order or kernel version. |
60 | + |
61 | + @param (string) "size" [required=true] Size of the block device. |
62 | + |
63 | + @param (string) "block_size" [required=true] Block size of the block |
64 | + device. |
65 | + |
66 | + @success (http-status-code) "server-success" 200 |
67 | + @success (json) "success-json" A JSON object containing the new block |
68 | + device. |
69 | + @success-example "success-json" [exkey=block-devs-create] placeholder |
70 | + text |
71 | + |
72 | + @error (http-status-code) "404" 404 |
73 | + @error (content) "not-found" The requested machine is not found. |
74 | + @error-example "not-found" |
75 | + Not Found |
76 | """ |
77 | machine = Machine.objects.get_node_or_404( |
78 | system_id, request.user, NodePermission.admin) |
79 | @@ -212,19 +243,48 @@ class BlockDeviceHandler(OperationsHandler): |
80 | return None |
81 | |
82 | def read(self, request, system_id, id): |
83 | - """Read block device on node. |
84 | - |
85 | - Returns 404 if the machine or block device is not found. |
86 | + """@description-title Read a block device |
87 | + @description Read a block device on a given machine. |
88 | + |
89 | + @param (string) "{system_id}" [required=true] The machine system_id. |
90 | + @param (string) "{id}" [required=true] The block device's id. |
91 | + |
92 | + @success (http-status-code) "server-success" 200 |
93 | + @success (json) "success-json" A JSON object containing the requested |
94 | + block device. |
95 | + @success-example "success-json" [exkey=block-devs-read-by-id] |
96 | + placeholder text |
97 | + |
98 | + @error (http-status-code) "404" 404 |
99 | + @error (content) "not-found" The requested machine or block device is |
100 | + not found. |
101 | + @error-example "not-found" |
102 | + Not Found |
103 | """ |
104 | return BlockDevice.objects.get_block_device_or_404( |
105 | system_id, id, request.user, NodePermission.view) |
106 | |
107 | def delete(self, request, system_id, id): |
108 | - """Delete block device on a machine. |
109 | + """@description-title Delete a block device |
110 | + @description Delete block device on a given machine. |
111 | |
112 | - Returns 404 if the machine or block device is not found. |
113 | - Returns 403 if the user is not allowed to delete the block device. |
114 | - Returns 409 if the machine is not Ready. |
115 | + @param (string) "{system_id}" [required=true] The machine system_id. |
116 | + @param (string) "{id}" [required=true] The block device's id. |
117 | + |
118 | + @success (http-status-code) "204" 204 |
119 | + |
120 | + @error (http-status-code) "403" 403 |
121 | + @error (content) "no-perms" The user does not have permissions to |
122 | + delete the block device. |
123 | + |
124 | + @error (http-status-code) "404" 404 |
125 | + @error (content) "not-found" The requested machine or block device is |
126 | + not found. |
127 | + @error-example "not-found" |
128 | + Not Found |
129 | + |
130 | + @error (http-status-code) "409" 409 |
131 | + @error (content) "not-ready" The requested machine is not ready. |
132 | """ |
133 | device = BlockDevice.objects.get_block_device_or_404( |
134 | system_id, id, request.user, NodePermission.admin) |
135 | @@ -236,34 +296,63 @@ class BlockDeviceHandler(OperationsHandler): |
136 | return rc.DELETED |
137 | |
138 | def update(self, request, system_id, id): |
139 | - """Update block device on a machine. |
140 | + """@description-title Update a block device |
141 | + @description Update block device on a given machine. |
142 | |
143 | Machines must have a status of Ready to have access to all options. |
144 | Machines with Deployed status can only have the name, model, serial, |
145 | and/or id_path updated for a block device. This is intented to allow a |
146 | bad block device to be replaced while the machine remains deployed. |
147 | |
148 | - Fields for physical block device: |
149 | + @param (string) "{system_id}" [required=true] The machine system_id. |
150 | + @param (string) "{id}" [required=true] The block device's id. |
151 | + |
152 | + @param (string) "name" [required=false] (Physical devices) Name of the |
153 | + block device. |
154 | + |
155 | + @param (string) "model" [required=false] (Physical devices) Model of |
156 | + the block device. |
157 | + |
158 | + @param (string) "serial" [required=false] (Physical devices) Serial |
159 | + number of the block device. |
160 | + |
161 | + @param (string) "id_path" [required=false] (Physical devices) Only used |
162 | + if model and serial cannot be provided. This should be a path that is |
163 | + fixed and doesn't change depending on the boot order or kernel version. |
164 | + |
165 | + @param (string) "size" [required=false] (Physical devices) Size of the |
166 | + block device. |
167 | + |
168 | + @param (string) "block_size" [required=false] (Physical devices) Block |
169 | + size of the block device. |
170 | + |
171 | + @param (string) "name" [required=false] (Virtual devices) Name of |
172 | + the block device. |
173 | + |
174 | + @param (string) "uuid" [required=false] (Virtual devices) UUID of |
175 | + the block device. |
176 | |
177 | - :param name: Name of the block device. |
178 | - :param model: Model of the block device. |
179 | - :param serial: Serial number of the block device. |
180 | - :param id_path: (optional) Only used if model and serial cannot be \ |
181 | - provided. This should be a path that is fixed and doesn't change \ |
182 | - depending on the boot order or kernel version. |
183 | - :param size: Size of the block device. |
184 | - :param block_size: Block size of the block device. |
185 | + @param (string) "size" [required=false] (Virtual devices) Size of |
186 | + the block device. (Only allowed for logical volumes.) |
187 | |
188 | - Fields for virtual block device: |
189 | + @success (http-status-code) "server-success" 200 |
190 | + @success (json) "success-json" A JSON object containing the updated |
191 | + block device. |
192 | + @success-example "success-json" [exkey=block-devs-update] placeholder |
193 | + text |
194 | |
195 | - :param name: Name of the block device. |
196 | - :param uuid: UUID of the block device. |
197 | - :param size: Size of the block device. (Only allowed for logical \ |
198 | - volumes.) |
199 | + @error (http-status-code) "403" 403 |
200 | + @error (content) "no-perms" The user does not have permissions to |
201 | + update the block device. |
202 | |
203 | - Returns 404 if the machine or block device is not found. |
204 | - Returns 403 if the user is not allowed to update the block device. |
205 | - Returns 409 if the machine is not Ready. |
206 | + @error (http-status-code) "404" 404 |
207 | + @error (content) "not-found" The requested machine or block device is |
208 | + not found. |
209 | + @error-example "not-found" |
210 | + Not Found |
211 | + |
212 | + @error (http-status-code) "409" 409 |
213 | + @error (content) "not-ready" The requested machine is not ready. |
214 | """ |
215 | device = BlockDevice.objects.get_block_device_or_404( |
216 | system_id, id, request.user, NodePermission.admin) |
217 | @@ -296,13 +385,32 @@ class BlockDeviceHandler(OperationsHandler): |
218 | |
219 | @operation(idempotent=False) |
220 | def add_tag(self, request, system_id, id): |
221 | - """Add a tag to block device on a machine. |
222 | + """@description-title Add a tag |
223 | + @description Add a tag to block device on a given machine. |
224 | + |
225 | + @param (string) "{system_id}" [required=true] The machine system_id. |
226 | + @param (string) "{id}" [required=true] The block device's id. |
227 | + |
228 | + @param (string) "tag" [required=true] The tag being added. |
229 | |
230 | - :param tag: The tag being added. |
231 | + @success (http-status-code) "server-success" 200 |
232 | + @success (json) "success-json" A JSON object containing the updated |
233 | + block device. |
234 | + @success-example "success-json" [exkey=block-devs-add-tag] placeholder |
235 | + text |
236 | |
237 | - Returns 404 if the machine or block device is not found. |
238 | - Returns 403 if the user is not allowed to update the block device. |
239 | - Returns 409 if the machine is not Ready. |
240 | + @error (http-status-code) "403" 403 |
241 | + @error (content) "no-perms" The user does not have permissions to |
242 | + add a tag. |
243 | + |
244 | + @error (http-status-code) "404" 404 |
245 | + @error (content) "not-found" The requested machine or block device is |
246 | + not found. |
247 | + @error-example "not-found" |
248 | + Not Found |
249 | + |
250 | + @error (http-status-code) "409" 409 |
251 | + @error (content) "not-ready" The requested machine is not ready. |
252 | """ |
253 | device = BlockDevice.objects.get_block_device_or_404( |
254 | system_id, id, request.user, NodePermission.admin) |
255 | @@ -316,13 +424,32 @@ class BlockDeviceHandler(OperationsHandler): |
256 | |
257 | @operation(idempotent=False) |
258 | def remove_tag(self, request, system_id, id): |
259 | - """Remove a tag from block device on a machine. |
260 | + """@description-title Remove a tag |
261 | + @description Remove a tag from block device on a given machine. |
262 | + |
263 | + @param (string) "{system_id}" [required=true] The machine system_id. |
264 | + @param (string) "{id}" [required=true] The block device's id. |
265 | |
266 | - :param tag: The tag being removed. |
267 | + @param (string) "tag" [required=false] The tag being removed. |
268 | |
269 | - Returns 404 if the machine or block device is not found. |
270 | - Returns 403 if the user is not allowed to update the block device. |
271 | - Returns 409 if the machine is not Ready. |
272 | + @success (http-status-code) "server-success" 200 |
273 | + @success (json) "success-json" A JSON object containing the updated |
274 | + block device. |
275 | + @success-example "success-json" [exkey=block-devs-remove-tag] |
276 | + placeholder text |
277 | + |
278 | + @error (http-status-code) "403" 403 |
279 | + @error (content) "no-perms" The user does not have permissions to |
280 | + remove a tag. |
281 | + |
282 | + @error (http-status-code) "404" 404 |
283 | + @error (content) "not-found" The requested machine or block device is |
284 | + not found. |
285 | + @error-example "not-found" |
286 | + Not Found |
287 | + |
288 | + @error (http-status-code) "409" 409 |
289 | + @error (content) "not-ready" The requested machine is not ready. |
290 | """ |
291 | device = BlockDevice.objects.get_block_device_or_404( |
292 | system_id, id, request.user, NodePermission.admin) |
293 | @@ -336,15 +463,34 @@ class BlockDeviceHandler(OperationsHandler): |
294 | |
295 | @operation(idempotent=False) |
296 | def format(self, request, system_id, id): |
297 | - """Format block device with filesystem. |
298 | + """@description-title Format block device |
299 | + @description Format block device with filesystem. |
300 | + |
301 | + @param (string) "{system_id}" [required=true] The machine system_id. |
302 | + @param (string) "{id}" [required=true] The block device's id. |
303 | + |
304 | + @param (string) "fstype" [required=true] Type of filesystem. |
305 | + |
306 | + @param (string) "uuid" [required=false] UUID of the filesystem. |
307 | |
308 | - :param fstype: Type of filesystem. |
309 | - :param uuid: UUID of the filesystem. |
310 | + @success (http-status-code) "server-success" 200 |
311 | + @success (json) "success-json" A JSON object containing the updated |
312 | + block device. |
313 | + @success-example "success-json" [exkey=block-devs-format] placeholder |
314 | + text |
315 | |
316 | - Returns 403 when the user doesn't have the ability to format the \ |
317 | - block device. |
318 | - Returns 404 if the machine or block device is not found. |
319 | - Returns 409 if the machine is not Ready or Allocated. |
320 | + @error (http-status-code) "403" 403 |
321 | + @error (content) "no-perms" The user does not have permissions to |
322 | + format the block device. |
323 | + |
324 | + @error (http-status-code) "404" 404 |
325 | + @error (content) "not-found" The requested machine or block device is |
326 | + not found. |
327 | + @error-example "not-found" |
328 | + Not Found |
329 | + |
330 | + @error (http-status-code) "409" 409 |
331 | + @error (content) "not-ready" The requested machine is not ready. |
332 | """ |
333 | device = BlockDevice.objects.get_block_device_or_404( |
334 | system_id, id, request.user, NodePermission.edit) |
335 | @@ -359,14 +505,34 @@ class BlockDeviceHandler(OperationsHandler): |
336 | |
337 | @operation(idempotent=False) |
338 | def unformat(self, request, system_id, id): |
339 | - """Unformat block device with filesystem. |
340 | - |
341 | - Returns 400 if the block device is not formatted, currently mounted, \ |
342 | - or part of a filesystem group. |
343 | - Returns 403 when the user doesn't have the ability to unformat the \ |
344 | - block device. |
345 | - Returns 404 if the machine or block device is not found. |
346 | - Returns 409 if the machine is not Ready or Allocated. |
347 | + """@description-title Unformat a block device |
348 | + @description Unformat a previously formatted block device. |
349 | + |
350 | + @param (string) "{system_id}" [required=true] The machine system_id. |
351 | + @param (string) "{id}" [required=true] The block device's id. |
352 | + |
353 | + @success (http-status-code) "server-success" 200 |
354 | + @success (json) "success-json" A JSON object containing |
355 | + the updated block device. |
356 | + @success-example "success-json" [exkey=block-devs-unformat] placeholder |
357 | + text |
358 | + |
359 | + @error (http-status-code) "400" 400 |
360 | + @error (content) "problem" The block device is not formatted, currently |
361 | + mounted, or part of a filesystem group. |
362 | + |
363 | + @error (http-status-code) "403" 403 |
364 | + @error (content) "no-perms" The user does not have permissions to |
365 | + unformat the block device. |
366 | + |
367 | + @error (http-status-code) "404" 404 |
368 | + @error (content) "not-found" The requested machine or block device is |
369 | + not found. |
370 | + @error-example "not-found" |
371 | + Not Found |
372 | + |
373 | + @error (http-status-code) "409" 409 |
374 | + @error (content) "not-ready" The requested machine is not ready. |
375 | """ |
376 | device = BlockDevice.objects.get_block_device_or_404( |
377 | system_id, id, request.user, NodePermission.edit) |
378 | @@ -392,15 +558,36 @@ class BlockDeviceHandler(OperationsHandler): |
379 | |
380 | @operation(idempotent=False) |
381 | def mount(self, request, system_id, id): |
382 | - """Mount the filesystem on block device. |
383 | + """@description-title Mount a filesystem |
384 | + @description Mount the filesystem on block device. |
385 | + |
386 | + @param (string) "{system_id}" [required=true] The machine system_id. |
387 | + @param (string) "{id}" [required=true] The block device's id. |
388 | + |
389 | + @param (string) "mount_point" [required=true] Path on the filesystem |
390 | + to mount. |
391 | + |
392 | + @param (string) "mount_options" [required=false] Options to pass to |
393 | + mount(8). |
394 | + |
395 | + @success (http-status-code) "server-success" 200 |
396 | + @success (json) "success-json" A JSON object containing the updated |
397 | + block device. |
398 | + @success-example "success-json" [exkey=block-devs-mount] placeholder |
399 | + text |
400 | |
401 | - :param mount_point: Path on the filesystem to mount. |
402 | - :param mount_options: Options to pass to mount(8). |
403 | + @error (http-status-code) "403" 403 |
404 | + @error (content) "no-perms" The user does not have permissions to |
405 | + mount the filesystem. |
406 | |
407 | - Returns 403 when the user doesn't have the ability to mount the \ |
408 | - block device. |
409 | - Returns 404 if the machine or block device is not found. |
410 | - Returns 409 if the machine is not Ready or Allocated. |
411 | + @error (http-status-code) "404" 404 |
412 | + @error (content) "not-found" The requested machine or block device is |
413 | + not found. |
414 | + @error-example "not-found" |
415 | + Not Found |
416 | + |
417 | + @error (http-status-code) "409" 409 |
418 | + @error (content) "not-ready" The requested machine is not ready. |
419 | """ |
420 | device = BlockDevice.objects.get_block_device_or_404( |
421 | system_id, id, request.user, NodePermission.edit) |
422 | @@ -416,14 +603,34 @@ class BlockDeviceHandler(OperationsHandler): |
423 | |
424 | @operation(idempotent=False) |
425 | def unmount(self, request, system_id, id): |
426 | - """Unmount the filesystem on block device. |
427 | - |
428 | - Returns 400 if the block device is not formatted or not currently \ |
429 | - mounted. |
430 | - Returns 403 when the user doesn't have the ability to unmount the \ |
431 | - block device. |
432 | - Returns 404 if the machine or block device is not found. |
433 | - Returns 409 if the machine is not Ready or Allocated. |
434 | + """@description-title Unmount a filesystem |
435 | + @description Unmount the filesystem on block device. |
436 | + |
437 | + @param (string) "{system_id}" [required=true] The machine system_id. |
438 | + @param (string) "{id}" [required=true] The block device's id. |
439 | + |
440 | + @success (http-status-code) "server-success" 200 |
441 | + @success (json) "success-json" A JSON object containing the updated |
442 | + block device. |
443 | + @success-example "success-json" [exkey=block-devs-unmount] placeholder |
444 | + text |
445 | + |
446 | + @error (http-status-code) "400" 400 |
447 | + @error (content) "problem" The block device is not formatted or |
448 | + currently mounted. |
449 | + |
450 | + @error (http-status-code) "403" 403 |
451 | + @error (content) "no-perms" The user does not have permissions to mount |
452 | + the filesystem. |
453 | + |
454 | + @error (http-status-code) "404" 404 |
455 | + @error (content) "not-found" The requested machine or block device is |
456 | + not found. |
457 | + @error-example "not-found" |
458 | + Not Found |
459 | + |
460 | + @error (http-status-code) "409" 409 |
461 | + @error (content) "not-ready" The requested machine is not ready. |
462 | """ |
463 | device = BlockDevice.objects.get_block_device_or_404( |
464 | system_id, id, request.user, NodePermission.edit) |
465 | @@ -442,12 +649,32 @@ class BlockDeviceHandler(OperationsHandler): |
466 | |
467 | @operation(idempotent=False) |
468 | def set_boot_disk(self, request, system_id, id): |
469 | - """Set this block device as the boot disk for the machine. |
470 | + """@description-title Set boot disk |
471 | + @description Set a block device as the boot disk for the machine. |
472 | + |
473 | + @param (string) "{system_id}" [required=true] The machine system_id. |
474 | + @param (string) "{id}" [required=true] The block device's id. |
475 | + |
476 | + @success (http-status-code) "server-success" 200 |
477 | + @success (content) "success-content" Boot disk set. |
478 | + @success-example "success-content" |
479 | + OK |
480 | + |
481 | + @error (http-status-code) "400" 400 |
482 | + @error (content) "problem" The block device is a virtual block device. |
483 | + |
484 | + @error (http-status-code) "403" 403 |
485 | + @error (content) "no-perms" The user does not have permissions to set |
486 | + the boot disk. |
487 | + |
488 | + @error (http-status-code) "404" 404 |
489 | + @error (content) "not-found" The requested machine or block device is |
490 | + not found. |
491 | + @error-example "not-found" |
492 | + Not Found |
493 | |
494 | - Returns 400 if the block device is a virtual block device. |
495 | - Returns 404 if the machine or block device is not found. |
496 | - Returns 403 if the user is not allowed to update the block device. |
497 | - Returns 409 if the machine is not Ready or Allocated. |
498 | + @error (http-status-code) "409" 409 |
499 | + @error (content) "not-ready" The requested machine is not ready. |
500 | """ |
501 | device = BlockDevice.objects.get_block_device_or_404( |
502 | system_id, id, request.user, NodePermission.admin) |
503 | diff --git a/src/maasserver/api/examples/nodes.json b/src/maasserver/api/examples/nodes.json |
504 | index 2f2b1bf..1efe0d1 100644 |
505 | --- a/src/maasserver/api/examples/nodes.json |
506 | +++ b/src/maasserver/api/examples/nodes.json |
507 | @@ -2604,5 +2604,313 @@ |
508 | }, |
509 | "bcache-placeholder": { |
510 | "message": "Information about this object is not available at this time." |
511 | + }, |
512 | + "block-devs-read": [ |
513 | + { |
514 | + "id_path": null, |
515 | + "size": 3698265088, |
516 | + "block_size": 512, |
517 | + "tags": [ |
518 | + "tag-BGt1BR", |
519 | + "tag-1Fm39m", |
520 | + "tag-Hqbbak" |
521 | + ], |
522 | + "uuid": null, |
523 | + "id": 1, |
524 | + "available_size": 3698265088, |
525 | + "filesystem": null, |
526 | + "partitions": [], |
527 | + "storage_pool": "pool_id-nHmvMI", |
528 | + "used_size": 0, |
529 | + "path": "/dev/disk/by-dname/name-86Ezga", |
530 | + "partition_table_type": null, |
531 | + "used_for": "Unused", |
532 | + "type": "physical", |
533 | + "name": "name-86Ezga", |
534 | + "system_id": "y7388k", |
535 | + "model": "model-sCuLNN", |
536 | + "serial": "serial-ZKjZxn", |
537 | + "resource_uri": "/MAAS/api/2.0/nodes/y7388k/blockdevices/1/" |
538 | + }, |
539 | + { |
540 | + "id_path": null, |
541 | + "size": 1392376320, |
542 | + "block_size": 512, |
543 | + "tags": [ |
544 | + "tag-hZPKgU", |
545 | + "tag-ImIubs", |
546 | + "tag-yRv0Vm" |
547 | + ], |
548 | + "uuid": null, |
549 | + "id": 2, |
550 | + "available_size": 1392376320, |
551 | + "filesystem": null, |
552 | + "partitions": [], |
553 | + "storage_pool": "pool_id-nHmvMI", |
554 | + "used_size": 0, |
555 | + "path": "/dev/disk/by-dname/name-EIcGBl", |
556 | + "partition_table_type": null, |
557 | + "used_for": "Unused", |
558 | + "type": "physical", |
559 | + "name": "name-EIcGBl", |
560 | + "system_id": "y7388k", |
561 | + "model": "model-QhVkKT", |
562 | + "serial": "serial-3TaTIG", |
563 | + "resource_uri": "/MAAS/api/2.0/nodes/y7388k/blockdevices/2/" |
564 | + } |
565 | + ], |
566 | + "block-devs-create": { |
567 | + "firmware_version": null, |
568 | + "uuid": null, |
569 | + "used_for": "Unused", |
570 | + "used_size": 0, |
571 | + "storage_pool": null, |
572 | + "system_id": "y7388k", |
573 | + "type": "physical", |
574 | + "path": "/dev/disk/by-dname/newblockdevice", |
575 | + "filesystem": null, |
576 | + "id_path": "", |
577 | + "partitions": [], |
578 | + "tags": [], |
579 | + "available_size": 1000000000, |
580 | + "block_size": 1024000, |
581 | + "model": "fakemodel", |
582 | + "partition_table_type": null, |
583 | + "name": "newblockdevice", |
584 | + "size": 1000000000, |
585 | + "serial": "123", |
586 | + "id": 73, |
587 | + "resource_uri": "/MAAS/api/2.0/nodes/y7388k/blockdevices/73/" |
588 | + }, |
589 | + "block-devs-read-by-id": { |
590 | + "firmware_version": null, |
591 | + "system_id": "y7388k", |
592 | + "block_size": 1024000, |
593 | + "available_size": 1000000000, |
594 | + "model": "fakemodel", |
595 | + "serial": "123", |
596 | + "used_size": 0, |
597 | + "tags": [], |
598 | + "partition_table_type": null, |
599 | + "partitions": [], |
600 | + "path": "/dev/disk/by-dname/newblockdevice", |
601 | + "size": 1000000000, |
602 | + "id_path": "", |
603 | + "filesystem": null, |
604 | + "storage_pool": null, |
605 | + "name": "newblockdevice", |
606 | + "used_for": "Unused", |
607 | + "id": 73, |
608 | + "type": "physical", |
609 | + "uuid": null, |
610 | + "resource_uri": "/MAAS/api/2.0/nodes/y7388k/blockdevices/73/" |
611 | + }, |
612 | + "block-devs-update": { |
613 | + "firmware_version": "firmware_version-WJ46L3", |
614 | + "storage_pool": "pool_id-QkOjON", |
615 | + "uuid": null, |
616 | + "system_id": "thr3am", |
617 | + "block_size": 4096, |
618 | + "id_path": "", |
619 | + "filesystem": null, |
620 | + "used_for": "Unused", |
621 | + "model": "model-5btVsu", |
622 | + "used_size": 0, |
623 | + "partition_table_type": null, |
624 | + "id": 20, |
625 | + "serial": "serial-SE3O1p", |
626 | + "size": 2173730816, |
627 | + "type": "physical", |
628 | + "available_size": 2173730816, |
629 | + "path": "/dev/disk/by-dname/newname", |
630 | + "partitions": [], |
631 | + "tags": [ |
632 | + "tag-WAlxSu", |
633 | + "tag-p05xzW", |
634 | + "tag-dwLYRY" |
635 | + ], |
636 | + "name": "newname", |
637 | + "resource_uri": "/MAAS/api/2.0/nodes/thr3am/blockdevices/20/" |
638 | + }, |
639 | + "block-devs-add-tag": { |
640 | + "firmware_version": "firmware_version-WJ46L3", |
641 | + "filesystem": null, |
642 | + "available_size": 2173730816, |
643 | + "model": "model-5btVsu", |
644 | + "type": "physical", |
645 | + "name": "newname", |
646 | + "system_id": "thr3am", |
647 | + "partition_table_type": null, |
648 | + "partitions": [], |
649 | + "size": 2173730816, |
650 | + "id_path": "", |
651 | + "block_size": 4096, |
652 | + "uuid": null, |
653 | + "used_size": 0, |
654 | + "used_for": "Unused", |
655 | + "tags": [ |
656 | + "tag-WAlxSu", |
657 | + "tag-p05xzW", |
658 | + "tag-dwLYRY", |
659 | + "newtag" |
660 | + ], |
661 | + "storage_pool": "pool_id-QkOjON", |
662 | + "path": "/dev/disk/by-dname/newname", |
663 | + "id": 20, |
664 | + "serial": "serial-SE3O1p", |
665 | + "resource_uri": "/MAAS/api/2.0/nodes/thr3am/blockdevices/20/" |
666 | + }, |
667 | + "block-devs-remove-tag": { |
668 | + "firmware_version": "firmware_version-WJ46L3", |
669 | + "used_for": "Unused", |
670 | + "serial": "serial-SE3O1p", |
671 | + "used_size": 0, |
672 | + "partitions": [], |
673 | + "block_size": 4096, |
674 | + "available_size": 2173730816, |
675 | + "type": "physical", |
676 | + "path": "/dev/disk/by-dname/newname", |
677 | + "storage_pool": "pool_id-QkOjON", |
678 | + "id": 20, |
679 | + "partition_table_type": null, |
680 | + "model": "model-5btVsu", |
681 | + "uuid": null, |
682 | + "filesystem": null, |
683 | + "name": "newname", |
684 | + "tags": [ |
685 | + "tag-WAlxSu", |
686 | + "tag-p05xzW", |
687 | + "tag-dwLYRY" |
688 | + ], |
689 | + "id_path": "", |
690 | + "size": 2173730816, |
691 | + "system_id": "thr3am", |
692 | + "resource_uri": "/MAAS/api/2.0/nodes/thr3am/blockdevices/20/" |
693 | + }, |
694 | + "block-devs-format": { |
695 | + "firmware_version": "firmware_version-WJ46L3", |
696 | + "system_id": "thr3am", |
697 | + "partitions": [], |
698 | + "tags": [ |
699 | + "tag-WAlxSu", |
700 | + "tag-p05xzW", |
701 | + "tag-dwLYRY" |
702 | + ], |
703 | + "uuid": null, |
704 | + "storage_pool": "pool_id-QkOjON", |
705 | + "id": 20, |
706 | + "type": "physical", |
707 | + "filesystem": { |
708 | + "fstype": "ext4", |
709 | + "label": "", |
710 | + "uuid": "fcc36eca-09fd-4c15-b339-c706ad3b75cf", |
711 | + "mount_point": null, |
712 | + "mount_options": null |
713 | + }, |
714 | + "name": "newname", |
715 | + "id_path": "", |
716 | + "used_for": "Unmounted ext4 formatted filesystem", |
717 | + "partition_table_type": null, |
718 | + "model": "model-5btVsu", |
719 | + "used_size": 2173730816, |
720 | + "serial": "serial-SE3O1p", |
721 | + "size": 2173730816, |
722 | + "available_size": 0, |
723 | + "block_size": 4096, |
724 | + "path": "/dev/disk/by-dname/newname", |
725 | + "resource_uri": "/MAAS/api/2.0/nodes/thr3am/blockdevices/20/" |
726 | + }, |
727 | + "block-devs-unformat": { |
728 | + "firmware_version": "firmware_version-WJ46L3", |
729 | + "tags": [ |
730 | + "tag-WAlxSu", |
731 | + "tag-p05xzW", |
732 | + "tag-dwLYRY" |
733 | + ], |
734 | + "used_size": 0, |
735 | + "uuid": null, |
736 | + "system_id": "thr3am", |
737 | + "id": 20, |
738 | + "type": "physical", |
739 | + "model": "model-5btVsu", |
740 | + "id_path": "", |
741 | + "size": 2173730816, |
742 | + "available_size": 2173730816, |
743 | + "path": "/dev/disk/by-dname/newname", |
744 | + "used_for": "Unused", |
745 | + "filesystem": null, |
746 | + "partition_table_type": null, |
747 | + "name": "newname", |
748 | + "storage_pool": "pool_id-QkOjON", |
749 | + "partitions": [], |
750 | + "serial": "serial-SE3O1p", |
751 | + "block_size": 4096, |
752 | + "resource_uri": "/MAAS/api/2.0/nodes/thr3am/blockdevices/20/" |
753 | + }, |
754 | + "block-devs-mount": { |
755 | + "firmware_version": "firmware_version-WJ46L3", |
756 | + "id": 20, |
757 | + "available_size": 0, |
758 | + "type": "physical", |
759 | + "storage_pool": "pool_id-QkOjON", |
760 | + "system_id": "thr3am", |
761 | + "block_size": 4096, |
762 | + "uuid": null, |
763 | + "id_path": "", |
764 | + "name": "newname", |
765 | + "partitions": [], |
766 | + "tags": [ |
767 | + "tag-WAlxSu", |
768 | + "tag-p05xzW", |
769 | + "tag-dwLYRY" |
770 | + ], |
771 | + "filesystem": { |
772 | + "fstype": "ext4", |
773 | + "label": "", |
774 | + "uuid": "9a5860a2-497d-433b-98c3-e0059ad1545e", |
775 | + "mount_point": "/media", |
776 | + "mount_options": "" |
777 | + }, |
778 | + "size": 2173730816, |
779 | + "partition_table_type": null, |
780 | + "model": "model-5btVsu", |
781 | + "path": "/dev/disk/by-dname/newname", |
782 | + "serial": "serial-SE3O1p", |
783 | + "used_for": "ext4 formatted filesystem mounted at /media", |
784 | + "used_size": 2173730816, |
785 | + "resource_uri": "/MAAS/api/2.0/nodes/thr3am/blockdevices/20/" |
786 | + }, |
787 | + "block-devs-unmount": { |
788 | + "firmware_version": "firmware_version-WJ46L3", |
789 | + "model": "model-5btVsu", |
790 | + "size": 2173730816, |
791 | + "partition_table_type": null, |
792 | + "available_size": 0, |
793 | + "used_for": "Unmounted ext4 formatted filesystem", |
794 | + "id_path": "", |
795 | + "name": "newname", |
796 | + "id": 20, |
797 | + "tags": [ |
798 | + "tag-WAlxSu", |
799 | + "tag-p05xzW", |
800 | + "tag-dwLYRY" |
801 | + ], |
802 | + "filesystem": { |
803 | + "fstype": "ext4", |
804 | + "label": "", |
805 | + "uuid": "9a5860a2-497d-433b-98c3-e0059ad1545e", |
806 | + "mount_point": null, |
807 | + "mount_options": null |
808 | + }, |
809 | + "partitions": [], |
810 | + "storage_pool": "pool_id-QkOjON", |
811 | + "used_size": 2173730816, |
812 | + "block_size": 4096, |
813 | + "system_id": "thr3am", |
814 | + "serial": "serial-SE3O1p", |
815 | + "type": "physical", |
816 | + "path": "/dev/disk/by-dname/newname", |
817 | + "uuid": null, |
818 | + "resource_uri": "/MAAS/api/2.0/nodes/thr3am/blockdevices/20/" |
819 | } |
820 | } |
Looks good.