1
2
3
4 """Automatically generated RPC client wrappers.
5
6 """
7
8 from ganeti import rpc_defs
9
10
11
13
14
15
16 _CALLS = rpc_defs.CALLS['RpcClientBootstrap']
17
20 """Wrapper for RPC call 'master_node_name'
21
22 Returns the master node name
23
24 @note: This is a multi-node call with a timeout of 1m 0s
25 @type node_list: list of string
26 @param node_list: List of node names
27
28 """
29 return (self._Call(_def, node_list, []))
30
33 """Wrapper for RPC call 'node_activate_master_ip'
34
35 Activates master IP on a node
36
37 @note: This is a single-node call with a timeout of 5m 0s
38 @type node: string
39 @param node: Node name
40 @param master_params: Network parameters of the master
41 @param use_external_mip_script: Whether to use the user-provided
42 master IP address setup script
43
44 """
45 return (self._Call(_def, [node], [master_params,
46 use_external_mip_script])[node])
47
51 """Wrapper for RPC call 'node_change_master_netmask'
52
53 Change master IP netmask
54
55 @note: This is a single-node call with a timeout of 5m 0s
56 @type node: string
57 @param node: Node name
58 @param old_netmask: The old value of the netmask
59 @param netmask: The new value of the netmask
60 @param master_ip: The master IP
61 @param master_netdev: The master network device
62
63 """
64 return (self._Call(_def, [node], [old_netmask, netmask, master_ip,
65 master_netdev])[node])
66
69 """Wrapper for RPC call 'node_deactivate_master_ip'
70
71 Deactivates master IP on a node
72
73 @note: This is a single-node call with a timeout of 5m 0s
74 @type node: string
75 @param node: Node name
76 @param master_params: Network parameters of the master
77 @param use_external_mip_script: Whether to use the user-provided
78 master IP address setup script
79
80 """
81 return (self._Call(_def, [node], [master_params,
82 use_external_mip_script])[node])
83
86 """Wrapper for RPC call 'node_leave_cluster'
87
88 Requests a node to clean the cluster information it has
89
90 @note: This is a single-node call with a timeout of 15m 0s
91 @type node: string
92 @param node: Node name
93
94 """
95 return (self._Call(_def, [node], [modify_ssh_setup])[node])
96
99 """Wrapper for RPC call 'node_start_master_daemons'
100
101 Starts master daemons on a node
102
103 @note: This is a single-node call with a timeout of 5m 0s
104 @type node: string
105 @param node: Node name
106
107 """
108 return (self._Call(_def, [node], [no_voting])[node])
109
112 """Wrapper for RPC call 'node_stop_master'
113
114 Deactivates master IP and stops master daemons on a node
115
116 @note: This is a single-node call with a timeout of 5m 0s
117 @type node: string
118 @param node: Node name
119
120 """
121 return (self._Call(_def, [node], [])[node])
122
123
125
126
127
128 _CALLS = rpc_defs.CALLS['RpcClientConfig']
129
132 """Wrapper for RPC call 'upload_file'
133
134 Upload files
135
136 @note: This is a multi-node call with a timeout of 15m 0s
137 @type node_list: list of string
138 @param node_list: List of node names
139
140 """
141 return (self._Call(_def, node_list, [file_name]))
142
145 """Wrapper for RPC call 'upload_file_single'
146
147 Upload files
148
149 @note: This is a multi-node call with a timeout of 15m 0s
150 @type node_list: list of string
151 @param node_list: List of node names
152 @param file_name: The name of the file
153 @param content: The data to be uploaded
154 @param mode: The mode of the file or None
155 @param uid: The owner of the file
156 @param gid: The group of the file
157 @param atime: The file's last access time
158 @param mtime: The file's last modification time
159
160 """
161 return (self._Call(_def, node_list, [file_name, content, mode, uid,
162 gid, atime, mtime]))
163
166 """Wrapper for RPC call 'write_ssconf_files'
167
168 Write ssconf files
169
170 @note: This is a multi-node call with a timeout of 15m 0s
171 @type node_list: list of string
172 @param node_list: List of node names
173
174 """
175 return (self._Call(_def, node_list, [values]))
176
177
179
180
181
182 _CALLS = rpc_defs.CALLS['RpcClientDefault']
183
186 """Wrapper for RPC call 'accept_instance'
187
188 Prepare a node to accept an instance
189
190 @note: This is a single-node call with a timeout of 15m 0s
191 @type node: string
192 @param node: Node name
193 @param instance: Instance object
194 @param info: Result for the call_migration_info call
195 @param target: Target hostname (usually an IP address)
196
197 """
198 return (self._Call(_def, [node], [instance, info, target])[node])
199
202 """Wrapper for RPC call 'all_instances_info'
203
204 Returns information about all instances on the given nodes
205
206 @note: This is a multi-node call with a timeout of 1m 0s
207 @type node_list: list of string
208 @param node_list: List of node names
209 @param hypervisor_list: Hypervisors to query for instances
210 @param all_hvparams: Dictionary mapping hypervisor names to hvparams
211
212 """
213 return (self._Call(_def, node_list, [hypervisor_list, all_hvparams]))
214
217 """Wrapper for RPC call 'bdev_sizes'
218
219 Gets the sizes of requested block devices present on a node
220
221 @note: This is a multi-node call with a timeout of 1m 0s
222 @type node_list: list of string
223 @param node_list: List of node names
224
225 """
226 return (self._Call(_def, node_list, [devices]))
227
230 """Wrapper for RPC call 'blockdev_addchildren'
231
232 Request adding a list of children to a (mirroring) device
233
234 @note: This is a single-node call with a timeout of 15m 0s
235 @type node: string
236 @param node: Node name
237
238 """
239 return (self._Call(_def, [node], [bdev, ndevs])[node])
240
243 """Wrapper for RPC call 'blockdev_assemble'
244
245 Request assembling of a given block device
246
247 @note: This is a single-node call with a timeout of 15m 0s
248 @type node: string
249 @param node: Node name
250
251 """
252 return (self._Call(_def, [node], [disk, instance, on_primary,
253 idx])[node])
254
257 """Wrapper for RPC call 'blockdev_close'
258
259 Closes the given block devices
260
261 @note: This is a single-node call with a timeout of 15m 0s
262 @type node: string
263 @param node: Node name
264
265 """
266 return (self._Call(_def, [node], [instance_name, disks])[node])
267
270 """Wrapper for RPC call 'blockdev_convert'
271
272 Request the copy of the source block device to the destination one
273
274 @note: This is a single-node call with a timeout of 1h 0m 0s
275 @type node: string
276 @param node: Node name
277
278 """
279 return (self._Call(_def, [node], [bdev_src, bdev_dest])[node])
280
281 - def call_blockdev_create(self, node, bdev, size, owner, on_primary,
282 info, exclusive_storage, _def=_CALLS['blockdev_create']):
283 """Wrapper for RPC call 'blockdev_create'
284
285 Request creation of a given block device
286
287 @note: This is a single-node call with a timeout of 15m 0s
288 @type node: string
289 @param node: Node name
290
291 """
292 return (self._Call(_def, [node], [bdev, size, owner, on_primary, info,
293 exclusive_storage])[node])
294
297 """Wrapper for RPC call 'blockdev_find'
298
299 Request identification of a given block device
300
301 @note: This is a single-node call with a timeout of 15m 0s
302 @type node: string
303 @param node: Node name
304
305 """
306 return (self._Call(_def, [node], [disk])[node])
307
310 """Wrapper for RPC call 'blockdev_getdimensions'
311
312 Returns size and spindles of the given disks
313
314 @note: This is a single-node call with a timeout of 15m 0s
315 @type node: string
316 @param node: Node name
317
318 """
319 return (self._Call(_def, [node], [disks])[node])
320
323 """Wrapper for RPC call 'blockdev_getmirrorstatus'
324
325 Request status of a (mirroring) device
326
327 @note: This is a single-node call with a timeout of 15m 0s
328 @type node: string
329 @param node: Node name
330
331 """
332 return (self._Call(_def, [node], [disks])[node])
333
336 """Wrapper for RPC call 'blockdev_getmirrorstatus_multi'
337
338 Request status of (mirroring) devices from multiple nodes
339
340 @note: This is a multi-node call with a timeout of 15m 0s
341 @type node_list: list of string
342 @param node_list: List of node names
343
344 """
345 return (self._Call(_def, node_list, [node_disks]))
346
349 """Wrapper for RPC call 'blockdev_grow'
350
351 Request growing of the given block device by a given amount
352
353 @note: This is a single-node call with a timeout of 15m 0s
354 @type node: string
355 @param node: Node name
356
357 """
358 return (self._Call(_def, [node], [cf_bdev, amount, dryrun,
359 backingstore, es_flag])[node])
360
363 """Wrapper for RPC call 'blockdev_image'
364
365 Request to dump an image with given size onto a block device
366
367 @note: This is a single-node call with a timeout of 1h 0m 0s
368 @type node: string
369 @param node: Node name
370
371 """
372 return (self._Call(_def, [node], [bdev, image, size])[node])
373
376 """Wrapper for RPC call 'blockdev_open'
377
378 Opens the given block devices in required mode
379
380 @note: This is a single-node call with a timeout of 15m 0s
381 @type node: string
382 @param node: Node name
383
384 """
385 return (self._Call(_def, [node], [instance_name, disks,
386 exclusive])[node])
387
390 """Wrapper for RPC call 'blockdev_pause_resume_sync'
391
392 Request a pause/resume of given block device
393
394 @note: This is a single-node call with a timeout of 15m 0s
395 @type node: string
396 @param node: Node name
397
398 """
399 return (self._Call(_def, [node], [disks, pause])[node])
400
403 """Wrapper for RPC call 'blockdev_remove'
404
405 Request removal of a given block device
406
407 @note: This is a single-node call with a timeout of 15m 0s
408 @type node: string
409 @param node: Node name
410
411 """
412 return (self._Call(_def, [node], [bdev])[node])
413
416 """Wrapper for RPC call 'blockdev_removechildren'
417
418 Request removing a list of children from a (mirroring) device
419
420 @note: This is a single-node call with a timeout of 15m 0s
421 @type node: string
422 @param node: Node name
423
424 """
425 return (self._Call(_def, [node], [bdev, ndevs])[node])
426
429 """Wrapper for RPC call 'blockdev_rename'
430
431 Request rename of the given block devices
432
433 @note: This is a single-node call with a timeout of 15m 0s
434 @type node: string
435 @param node: Node name
436
437 """
438 return (self._Call(_def, [node], [devlist])[node])
439
442 """Wrapper for RPC call 'blockdev_setinfo'
443
444 Sets metadata information on a given block device
445
446 @note: This is a single-node call with a timeout of 15m 0s
447 @type node: string
448 @param node: Node name
449
450 """
451 return (self._Call(_def, [node], [disk, info])[node])
452
455 """Wrapper for RPC call 'blockdev_shutdown'
456
457 Request shutdown of a given block device
458
459 @note: This is a single-node call with a timeout of 15m 0s
460 @type node: string
461 @param node: Node name
462
463 """
464 return (self._Call(_def, [node], [disk])[node])
465
468 """Wrapper for RPC call 'blockdev_snapshot'
469
470 Export a given disk to another node
471
472 @note: This is a single-node call with a timeout of 15m 0s
473 @type node: string
474 @param node: Node name
475
476 """
477 return (self._Call(_def, [node], [cf_bdev, snap_name,
478 snap_size])[node])
479
482 """Wrapper for RPC call 'blockdev_wipe'
483
484 Request wipe at given offset with given size of a block device
485
486 @note: This is a single-node call with a timeout of 1h 0m 0s
487 @type node: string
488 @param node: Node name
489
490 """
491 return (self._Call(_def, [node], [bdev, offset, size])[node])
492
495 """Wrapper for RPC call 'bridges_exist'
496
497 Checks if a node has all the bridges given
498
499 @note: This is a single-node call with a timeout of 1m 0s
500 @type node: string
501 @param node: Node name
502 @param bridges_list: Bridges which must be present on remote node
503
504 """
505 return (self._Call(_def, [node], [bridges_list])[node])
506
509 """Wrapper for RPC call 'drbd_attach_net'
510
511 Connects the given DRBD devices
512
513 @note: This is a multi-node call with a timeout of 15m 0s
514 @type node_list: list of string
515 @param node_list: List of node names
516
517 """
518 return (self._Call(_def, node_list, [disks, multimaster]))
519
522 """Wrapper for RPC call 'drbd_disconnect_net'
523
524 Disconnects the network of the given drbd devices
525
526 @note: This is a multi-node call with a timeout of 15m 0s
527 @type node_list: list of string
528 @param node_list: List of node names
529
530 """
531 return (self._Call(_def, node_list, [disks]))
532
534 """Wrapper for RPC call 'drbd_helper'
535
536 Gets DRBD helper
537
538 @note: This is a multi-node call with a timeout of 1m 0s
539 @type node_list: list of string
540 @param node_list: List of node names
541
542 """
543 return (self._Call(_def, node_list, []))
544
547 """Wrapper for RPC call 'drbd_needs_activation'
548
549 Returns the drbd disks which need activation
550
551 @note: This is a single-node call with a timeout of 15m 0s
552 @type node: string
553 @param node: Node name
554
555 """
556 return (self._Call(_def, [node], [disks])[node])
557
560 """Wrapper for RPC call 'drbd_wait_sync'
561
562 Waits for the synchronization of drbd devices is complete
563
564 @note: This is a multi-node call with a timeout of 1h 0m 0s
565 @type node_list: list of string
566 @param node_list: List of node names
567
568 """
569 return (self._Call(_def, node_list, [disks]))
570
573 """Wrapper for RPC call 'etc_hosts_modify'
574
575 Modify hosts file with name
576
577 @note: This is a single-node call with a timeout of 15m 0s
578 @type node: string
579 @param node: Node name
580 @param mode: Mode to operate; currently L{constants.ETC_HOSTS_ADD} or
581 L{constants.ETC_HOSTS_REMOVE}
582 @param name: Hostname to be modified
583 @param ip: IP address (L{constants.ETC_HOSTS_ADD} only)
584
585 """
586 return (self._Call(_def, [node], [mode, name, ip])[node])
587
589 """Wrapper for RPC call 'export_info'
590
591 Queries the export information in a given path
592
593 @note: This is a single-node call with a timeout of 5m 0s
594 @type node: string
595 @param node: Node name
596
597 """
598 return (self._Call(_def, [node], [path])[node])
599
601 """Wrapper for RPC call 'export_list'
602
603 Gets the stored exports list
604
605 @note: This is a multi-node call with a timeout of 5m 0s
606 @type node_list: list of string
607 @param node_list: List of node names
608
609 """
610 return (self._Call(_def, node_list, []))
611
614 """Wrapper for RPC call 'export_remove'
615
616 Requests removal of a given export
617
618 @note: This is a single-node call with a timeout of 5m 0s
619 @type node: string
620 @param node: Node name
621
622 """
623 return (self._Call(_def, [node], [export])[node])
624
625 - def call_export_start(self, node, opts, host, port, instance,
626 component, source, _def=_CALLS['export_start']):
627 """Wrapper for RPC call 'export_start'
628
629 Starts an export daemon
630
631 @note: This is a single-node call with a timeout of 15m 0s
632 @type node: string
633 @param node: Node name
634 @param source: Export source
635
636 """
637 return (self._Call(_def, [node], [opts, host, port, instance,
638 component, source])[node])
639
642 """Wrapper for RPC call 'extstorage_diagnose'
643
644 Request a diagnose of ExtStorage Providers
645
646 @note: This is a multi-node call with a timeout of 5m 0s
647 @type node_list: list of string
648 @param node_list: List of node names
649
650 """
651 return (self._Call(_def, node_list, []))
652
655 """Wrapper for RPC call 'file_storage_dir_create'
656
657 Create the given file storage directory
658
659 @note: This is a single-node call with a timeout of 5m 0s
660 @type node: string
661 @param node: Node name
662 @param file_storage_dir: File storage directory
663
664 """
665 return (self._Call(_def, [node], [file_storage_dir])[node])
666
669 """Wrapper for RPC call 'file_storage_dir_remove'
670
671 Remove the given file storage directory
672
673 @note: This is a single-node call with a timeout of 5m 0s
674 @type node: string
675 @param node: Node name
676 @param file_storage_dir: File storage directory
677
678 """
679 return (self._Call(_def, [node], [file_storage_dir])[node])
680
683 """Wrapper for RPC call 'file_storage_dir_rename'
684
685 Rename file storage directory
686
687 @note: This is a single-node call with a timeout of 5m 0s
688 @type node: string
689 @param node: Node name
690 @param old_file_storage_dir: Old name
691 @param new_file_storage_dir: New name
692
693 """
694 return (self._Call(_def, [node], [old_file_storage_dir,
695 new_file_storage_dir])[node])
696
699 """Wrapper for RPC call 'finalize_export'
700
701 Request the completion of an export operation
702
703 @note: This is a single-node call with a timeout of 15m 0s
704 @type node: string
705 @param node: Node name
706
707 """
708 return (self._Call(_def, [node], [instance, snap_disks])[node])
709
712 """Wrapper for RPC call 'get_file_info'
713
714 Checks if a file exists and reports on it
715
716 @note: This is a single-node call with a timeout of 5m 0s
717 @type node: string
718 @param node: Node name
719
720 """
721 return (self._Call(_def, [node], [file_path])[node])
722
725 """Wrapper for RPC call 'get_watcher_pause'
726
727 Get watcher pause end
728
729 @note: This is a single-node call with a timeout of 1m 0s
730 @type node: string
731 @param node: Node name
732
733 """
734 return (self._Call(_def, [node], [])[node])
735
738 """Wrapper for RPC call 'hooks_runner'
739
740 Call the hooks runner
741
742 @note: This is a multi-node call with a timeout of 15m 0s
743 @type node_list: list of string
744 @param node_list: List of node names
745
746 """
747 return (self._Call(_def, node_list, [hpath, phase, env]))
748
751 """Wrapper for RPC call 'hotplug_device'
752
753 Hoplug a device to a running instance
754
755 @note: This is a single-node call with a timeout of 15m 0s
756 @type node: string
757 @param node: Node name
758 @param instance: Instance object
759 @param action: Hotplug Action
760 @param dev_type: Device type
761 @param device: Device dict
762 @param extra: Extra info for device (dev_path for disk)
763 @param seq: Device seq
764
765 """
766 return (self._Call(_def, [node], [instance, action, dev_type, device,
767 extra, seq])[node])
768
771 """Wrapper for RPC call 'hotplug_supported'
772
773 Check if hotplug is supported
774
775 @note: This is a single-node call with a timeout of 15m 0s
776 @type node: string
777 @param node: Node name
778 @param instance: Instance object
779
780 """
781 return (self._Call(_def, [node], [instance])[node])
782
785 """Wrapper for RPC call 'hypervisor_validate_params'
786
787 Validate hypervisor params
788
789 @note: This is a multi-node call with a timeout of 15m 0s
790 @type node_list: list of string
791 @param node_list: List of node names
792 @param hvname: Hypervisor name
793 @param hvfull: Parameters to be validated
794
795 """
796 return (self._Call(_def, node_list, [hvname, hvfull]))
797
800 """Wrapper for RPC call 'iallocator_runner'
801
802 Call an iallocator on a remote node
803
804 @note: This is a single-node call with a timeout of 15m 0s
805 @type node: string
806 @param node: Node name
807 @param name: Iallocator name
808 @param idata: JSON-encoded input string
809 @param default_iallocator_params: Additional iallocator parameters
810
811 """
812 return (self._Call(_def, [node], [name, idata,
813 default_iallocator_params])[node])
814
816 """Wrapper for RPC call 'impexp_abort'
817
818 Aborts an import or export
819
820 @note: This is a single-node call with a timeout of 15m 0s
821 @type node: string
822 @param node: Node name
823 @param name: Import/export name
824
825 """
826 return (self._Call(_def, [node], [name])[node])
827
830 """Wrapper for RPC call 'impexp_cleanup'
831
832 Cleans up after an import or export
833
834 @note: This is a single-node call with a timeout of 15m 0s
835 @type node: string
836 @param node: Node name
837 @param name: Import/export name
838
839 """
840 return (self._Call(_def, [node], [name])[node])
841
844 """Wrapper for RPC call 'impexp_status'
845
846 Gets the status of an import or export
847
848 @note: This is a single-node call with a timeout of 5m 0s
849 @type node: string
850 @param node: Node name
851 @param names: Import/export names
852
853 """
854 return (self._Call(_def, [node], [names])[node])
855
858 """Wrapper for RPC call 'import_start'
859
860 Starts an import daemon
861
862 @note: This is a single-node call with a timeout of 15m 0s
863 @type node: string
864 @param node: Node name
865 @param dest: Import destination
866
867 """
868 return (self._Call(_def, [node], [opts, instance, component,
869 dest])[node])
870
873 """Wrapper for RPC call 'instance_balloon_memory'
874
875 Modify the amount of an instance's runtime memory
876
877 @note: This is a single-node call with a timeout of 15m 0s
878 @type node: string
879 @param node: Node name
880 @param instance: Instance object
881
882 """
883 return (self._Call(_def, [node], [instance, memory])[node])
884
887 """Wrapper for RPC call 'instance_finalize_migration_dst'
888
889 Finalize any target-node migration specific operation
890
891 @note: This is a single-node call with a timeout of 15m 0s
892 @type node: string
893 @param node: Node name
894 @param instance: Instance object
895 @param info: Result for the call_migration_info call
896 @param success: Whether the migration was a success or failure
897
898 """
899 return (self._Call(_def, [node], [instance, info, success])[node])
900
903 """Wrapper for RPC call 'instance_finalize_migration_src'
904
905 Finalize the instance migration on the source node
906
907 @note: This is a single-node call with a timeout of 1h 0m 0s
908 @type node: string
909 @param node: Node name
910 @param instance: Instance object
911 @param success: Whether the migration succeeded or not
912 @param live: Whether the user requested a live migration or not
913
914 """
915 return (self._Call(_def, [node], [instance, success, live])[node])
916
919 """Wrapper for RPC call 'instance_get_migration_status'
920
921 Report migration status
922
923 @note: This is a single-node call with a timeout of 1h 0m 0s
924 @type node: string
925 @param node: Node name
926 @param instance: Instance object
927
928 """
929 return (self._Call(_def, [node], [instance])[node])
930
933 """Wrapper for RPC call 'instance_info'
934
935 Returns information about a single instance
936
937 @note: This is a single-node call with a timeout of 1m 0s
938 @type node: string
939 @param node: Node name
940 @param instance: Instance name
941 @param hname: Hypervisor type
942 @param hvparams: Hypervisor parameters
943
944 """
945 return (self._Call(_def, [node], [instance, hname, hvparams])[node])
946
949 """Wrapper for RPC call 'instance_list'
950
951 Returns the list of running instances on the given nodes
952
953 @note: This is a multi-node call with a timeout of 1m 0s
954 @type node_list: list of string
955 @param node_list: List of node names
956 @param hypervisor_list: Hypervisors to query for instances
957 @param hvparams: Hvparams of all hypervisors
958
959 """
960 return (self._Call(_def, node_list, [hypervisor_list, hvparams]))
961
975
978 """Wrapper for RPC call 'instance_migratable'
979
980 Checks whether the given instance can be migrated
981
982 @note: This is a single-node call with a timeout of 15m 0s
983 @type node: string
984 @param node: Node name
985 @param instance: Instance object
986
987 """
988 return (self._Call(_def, [node], [instance])[node])
989
992 """Wrapper for RPC call 'instance_migrate'
993
994 Migrate an instance
995
996 @note: This is a single-node call with a timeout of 1h 0m 0s
997 @type node: string
998 @param node: Node name
999 @param cluster_name: Cluster name
1000 @param instance: Instance object
1001 @param target: Target node name
1002 @param live: Whether the migration should be done live or not
1003
1004 """
1005 return (self._Call(_def, [node], [cluster_name, instance, target,
1006 live])[node])
1007
1010 """Wrapper for RPC call 'instance_os_add'
1011
1012 Installs an operative system onto an instance
1013
1014 @note: This is a single-node call with a timeout of 1d 0h 0m 0s
1015 @type node: string
1016 @param node: Node name
1017 @param instance_osp: Tuple: (target instance, temporary OS parameters
1018 overriding configuration)
1019 @param reinstall: Whether the instance is being reinstalled
1020 @param debug: Debug level for the OS install script to use
1021
1022 """
1023 return (self._Call(_def, [node], [instance_osp, reinstall,
1024 debug])[node])
1025
1028 """Wrapper for RPC call 'instance_reboot'
1029
1030 Returns the list of running instances on the given nodes
1031
1032 @note: This is a single-node call with a timeout of 15m 0s
1033 @type node: string
1034 @param node: Node name
1035 @param inst: Instance object
1036 @param reason: The reason for the reboot
1037
1038 """
1039 return (self._Call(_def, [node], [inst, reboot_type, shutdown_timeout,
1040 reason])[node])
1041
1044 """Wrapper for RPC call 'instance_run_rename'
1045
1046 Run the OS rename script for an instance
1047
1048 @note: This is a single-node call with a timeout of 1h 0m 0s
1049 @type node: string
1050 @param node: Node name
1051 @param instance: Instance object
1052
1053 """
1054 return (self._Call(_def, [node], [instance, old_name, debug])[node])
1055
1058 """Wrapper for RPC call 'instance_shutdown'
1059
1060 Stops an instance
1061
1062 @note: This is a single-node call with a timeout of 15m 0s
1063 @type node: string
1064 @param node: Node name
1065 @param instance: Instance object
1066 @param reason: The reason for the shutdown
1067
1068 """
1069 return (self._Call(_def, [node], [instance, timeout, reason])[node])
1070
1073 """Wrapper for RPC call 'instance_start'
1074
1075 Starts an instance
1076
1077 @note: This is a single-node call with a timeout of 15m 0s
1078 @type node: string
1079 @param node: Node name
1080 @param reason: The reason for the startup
1081
1082 """
1083 return (self._Call(_def, [node], [instance_hvp_bep, startup_paused,
1084 reason])[node])
1085
1087 """Wrapper for RPC call 'lv_list'
1088
1089 Gets the logical volumes present in a given volume group
1090
1091 @note: This is a multi-node call with a timeout of 1m 0s
1092 @type node_list: list of string
1093 @param node_list: List of node names
1094
1095 """
1096 return (self._Call(_def, node_list, [vg_name]))
1097
1100 """Wrapper for RPC call 'migration_info'
1101
1102 Gather the information necessary to prepare an instance migration
1103
1104 @note: This is a single-node call with a timeout of 15m 0s
1105 @type node: string
1106 @param node: Node name
1107 @param instance: Instance object
1108
1109 """
1110 return (self._Call(_def, [node], [instance])[node])
1111
1126
1129 """Wrapper for RPC call 'node_crypto_tokens'
1130
1131 Handle crypto tokens of the node.
1132
1133 @note: This is a single-node call with a timeout of 1h 0m 0s
1134 @type node: string
1135 @param node: Node name
1136 @param token_request: List of tuples of requested crypto token types,
1137 actions
1138
1139 """
1140 return (self._Call(_def, [node], [token_request])[node])
1141
1144 """Wrapper for RPC call 'node_demote_from_mc'
1145
1146 Demote a node from the master candidate role
1147
1148 @note: This is a single-node call with a timeout of 5m 0s
1149 @type node: string
1150 @param node: Node name
1151
1152 """
1153 return (self._Call(_def, [node], [])[node])
1154
1157 """Wrapper for RPC call 'node_ensure_daemon'
1158
1159 Ensure daemon is running on the node.
1160
1161 @note: This is a multi-node call with a timeout of 1m 0s
1162 @type node_list: list of string
1163 @param node_list: List of node names
1164 @param daemon: Daemon name
1165 @param run: Whether the daemon should be running or stopped
1166
1167 """
1168 return (self._Call(_def, node_list, [daemon, run]))
1169
1172 """Wrapper for RPC call 'node_has_ip_address'
1173
1174 Checks if a node has the given IP address
1175
1176 @note: This is a single-node call with a timeout of 5m 0s
1177 @type node: string
1178 @param node: Node name
1179 @param address: IP address
1180
1181 """
1182 return (self._Call(_def, [node], [address])[node])
1183
1186 """Wrapper for RPC call 'node_info'
1187
1188 Return node information
1189
1190 @note: This is a multi-node call with a timeout of 1m 0s
1191 @type node_list: list of string
1192 @param node_list: List of node names
1193 @param storage_units: List of tuples '<storage_type>,<key>,[<param>]'
1194 to ask for disk space information; the parameter list varies
1195 depending on the storage_type
1196 @param hv_specs: List of hypervisor specification (name, hvparams) to
1197 ask for node information
1198
1199 """
1200 return (self._Call(_def, node_list, [storage_units, hv_specs]))
1201
1204 """Wrapper for RPC call 'node_powercycle'
1205
1206 Tries to powercycle a node
1207
1208 @note: This is a single-node call with a timeout of 15m 0s
1209 @type node: string
1210 @param node: Node name
1211 @param hypervisor: Hypervisor type
1212 @param hvparams: Hypervisor parameters
1213
1214 """
1215 return (self._Call(_def, [node], [hypervisor, hvparams])[node])
1216
1217 - def call_node_ssh_key_add(self, node_list, node_uuid, node_name,
1218 potential_master_candidates, to_authorized_keys, to_public_keys,
1219 get_public_keys, _def=_CALLS['node_ssh_key_add']):
1220 """Wrapper for RPC call 'node_ssh_key_add'
1221
1222 Distribute a new node's public SSH key on the cluster.
1223
1224 @note: This is a multi-node call with a timeout of 5m 0s
1225 @type node_list: list of string
1226 @param node_list: List of node names
1227 @param node_uuid: UUID of the node whose key is distributed
1228 @param node_name: Name of the node whose key is distributed
1229 @param potential_master_candidates: Potential master candidates
1230 @param to_authorized_keys: Whether the node's key should be added to
1231 all nodes' 'authorized_keys' file
1232 @param to_public_keys: Whether the node's key should be added to all
1233 nodes' public key file
1234 @param get_public_keys: Whether the node should get the other nodes'
1235 public keys
1236
1237 """
1238 return (self._Call(_def, node_list, [node_uuid, node_name,
1239 potential_master_candidates, to_authorized_keys, to_public_keys,
1240 get_public_keys]))
1241
1242 - def call_node_ssh_key_remove(self, node_list, node_uuid, node_name,
1243 master_candidate_uuids, potential_master_candidates,
1244 from_authorized_keys, from_public_keys, clear_authorized_keys,
1245 clear_public_keys, readd, _def=_CALLS['node_ssh_key_remove']):
1246 """Wrapper for RPC call 'node_ssh_key_remove'
1247
1248 Remove a node's SSH key from the other nodes' key files.
1249
1250 @note: This is a multi-node call with a timeout of 5m 0s
1251 @type node_list: list of string
1252 @param node_list: List of node names
1253 @param node_uuid: UUID of the node whose key is removed
1254 @param node_name: Name of the node whose key is removed
1255 @param master_candidate_uuids: List of UUIDs of master candidates.
1256 @param potential_master_candidates: Potential master candidates
1257 @param from_authorized_keys: If the key should be removed from the
1258 'authorized_keys' file.
1259 @param from_public_keys: If the key should be removed from the public
1260 key file.
1261 @param clear_authorized_keys: If the 'authorized_keys' file of the
1262 node should be cleared.
1263 @param clear_public_keys: If the 'ganeti_pub_keys' file of the node
1264 should be cleared.
1265 @param readd: Whether this is a readd operation.
1266
1267 """
1268 return (self._Call(_def, node_list, [node_uuid, node_name,
1269 master_candidate_uuids, potential_master_candidates,
1270 from_authorized_keys, from_public_keys, clear_authorized_keys,
1271 clear_public_keys, readd]))
1272
1273 - def call_node_ssh_keys_renew(self, node_list, node_uuids, node_names,
1274 master_candidate_uuids, potential_master_candidates, old_key_type,
1275 new_key_type, new_key_bits, _def=_CALLS['node_ssh_keys_renew']):
1276 """Wrapper for RPC call 'node_ssh_keys_renew'
1277
1278 Renew all SSH key pairs of all nodes nodes.
1279
1280 @note: This is a multi-node call with a timeout of 4h 0m 0s
1281 @type node_list: list of string
1282 @param node_list: List of node names
1283 @param node_uuids: UUIDs of the nodes whose key is renewed
1284 @param node_names: Names of the nodes whose key is renewed
1285 @param master_candidate_uuids: List of UUIDs of master candidates.
1286 @param potential_master_candidates: Potential master candidates
1287 @param old_key_type: The type of key previously used
1288 @param new_key_type: The type of key to generate
1289 @param new_key_bits: The length of the key to generate
1290
1291 """
1292 return (self._Call(_def, node_list, [node_uuids, node_names,
1293 master_candidate_uuids, potential_master_candidates, old_key_type,
1294 new_key_type, new_key_bits]))
1295
1296 - def call_node_verify(self, node_list, checkdict, cluster_name,
1297 all_hvparams, _def=_CALLS['node_verify']):
1298 """Wrapper for RPC call 'node_verify'
1299
1300 Request verification of given parameters
1301
1302 @note: This is a multi-node call with a timeout of 15m 0s
1303 @type node_list: list of string
1304 @param node_list: List of node names
1305 @param checkdict: What to verify
1306 @param cluster_name: Cluster name
1307 @param all_hvparams: Dictionary mapping hypervisor names to hvparams
1308
1309 """
1310 return (self._Call(_def, node_list, [checkdict, cluster_name,
1311 all_hvparams]))
1312
1314 """Wrapper for RPC call 'node_volumes'
1315
1316 Gets all volumes on node(s)
1317
1318 @note: This is a multi-node call with a timeout of 5m 0s
1319 @type node_list: list of string
1320 @param node_list: List of node names
1321
1322 """
1323 return (self._Call(_def, node_list, []))
1324
1326 """Wrapper for RPC call 'os_diagnose'
1327
1328 Request a diagnose of OS definitions
1329
1330 @note: This is a multi-node call with a timeout of 5m 0s
1331 @type node_list: list of string
1332 @param node_list: List of node names
1333
1334 """
1335 return (self._Call(_def, node_list, []))
1336
1339 """Wrapper for RPC call 'os_export'
1340
1341 Export an OS for a given instance
1342
1343 @note: This is a single-node call with a timeout of 5m 0s
1344 @type node: string
1345 @param node: Node name
1346
1347 """
1348 return (self._Call(_def, [node], [instance, override_env])[node])
1349
1350 - def call_os_validate(self, node_list, required, name, checks, params,
1351 force_variant, _def=_CALLS['os_validate']):
1352 """Wrapper for RPC call 'os_validate'
1353
1354 Run a validation routine for a given OS
1355
1356 @note: This is a multi-node call with a timeout of 5m 0s
1357 @type node_list: list of string
1358 @param node_list: List of node names
1359
1360 """
1361 return (self._Call(_def, node_list, [required, name, checks, params,
1362 force_variant]))
1363
1366 """Wrapper for RPC call 'restricted_command'
1367
1368 Runs restricted command
1369
1370 @note: This is a multi-node call with a timeout of 1h 0m 0s
1371 @type node_list: list of string
1372 @param node_list: List of node names
1373 @param cmd: Command name
1374
1375 """
1376 return (self._Call(_def, node_list, [cmd]))
1377
1378 - def call_run_oob(self, node, oob_program, command, remote_node,
1379 timeout, _def=_CALLS['run_oob']):
1380 """Wrapper for RPC call 'run_oob'
1381
1382 Runs out-of-band command
1383
1384 @note: This is a single-node call with a timeout of 15m 0s
1385 @type node: string
1386 @param node: Node name
1387
1388 """
1389 return (self._Call(_def, [node], [oob_program, command, remote_node,
1390 timeout])[node])
1391
1394 """Wrapper for RPC call 'set_watcher_pause'
1395
1396 Set watcher pause end
1397
1398 @note: This is a multi-node call with a timeout of 1m 0s
1399 @type node_list: list of string
1400 @param node_list: List of node names
1401
1402 """
1403 return (self._Call(_def, node_list, [until]))
1404
1407 """Wrapper for RPC call 'storage_execute'
1408
1409 Executes an operation on a storage unit
1410
1411 @note: This is a single-node call with a timeout of 15m 0s
1412 @type node: string
1413 @param node: Node name
1414
1415 """
1416 return (self._Call(_def, [node], [su_name, su_args, name, op])[node])
1417
1420 """Wrapper for RPC call 'storage_list'
1421
1422 Get list of storage units
1423
1424 @note: This is a multi-node call with a timeout of 15m 0s
1425 @type node_list: list of string
1426 @param node_list: List of node names
1427
1428 """
1429 return (self._Call(_def, node_list, [su_name, su_args, name, fields]))
1430
1433 """Wrapper for RPC call 'storage_modify'
1434
1435 Modify a storage unit
1436
1437 @note: This is a single-node call with a timeout of 15m 0s
1438 @type node: string
1439 @param node: Node name
1440
1441 """
1442 return (self._Call(_def, [node], [su_name, su_args, name,
1443 changes])[node])
1444
1447 """Wrapper for RPC call 'test_delay'
1448
1449 Sleep for a fixed time on given node(s)
1450
1451 @note: This is a multi-node call
1452 @type node_list: list of string
1453 @param node_list: List of node names
1454
1455 """
1456 return (self._Call(_def, node_list, [duration]))
1457
1459 """Wrapper for RPC call 'vg_list'
1460
1461 Gets the volume group list
1462
1463 @note: This is a multi-node call with a timeout of 1m 0s
1464 @type node_list: list of string
1465 @param node_list: List of node names
1466
1467 """
1468 return (self._Call(_def, node_list, []))
1469
1472 """Wrapper for RPC call 'x509_cert_create'
1473
1474 Creates a new X509 certificate for SSL/TLS
1475
1476 @note: This is a single-node call with a timeout of 15m 0s
1477 @type node: string
1478 @param node: Node name
1479 @param validity: Validity in seconds
1480
1481 """
1482 return (self._Call(_def, [node], [validity])[node])
1483
1486 """Wrapper for RPC call 'x509_cert_remove'
1487
1488 Removes a X509 certificate
1489
1490 @note: This is a single-node call with a timeout of 15m 0s
1491 @type node: string
1492 @param node: Node name
1493 @param name: Certificate name
1494
1495 """
1496 return (self._Call(_def, [node], [name])[node])
1497
1498
1500
1501
1502
1503 _CALLS = rpc_defs.CALLS['RpcClientDnsOnly']
1504
1507 """Wrapper for RPC call 'node_verify_light'
1508
1509 Request verification of given parameters
1510
1511 @note: This is a multi-node call with a timeout of 15m 0s
1512 @type node_list: list of string
1513 @param node_list: List of node names
1514 @param checkdict: What to verify
1515 @param cluster_name: Cluster name
1516 @param hvparams: Dictionary mapping hypervisor names to hvparams
1517
1518 """
1519 return (self._Call(_def, node_list, [checkdict, cluster_name,
1520 hvparams]))
1521
1523 """Wrapper for RPC call 'version'
1524
1525 Query node version
1526
1527 @note: This is a multi-node call with a timeout of 1m 0s
1528 @type node_list: list of string
1529 @param node_list: List of node names
1530
1531 """
1532 return (self._Call(_def, node_list, []))
1533
1534
1536
1537
1538
1539 _CALLS = rpc_defs.CALLS['RpcClientJobQueue']
1540
1542 """Wrapper for RPC call 'jobqueue_purge'
1543
1544 Purge job queue
1545
1546 @note: This is a single-node call with a timeout of 15m 0s
1547 @type node: string
1548 @param node: Node name
1549
1550 """
1551 return (self._Call(_def, [node], [])[node])
1552
1555 """Wrapper for RPC call 'jobqueue_rename'
1556
1557 Rename job queue file
1558
1559 @note: This is a multi-node call with a timeout of 1m 0s
1560 @type node_list: list of string
1561 @param node_list: List of node names
1562
1563 """
1564 return (self._Call(_def, node_list, [rename]))
1565
1568 """Wrapper for RPC call 'jobqueue_set_drain_flag'
1569
1570 Set job queue drain flag
1571
1572 @note: This is a multi-node call with a timeout of 1m 0s
1573 @type node_list: list of string
1574 @param node_list: List of node names
1575
1576 """
1577 return (self._Call(_def, node_list, [flag]))
1578
1581 """Wrapper for RPC call 'jobqueue_update'
1582
1583 Update job queue file
1584
1585 @note: This is a multi-node call with a timeout of 1m 0s
1586 @type node_list: list of string
1587 @param node_list: List of node names
1588
1589 """
1590 return (self._Call(_def, node_list, [file_name, content]))
1591