4 # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 """RPC definitions for communication between master and node daemons.
23 RPC definition fields:
26 - L{SINGLE} for single-node calls, L{MULTI} for multi-node
27 - Name resolver option(s), can be callable receiving all arguments in a tuple
28 - Timeout (e.g. L{constants.RPC_TMO_NORMAL}), or callback receiving all
29 arguments in a tuple to calculate timeout
30 - List of arguments as tuples
33 - Argument kind used for encoding/decoding
34 - Description for docstring (can be C{None})
36 - Custom body encoder (e.g. for preparing per-node bodies)
37 - Return value wrapper (e.g. for deserializing into L{objects}-based objects)
38 - Short call description for docstring
42 from ganeti import constants
43 from ganeti import utils
44 from ganeti import objects
47 # Guidelines for choosing timeouts:
48 # - call used during watcher: timeout of 1min, constants.RPC_TMO_URGENT
49 # - trivial (but be sure it is trivial)
50 # (e.g. reading a file): 5min, constants.RPC_TMO_FAST
51 # - other calls: 15 min, constants.RPC_TMO_NORMAL
52 # - special calls (instance add, etc.):
53 # either constants.RPC_TMO_SLOW (1h) or huge timeouts
55 SINGLE = "single-node"
58 ACCEPT_OFFLINE_NODE = object()
60 # Constants for encoding/decoding
64 ED_INST_DICT_HVP_BEP_DP,
69 ED_FINALIZE_EXPORT_DISKS,
73 ED_SINGLE_DISK_DICT_DP,
75 ED_DEVICE_DICT) = range(1, 16)
79 """Converts list of calls to dictionary.
82 return utils.SequenceToDict(calls)
85 def _MigrationStatusPostProc(result):
86 """Post-processor for L{rpc.RpcRunner.call_instance_get_migration_status}.
89 if not result.fail_msg and result.payload is not None:
90 result.payload = objects.MigrationStatus.FromDict(result.payload)
94 def _BlockdevFindPostProc(result):
95 """Post-processor for L{rpc.RpcRunner.call_blockdev_find}.
98 if not result.fail_msg and result.payload is not None:
99 result.payload = objects.BlockDevStatus.FromDict(result.payload)
103 def _BlockdevGetMirrorStatusPostProc(result):
104 """Post-processor for L{rpc.RpcRunner.call_blockdev_getmirrorstatus}.
107 if not result.fail_msg:
108 result.payload = map(objects.BlockDevStatus.FromDict, result.payload)
112 def _BlockdevGetMirrorStatusMultiPreProc(node, args):
113 """Prepares the appropriate node values for blockdev_getmirrorstatus_multi.
116 # there should be only one argument to this RPC, already holding a
117 # node->disks dictionary, we just need to extract the value for the
119 assert len(args) == 1
120 return [args[0][node]]
123 def _BlockdevGetMirrorStatusMultiPostProc(result):
124 """Post-processor for L{rpc.RpcRunner.call_blockdev_getmirrorstatus_multi}.
127 if not result.fail_msg:
128 for idx, (success, status) in enumerate(result.payload):
130 result.payload[idx] = (success, objects.BlockDevStatus.FromDict(status))
135 def _NodeInfoPreProc(node, args):
136 """Prepare the exclusive_storage argument for node_info calls."""
137 assert len(args) == 3
138 # The third argument is either a dictionary with one value for each node, or
139 # a fixed value to be used for all the nodes
140 if type(args[2]) is dict:
141 return [args[0], args[1], args[2][node]]
146 def _OsGetPostProc(result):
147 """Post-processor for L{rpc.RpcRunner.call_os_get}.
150 if not result.fail_msg and isinstance(result.payload, dict):
151 result.payload = objects.OS.FromDict(result.payload)
155 def _ImpExpStatusPostProc(result):
156 """Post-processor for import/export status.
158 @rtype: Payload containing list of L{objects.ImportExportStatus} instances
159 @return: Returns a list of the state of each named import/export or None if
160 a status couldn't be retrieved
163 if not result.fail_msg:
166 for i in result.payload:
170 decoded.append(objects.ImportExportStatus.FromDict(i))
172 result.payload = decoded
177 def _TestDelayTimeout((duration, )):
178 """Calculate timeout for "test_delay" RPC.
181 return int(duration + 5)
184 _FILE_STORAGE_CALLS = [
185 ("file_storage_dir_create", SINGLE, None, constants.RPC_TMO_FAST, [
186 ("file_storage_dir", None, "File storage directory"),
187 ], None, None, "Create the given file storage directory"),
188 ("file_storage_dir_remove", SINGLE, None, constants.RPC_TMO_FAST, [
189 ("file_storage_dir", None, "File storage directory"),
190 ], None, None, "Remove the given file storage directory"),
191 ("file_storage_dir_rename", SINGLE, None, constants.RPC_TMO_FAST, [
192 ("old_file_storage_dir", None, "Old name"),
193 ("new_file_storage_dir", None, "New name"),
194 ], None, None, "Rename file storage directory"),
198 ("storage_list", MULTI, None, constants.RPC_TMO_NORMAL, [
199 ("su_name", None, None),
200 ("su_args", None, None),
201 ("name", None, None),
202 ("fields", None, None),
203 ], None, None, "Get list of storage units"),
204 ("storage_modify", SINGLE, None, constants.RPC_TMO_NORMAL, [
205 ("su_name", None, None),
206 ("su_args", None, None),
207 ("name", None, None),
208 ("changes", None, None),
209 ], None, None, "Modify a storage unit"),
210 ("storage_execute", SINGLE, None, constants.RPC_TMO_NORMAL, [
211 ("su_name", None, None),
212 ("su_args", None, None),
213 ("name", None, None),
215 ], None, None, "Executes an operation on a storage unit"),
219 ("instance_info", SINGLE, None, constants.RPC_TMO_URGENT, [
220 ("instance", None, "Instance name"),
221 ("hname", None, "Hypervisor type"),
222 ], None, None, "Returns information about a single instance"),
223 ("all_instances_info", MULTI, None, constants.RPC_TMO_URGENT, [
224 ("hypervisor_list", None, "Hypervisors to query for instances"),
226 "Returns information about all instances on the given nodes"),
227 ("instance_list", MULTI, None, constants.RPC_TMO_URGENT, [
228 ("hypervisor_list", None, "Hypervisors to query for instances"),
229 ], None, None, "Returns the list of running instances on the given nodes"),
230 ("instance_reboot", SINGLE, None, constants.RPC_TMO_NORMAL, [
231 ("inst", ED_INST_DICT, "Instance object"),
232 ("reboot_type", None, None),
233 ("shutdown_timeout", None, None),
234 ("reason", None, "The reason for the reboot"),
235 ], None, None, "Returns the list of running instances on the given nodes"),
236 ("instance_shutdown", SINGLE, None, constants.RPC_TMO_NORMAL, [
237 ("instance", ED_INST_DICT, "Instance object"),
238 ("timeout", None, None),
239 ("reason", None, "The reason for the shutdown"),
240 ], None, None, "Stops an instance"),
241 ("instance_balloon_memory", SINGLE, None, constants.RPC_TMO_NORMAL, [
242 ("instance", ED_INST_DICT, "Instance object"),
243 ("memory", None, None),
244 ], None, None, "Modify the amount of an instance's runtime memory"),
245 ("instance_run_rename", SINGLE, None, constants.RPC_TMO_SLOW, [
246 ("instance", ED_INST_DICT, "Instance object"),
247 ("old_name", None, None),
248 ("debug", None, None),
249 ], None, None, "Run the OS rename script for an instance"),
250 ("instance_migratable", SINGLE, None, constants.RPC_TMO_NORMAL, [
251 ("instance", ED_INST_DICT, "Instance object"),
252 ], None, None, "Checks whether the given instance can be migrated"),
253 ("migration_info", SINGLE, None, constants.RPC_TMO_NORMAL, [
254 ("instance", ED_INST_DICT, "Instance object"),
256 "Gather the information necessary to prepare an instance migration"),
257 ("accept_instance", SINGLE, None, constants.RPC_TMO_NORMAL, [
258 ("instance", ED_INST_DICT, "Instance object"),
259 ("info", None, "Result for the call_migration_info call"),
260 ("target", None, "Target hostname (usually an IP address)"),
261 ], None, None, "Prepare a node to accept an instance"),
262 ("instance_finalize_migration_dst", SINGLE, None, constants.RPC_TMO_NORMAL, [
263 ("instance", ED_INST_DICT, "Instance object"),
264 ("info", None, "Result for the call_migration_info call"),
265 ("success", None, "Whether the migration was a success or failure"),
266 ], None, None, "Finalize any target-node migration specific operation"),
267 ("instance_migrate", SINGLE, None, constants.RPC_TMO_SLOW, [
268 ("instance", ED_INST_DICT, "Instance object"),
269 ("target", None, "Target node name"),
270 ("live", None, "Whether the migration should be done live or not"),
271 ], None, None, "Migrate an instance"),
272 ("instance_finalize_migration_src", SINGLE, None, constants.RPC_TMO_SLOW, [
273 ("instance", ED_INST_DICT, "Instance object"),
274 ("success", None, "Whether the migration succeeded or not"),
275 ("live", None, "Whether the user requested a live migration or not"),
276 ], None, None, "Finalize the instance migration on the source node"),
277 ("instance_get_migration_status", SINGLE, None, constants.RPC_TMO_SLOW, [
278 ("instance", ED_INST_DICT, "Instance object"),
279 ], None, _MigrationStatusPostProc, "Report migration status"),
280 ("instance_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
281 ("instance_hvp_bep", ED_INST_DICT_HVP_BEP_DP, None),
282 ("startup_paused", None, None),
283 ("reason", None, "The reason for the startup"),
284 ], None, None, "Starts an instance"),
285 ("instance_os_add", SINGLE, None, constants.RPC_TMO_1DAY, [
286 ("instance_osp", ED_INST_DICT_OSP_DP, None),
287 ("reinstall", None, None),
288 ("debug", None, None),
289 ], None, None, "Starts an instance"),
290 ("hotplug_device", SINGLE, None, constants.RPC_TMO_NORMAL, [
291 ("instance", ED_INST_DICT, "Instance object"),
292 ("action", None, "Hotplug Action"),
293 ("dev_type", None, "Device type"),
294 ("device", ED_DEVICE_DICT, "Device dict"),
295 ("extra", None, "Extra info for device (dev_path for disk)"),
296 ("seq", None, "Device seq"),
297 ], None, None, "Hoplug a device to a running instance"),
301 ("import_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
302 ("opts", ED_OBJECT_DICT, None),
303 ("instance", ED_INST_DICT, None),
304 ("component", None, None),
305 ("dest", ED_IMPEXP_IO, "Import destination"),
306 ], None, None, "Starts an import daemon"),
307 ("export_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
308 ("opts", ED_OBJECT_DICT, None),
309 ("host", None, None),
310 ("port", None, None),
311 ("instance", ED_INST_DICT, None),
312 ("component", None, None),
313 ("source", ED_IMPEXP_IO, "Export source"),
314 ], None, None, "Starts an export daemon"),
315 ("impexp_status", SINGLE, None, constants.RPC_TMO_FAST, [
316 ("names", None, "Import/export names"),
317 ], None, _ImpExpStatusPostProc, "Gets the status of an import or export"),
318 ("impexp_abort", SINGLE, None, constants.RPC_TMO_NORMAL, [
319 ("name", None, "Import/export name"),
320 ], None, None, "Aborts an import or export"),
321 ("impexp_cleanup", SINGLE, None, constants.RPC_TMO_NORMAL, [
322 ("name", None, "Import/export name"),
323 ], None, None, "Cleans up after an import or export"),
324 ("export_info", SINGLE, None, constants.RPC_TMO_FAST, [
325 ("path", None, None),
326 ], None, None, "Queries the export information in a given path"),
327 ("finalize_export", SINGLE, None, constants.RPC_TMO_NORMAL, [
328 ("instance", ED_INST_DICT, None),
329 ("snap_disks", ED_FINALIZE_EXPORT_DISKS, None),
330 ], None, None, "Request the completion of an export operation"),
331 ("export_list", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
332 "Gets the stored exports list"),
333 ("export_remove", SINGLE, None, constants.RPC_TMO_FAST, [
334 ("export", None, None),
335 ], None, None, "Requests removal of a given export"),
339 ("x509_cert_create", SINGLE, None, constants.RPC_TMO_NORMAL, [
340 ("validity", None, "Validity in seconds"),
341 ], None, None, "Creates a new X509 certificate for SSL/TLS"),
342 ("x509_cert_remove", SINGLE, None, constants.RPC_TMO_NORMAL, [
343 ("name", None, "Certificate name"),
344 ], None, None, "Removes a X509 certificate"),
348 ("bdev_sizes", MULTI, None, constants.RPC_TMO_URGENT, [
349 ("devices", None, None),
351 "Gets the sizes of requested block devices present on a node"),
352 ("blockdev_create", SINGLE, None, constants.RPC_TMO_NORMAL, [
353 ("bdev", ED_OBJECT_DICT, None),
354 ("size", None, None),
355 ("owner", None, None),
356 ("on_primary", None, None),
357 ("info", None, None),
358 ("exclusive_storage", None, None),
359 ], None, None, "Request creation of a given block device"),
360 ("blockdev_wipe", SINGLE, None, constants.RPC_TMO_SLOW, [
361 ("bdev", ED_SINGLE_DISK_DICT_DP, None),
362 ("offset", None, None),
363 ("size", None, None),
365 "Request wipe at given offset with given size of a block device"),
366 ("blockdev_remove", SINGLE, None, constants.RPC_TMO_NORMAL, [
367 ("bdev", ED_OBJECT_DICT, None),
368 ], None, None, "Request removal of a given block device"),
369 ("blockdev_pause_resume_sync", SINGLE, None, constants.RPC_TMO_NORMAL, [
370 ("disks", ED_DISKS_DICT_DP, None),
371 ("pause", None, None),
372 ], None, None, "Request a pause/resume of given block device"),
373 ("blockdev_assemble", SINGLE, None, constants.RPC_TMO_NORMAL, [
374 ("disk", ED_SINGLE_DISK_DICT_DP, None),
375 ("owner", None, None),
376 ("on_primary", None, None),
378 ], None, None, "Request assembling of a given block device"),
379 ("blockdev_shutdown", SINGLE, None, constants.RPC_TMO_NORMAL, [
380 ("disk", ED_SINGLE_DISK_DICT_DP, None),
381 ], None, None, "Request shutdown of a given block device"),
382 ("blockdev_addchildren", SINGLE, None, constants.RPC_TMO_NORMAL, [
383 ("bdev", ED_SINGLE_DISK_DICT_DP, None),
384 ("ndevs", ED_OBJECT_DICT_LIST, None),
386 "Request adding a list of children to a (mirroring) device"),
387 ("blockdev_removechildren", SINGLE, None, constants.RPC_TMO_NORMAL, [
388 ("bdev", ED_OBJECT_DICT, None),
389 ("ndevs", ED_OBJECT_DICT_LIST, None),
391 "Request removing a list of children from a (mirroring) device"),
392 ("blockdev_close", SINGLE, None, constants.RPC_TMO_NORMAL, [
393 ("instance_name", None, None),
394 ("disks", ED_OBJECT_DICT_LIST, None),
395 ], None, None, "Closes the given block devices"),
396 ("blockdev_getsize", SINGLE, None, constants.RPC_TMO_NORMAL, [
397 ("disks", ED_OBJECT_DICT_LIST, None),
398 ], None, None, "Returns the size of the given disks"),
399 ("drbd_disconnect_net", MULTI, None, constants.RPC_TMO_NORMAL, [
400 ("nodes_ip", None, None),
401 ("disks", ED_OBJECT_DICT_LIST, None),
402 ], None, None, "Disconnects the network of the given drbd devices"),
403 ("drbd_attach_net", MULTI, None, constants.RPC_TMO_NORMAL, [
404 ("nodes_ip", None, None),
405 ("disks", ED_DISKS_DICT_DP, None),
406 ("instance_name", None, None),
407 ("multimaster", None, None),
408 ], None, None, "Connects the given DRBD devices"),
409 ("drbd_wait_sync", MULTI, None, constants.RPC_TMO_SLOW, [
410 ("nodes_ip", None, None),
411 ("disks", ED_DISKS_DICT_DP, None),
413 "Waits for the synchronization of drbd devices is complete"),
414 ("blockdev_grow", SINGLE, None, constants.RPC_TMO_NORMAL, [
415 ("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
416 ("amount", None, None),
417 ("dryrun", None, None),
418 ("backingstore", None, None),
419 ], None, None, "Request growing of the given block device by a"
421 ("blockdev_export", SINGLE, None, constants.RPC_TMO_1DAY, [
422 ("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
423 ("dest_node", None, None),
424 ("dest_path", None, None),
425 ("cluster_name", None, None),
426 ], None, None, "Export a given disk to another node"),
427 ("blockdev_snapshot", SINGLE, None, constants.RPC_TMO_NORMAL, [
428 ("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
429 ], None, None, "Export a given disk to another node"),
430 ("blockdev_rename", SINGLE, None, constants.RPC_TMO_NORMAL, [
431 ("devlist", ED_BLOCKDEV_RENAME, None),
432 ], None, None, "Request rename of the given block devices"),
433 ("blockdev_find", SINGLE, None, constants.RPC_TMO_NORMAL, [
434 ("disk", ED_OBJECT_DICT, None),
435 ], None, _BlockdevFindPostProc,
436 "Request identification of a given block device"),
437 ("blockdev_getmirrorstatus", SINGLE, None, constants.RPC_TMO_NORMAL, [
438 ("disks", ED_DISKS_DICT_DP, None),
439 ], None, _BlockdevGetMirrorStatusPostProc,
440 "Request status of a (mirroring) device"),
441 ("blockdev_getmirrorstatus_multi", MULTI, None, constants.RPC_TMO_NORMAL, [
442 ("node_disks", ED_NODE_TO_DISK_DICT, None),
443 ], _BlockdevGetMirrorStatusMultiPreProc,
444 _BlockdevGetMirrorStatusMultiPostProc,
445 "Request status of (mirroring) devices from multiple nodes"),
446 ("blockdev_setinfo", SINGLE, None, constants.RPC_TMO_NORMAL, [
447 ("disk", ED_OBJECT_DICT, None),
448 ("info", None, None),
449 ], None, None, "Sets metadata information on a given block device"),
453 ("os_diagnose", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
454 "Request a diagnose of OS definitions"),
455 ("os_validate", MULTI, None, constants.RPC_TMO_FAST, [
456 ("required", None, None),
457 ("name", None, None),
458 ("checks", None, None),
459 ("params", None, None),
460 ], None, None, "Run a validation routine for a given OS"),
461 ("os_get", SINGLE, None, constants.RPC_TMO_FAST, [
462 ("name", None, None),
463 ], None, _OsGetPostProc, "Returns an OS definition"),
466 _EXTSTORAGE_CALLS = [
467 ("extstorage_diagnose", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
468 "Request a diagnose of ExtStorage Providers"),
472 ("node_has_ip_address", SINGLE, None, constants.RPC_TMO_FAST, [
473 ("address", None, "IP address"),
474 ], None, None, "Checks if a node has the given IP address"),
475 ("node_info", MULTI, None, constants.RPC_TMO_URGENT, [
477 "Names of the volume groups to ask for disk space information"),
479 "Names of the hypervisors to ask for node information"),
480 ("exclusive_storage", None,
481 "Whether exclusive storage is enabled"),
482 ], _NodeInfoPreProc, None, "Return node information"),
483 ("node_verify", MULTI, None, constants.RPC_TMO_NORMAL, [
484 ("checkdict", None, None),
485 ("cluster_name", None, None),
486 ], None, None, "Request verification of given parameters"),
487 ("node_volumes", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
488 "Gets all volumes on node(s)"),
489 ("node_demote_from_mc", SINGLE, None, constants.RPC_TMO_FAST, [], None, None,
490 "Demote a node from the master candidate role"),
491 ("node_powercycle", SINGLE, ACCEPT_OFFLINE_NODE, constants.RPC_TMO_NORMAL, [
492 ("hypervisor", None, "Hypervisor type"),
493 ], None, None, "Tries to powercycle a node"),
497 ("lv_list", MULTI, None, constants.RPC_TMO_URGENT, [
498 ("vg_name", None, None),
499 ], None, None, "Gets the logical volumes present in a given volume group"),
500 ("vg_list", MULTI, None, constants.RPC_TMO_URGENT, [], None, None,
501 "Gets the volume group list"),
502 ("bridges_exist", SINGLE, None, constants.RPC_TMO_URGENT, [
503 ("bridges_list", None, "Bridges which must be present on remote node"),
504 ], None, None, "Checks if a node has all the bridges given"),
505 ("etc_hosts_modify", SINGLE, None, constants.RPC_TMO_NORMAL, [
507 "Mode to operate; currently L{constants.ETC_HOSTS_ADD} or"
508 " L{constants.ETC_HOSTS_REMOVE}"),
509 ("name", None, "Hostname to be modified"),
510 ("ip", None, "IP address (L{constants.ETC_HOSTS_ADD} only)"),
511 ], None, None, "Modify hosts file with name"),
512 ("drbd_helper", MULTI, None, constants.RPC_TMO_URGENT, [],
513 None, None, "Gets DRBD helper"),
514 ("restricted_command", MULTI, None, constants.RPC_TMO_SLOW, [
515 ("cmd", None, "Command name"),
516 ], None, None, "Runs restricted command"),
517 ("run_oob", SINGLE, None, constants.RPC_TMO_NORMAL, [
518 ("oob_program", None, None),
519 ("command", None, None),
520 ("remote_node", None, None),
521 ("timeout", None, None),
522 ], None, None, "Runs out-of-band command"),
523 ("hooks_runner", MULTI, None, constants.RPC_TMO_NORMAL, [
524 ("hpath", None, None),
525 ("phase", None, None),
527 ], None, None, "Call the hooks runner"),
528 ("iallocator_runner", SINGLE, None, constants.RPC_TMO_NORMAL, [
529 ("name", None, "Iallocator name"),
530 ("idata", None, "JSON-encoded input string"),
531 ], None, None, "Call an iallocator on a remote node"),
532 ("test_delay", MULTI, None, _TestDelayTimeout, [
533 ("duration", None, None),
534 ], None, None, "Sleep for a fixed time on given node(s)"),
535 ("hypervisor_validate_params", MULTI, None, constants.RPC_TMO_NORMAL, [
536 ("hvname", None, "Hypervisor name"),
537 ("hvfull", None, "Parameters to be validated"),
538 ], None, None, "Validate hypervisor params"),
539 ("get_watcher_pause", SINGLE, None, constants.RPC_TMO_URGENT, [],
540 None, None, "Get watcher pause end"),
541 ("set_watcher_pause", MULTI, None, constants.RPC_TMO_URGENT, [
542 ("until", None, None),
543 ], None, None, "Set watcher pause end"),
548 _Prepare(_IMPEXP_CALLS + _X509_CALLS + _OS_CALLS + _NODE_CALLS +
549 _FILE_STORAGE_CALLS + _MISC_CALLS + _INSTANCE_CALLS +
550 _BLOCKDEV_CALLS + _STORAGE_CALLS + _EXTSTORAGE_CALLS),
551 "RpcClientJobQueue": _Prepare([
552 ("jobqueue_update", MULTI, None, constants.RPC_TMO_URGENT, [
553 ("file_name", None, None),
554 ("content", ED_COMPRESS, None),
555 ], None, None, "Update job queue file"),
556 ("jobqueue_purge", SINGLE, None, constants.RPC_TMO_NORMAL, [], None, None,
558 ("jobqueue_rename", MULTI, None, constants.RPC_TMO_URGENT, [
559 ("rename", None, None),
560 ], None, None, "Rename job queue file"),
561 ("jobqueue_set_drain_flag", MULTI, None, constants.RPC_TMO_URGENT, [
562 ("flag", None, None),
563 ], None, None, "Set job queue drain flag"),
565 "RpcClientBootstrap": _Prepare([
566 ("node_start_master_daemons", SINGLE, None, constants.RPC_TMO_FAST, [
567 ("no_voting", None, None),
568 ], None, None, "Starts master daemons on a node"),
569 ("node_activate_master_ip", SINGLE, None, constants.RPC_TMO_FAST, [
570 ("master_params", ED_OBJECT_DICT, "Network parameters of the master"),
571 ("use_external_mip_script", None,
572 "Whether to use the user-provided master IP address setup script"),
574 "Activates master IP on a node"),
575 ("node_stop_master", SINGLE, None, constants.RPC_TMO_FAST, [], None, None,
576 "Deactivates master IP and stops master daemons on a node"),
577 ("node_deactivate_master_ip", SINGLE, None, constants.RPC_TMO_FAST, [
578 ("master_params", ED_OBJECT_DICT, "Network parameters of the master"),
579 ("use_external_mip_script", None,
580 "Whether to use the user-provided master IP address setup script"),
582 "Deactivates master IP on a node"),
583 ("node_change_master_netmask", SINGLE, None, constants.RPC_TMO_FAST, [
584 ("old_netmask", None, "The old value of the netmask"),
585 ("netmask", None, "The new value of the netmask"),
586 ("master_ip", None, "The master IP"),
587 ("master_netdev", None, "The master network device"),
588 ], None, None, "Change master IP netmask"),
589 ("node_leave_cluster", SINGLE, None, constants.RPC_TMO_NORMAL, [
590 ("modify_ssh_setup", None, None),
592 "Requests a node to clean the cluster information it has"),
593 ("master_info", MULTI, None, constants.RPC_TMO_URGENT, [], None, None,
594 "Query master info"),
596 "RpcClientDnsOnly": _Prepare([
597 ("version", MULTI, ACCEPT_OFFLINE_NODE, constants.RPC_TMO_URGENT, [], None,
598 None, "Query node version"),
599 ("node_verify_light", MULTI, None, constants.RPC_TMO_NORMAL, [
600 ("checkdict", None, None),
601 ("cluster_name", None, None),
602 ], None, None, "Request verification of given parameters"),
604 "RpcClientConfig": _Prepare([
605 ("upload_file", MULTI, None, constants.RPC_TMO_NORMAL, [
606 ("file_name", ED_FILE_DETAILS, None),
607 ], None, None, "Upload a file"),
608 ("write_ssconf_files", MULTI, None, constants.RPC_TMO_NORMAL, [
609 ("values", None, None),
610 ], None, None, "Write ssconf files"),