Statistics
| Branch: | Tag: | Revision:

root / lib / rpc_defs.py @ dd6d2d09

History | View | Annotate | Download (20.8 kB)

1
#
2
#
3

    
4
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
5
#
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.
10
#
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.
15
#
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
19
# 02110-1301, USA.
20

    
21
"""RPC definitions for communication between master and node daemons.
22

23
RPC definition fields:
24

25
  - Name as string
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{TMO_NORMAL}), or callback receiving all arguments in a
29
    tuple to calculate timeout
30
  - List of arguments as tuples
31

32
    - Name as string
33
    - Argument kind used for encoding/decoding
34
    - Description for docstring (can be C{None})
35

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
39

40
"""
41

    
42
from ganeti import utils
43
from ganeti import objects
44

    
45

    
46
# Guidelines for choosing timeouts:
47
# - call used during watcher: timeout of 1min, _TMO_URGENT
48
# - trivial (but be sure it is trivial) (e.g. reading a file): 5min, _TMO_FAST
49
# - other calls: 15 min, _TMO_NORMAL
50
# - special calls (instance add, etc.): either _TMO_SLOW (1h) or huge timeouts
51
TMO_URGENT = 60 # one minute
52
TMO_FAST = 5 * 60 # five minutes
53
TMO_NORMAL = 15 * 60 # 15 minutes
54
TMO_SLOW = 3600 # one hour
55
TMO_4HRS = 4 * 3600
56
TMO_1DAY = 86400
57

    
58
SINGLE = "single-node"
59
MULTI = "multi-node"
60

    
61
# Constants for encoding/decoding
62
(ED_OBJECT_DICT,
63
 ED_OBJECT_DICT_LIST,
64
 ED_INST_DICT,
65
 ED_INST_DICT_HVP_BEP,
66
 ED_NODE_TO_DISK_DICT,
67
 ED_INST_DICT_OSP,
68
 ED_IMPEXP_IO,
69
 ED_FILE_DETAILS,
70
 ED_FINALIZE_EXPORT_DISKS,
71
 ED_COMPRESS,
72
 ED_BLOCKDEV_RENAME) = range(1, 12)
73

    
74

    
75
def _Prepare(calls):
76
  """Converts list of calls to dictionary.
77

78
  """
79
  return utils.SequenceToDict(calls)
80

    
81

    
82
def _MigrationStatusPostProc(result):
83
  """Post-processor for L{rpc.RpcRunner.call_instance_get_migration_status}.
84

85
  """
86
  if not result.fail_msg and result.payload is not None:
87
    result.payload = objects.MigrationStatus.FromDict(result.payload)
88
  return result
89

    
90

    
91
def _BlockdevFindPostProc(result):
92
  """Post-processor for L{rpc.RpcRunner.call_blockdev_find}.
93

94
  """
95
  if not result.fail_msg and result.payload is not None:
96
    result.payload = objects.BlockDevStatus.FromDict(result.payload)
97
  return result
98

    
99

    
100
def _BlockdevGetMirrorStatusPostProc(result):
101
  """Post-processor for L{rpc.RpcRunner.call_blockdev_getmirrorstatus}.
102

103
  """
104
  if not result.fail_msg:
105
    result.payload = map(objects.BlockDevStatus.FromDict, result.payload)
106
  return result
107

    
108

    
109
def _BlockdevGetMirrorStatusMultiPreProc(node, args):
110
  """Prepares the appropriate node values for blockdev_getmirrorstatus_multi.
111

112
  """
113
  # there should be only one argument to this RPC, already holding a
114
  # node->disks dictionary, we just need to extract the value for the
115
  # current node
116
  assert len(args) == 1
117
  return [args[0][node]]
118

    
119

    
120
def _BlockdevGetMirrorStatusMultiPostProc(result):
121
  """Post-processor for L{rpc.RpcRunner.call_blockdev_getmirrorstatus_multi}.
122

123
  """
124
  if not result.fail_msg:
125
    for idx, (success, status) in enumerate(result.payload):
126
      if success:
127
        result.payload[idx] = (success, objects.BlockDevStatus.FromDict(status))
128

    
129
  return result
130

    
131

    
132
def _OsGetPostProc(result):
133
  """Post-processor for L{rpc.RpcRunner.call_os_get}.
134

135
  """
136
  if not result.fail_msg and isinstance(result.payload, dict):
137
    result.payload = objects.OS.FromDict(result.payload)
138
  return result
139

    
140

    
141
def _ImpExpStatusPostProc(result):
142
  """Post-processor for import/export status.
143

144
  @rtype: Payload containing list of L{objects.ImportExportStatus} instances
145
  @return: Returns a list of the state of each named import/export or None if
146
           a status couldn't be retrieved
147

148
  """
149
  if not result.fail_msg:
150
    decoded = []
151

    
152
    for i in result.payload:
153
      if i is None:
154
        decoded.append(None)
155
        continue
156
      decoded.append(objects.ImportExportStatus.FromDict(i))
157

    
158
    result.payload = decoded
159

    
160
  return result
161

    
162

    
163
def _TestDelayTimeout((duration, )):
164
  """Calculate timeout for "test_delay" RPC.
165

166
  """
167
  return int(duration + 5)
168

    
169

    
170
_FILE_STORAGE_CALLS = [
171
  ("file_storage_dir_create", SINGLE, None, TMO_FAST, [
172
    ("file_storage_dir", None, "File storage directory"),
173
    ], None, None, "Create the given file storage directory"),
174
  ("file_storage_dir_remove", SINGLE, None, TMO_FAST, [
175
    ("file_storage_dir", None, "File storage directory"),
176
    ], None, None, "Remove the given file storage directory"),
177
  ("file_storage_dir_rename", SINGLE, None, TMO_FAST, [
178
    ("old_file_storage_dir", None, "Old name"),
179
    ("new_file_storage_dir", None, "New name"),
180
    ], None, None, "Rename file storage directory"),
181
  ]
182

    
183
_STORAGE_CALLS = [
184
  ("storage_list", MULTI, None, TMO_NORMAL, [
185
    ("su_name", None, None),
186
    ("su_args", None, None),
187
    ("name", None, None),
188
    ("fields", None, None),
189
    ], None, None, "Get list of storage units"),
190
  ("storage_modify", SINGLE, None, TMO_NORMAL, [
191
    ("su_name", None, None),
192
    ("su_args", None, None),
193
    ("name", None, None),
194
    ("changes", None, None),
195
    ], None, None, "Modify a storage unit"),
196
  ("storage_execute", SINGLE, None, TMO_NORMAL, [
197
    ("su_name", None, None),
198
    ("su_args", None, None),
199
    ("name", None, None),
200
    ("op", None, None),
201
    ], None, None, "Executes an operation on a storage unit"),
202
  ]
203

    
204
_INSTANCE_CALLS = [
205
  ("instance_info", SINGLE, None, TMO_URGENT, [
206
    ("instance", None, "Instance name"),
207
    ("hname", None, "Hypervisor type"),
208
    ], None, None, "Returns information about a single instance"),
209
  ("all_instances_info", MULTI, None, TMO_URGENT, [
210
    ("hypervisor_list", None, "Hypervisors to query for instances"),
211
    ], None, None,
212
   "Returns information about all instances on the given nodes"),
213
  ("instance_list", MULTI, None, TMO_URGENT, [
214
    ("hypervisor_list", None, "Hypervisors to query for instances"),
215
    ], None, None, "Returns the list of running instances on the given nodes"),
216
  ("instance_reboot", SINGLE, None, TMO_NORMAL, [
217
    ("inst", ED_INST_DICT, "Instance object"),
218
    ("reboot_type", None, None),
219
    ("shutdown_timeout", None, None),
220
    ], None, None, "Returns the list of running instances on the given nodes"),
221
  ("instance_shutdown", SINGLE, None, TMO_NORMAL, [
222
    ("instance", ED_INST_DICT, "Instance object"),
223
    ("timeout", None, None),
224
    ], None, None, "Stops an instance"),
225
  ("instance_run_rename", SINGLE, None, TMO_SLOW, [
226
    ("instance", ED_INST_DICT, "Instance object"),
227
    ("old_name", None, None),
228
    ("debug", None, None),
229
    ], None, None, "Run the OS rename script for an instance"),
230
  ("instance_migratable", SINGLE, None, TMO_NORMAL, [
231
    ("instance", ED_INST_DICT, "Instance object"),
232
    ], None, None, "Checks whether the given instance can be migrated"),
233
  ("migration_info", SINGLE, None, TMO_NORMAL, [
234
    ("instance", ED_INST_DICT, "Instance object"),
235
    ], None, None,
236
    "Gather the information necessary to prepare an instance migration"),
237
  ("accept_instance", SINGLE, None, TMO_NORMAL, [
238
    ("instance", ED_INST_DICT, "Instance object"),
239
    ("info", None, "Result for the call_migration_info call"),
240
    ("target", None, "Target hostname (usually an IP address)"),
241
    ], None, None, "Prepare a node to accept an instance"),
242
  ("instance_finalize_migration_dst", SINGLE, None, TMO_NORMAL, [
243
    ("instance", ED_INST_DICT, "Instance object"),
244
    ("info", None, "Result for the call_migration_info call"),
245
    ("success", None, "Whether the migration was a success or failure"),
246
    ], None, None, "Finalize any target-node migration specific operation"),
247
  ("instance_migrate", SINGLE, None, TMO_SLOW, [
248
    ("instance", ED_INST_DICT, "Instance object"),
249
    ("target", None, "Target node name"),
250
    ("live", None, "Whether the migration should be done live or not"),
251
    ], None, None, "Migrate an instance"),
252
  ("instance_finalize_migration_src", SINGLE, None, TMO_SLOW, [
253
    ("instance", ED_INST_DICT, "Instance object"),
254
    ("success", None, "Whether the migration succeeded or not"),
255
    ("live", None, "Whether the user requested a live migration or not"),
256
    ], None, None, "Finalize the instance migration on the source node"),
257
  ("instance_get_migration_status", SINGLE, None, TMO_SLOW, [
258
    ("instance", ED_INST_DICT, "Instance object"),
259
    ], None, _MigrationStatusPostProc, "Report migration status"),
260
  ("instance_start", SINGLE, None, TMO_NORMAL, [
261
    ("instance_hvp_bep", ED_INST_DICT_HVP_BEP, None),
262
    ("startup_paused", None, None),
263
    ], None, None, "Starts an instance"),
264
  ("instance_os_add", SINGLE, None, TMO_1DAY, [
265
    ("instance_osp", ED_INST_DICT_OSP, None),
266
    ("reinstall", None, None),
267
    ("debug", None, None),
268
    ], None, None, "Starts an instance"),
269
  ]
270

    
271
_IMPEXP_CALLS = [
272
  ("import_start", SINGLE, None, TMO_NORMAL, [
273
    ("opts", ED_OBJECT_DICT, None),
274
    ("instance", ED_INST_DICT, None),
275
    ("component", None, None),
276
    ("dest", ED_IMPEXP_IO, "Import destination"),
277
    ], None, None, "Starts an import daemon"),
278
  ("export_start", SINGLE, None, TMO_NORMAL, [
279
    ("opts", ED_OBJECT_DICT, None),
280
    ("host", None, None),
281
    ("port", None, None),
282
    ("instance", ED_INST_DICT, None),
283
    ("component", None, None),
284
    ("source", ED_IMPEXP_IO, "Export source"),
285
    ], None, None, "Starts an export daemon"),
286
  ("impexp_status", SINGLE, None, TMO_FAST, [
287
    ("names", None, "Import/export names"),
288
    ], None, _ImpExpStatusPostProc, "Gets the status of an import or export"),
289
  ("impexp_abort", SINGLE, None, TMO_NORMAL, [
290
    ("name", None, "Import/export name"),
291
    ], None, None, "Aborts an import or export"),
292
  ("impexp_cleanup", SINGLE, None, TMO_NORMAL, [
293
    ("name", None, "Import/export name"),
294
    ], None, None, "Cleans up after an import or export"),
295
  ("export_info", SINGLE, None, TMO_FAST, [
296
    ("path", None, None),
297
    ], None, None, "Queries the export information in a given path"),
298
  ("finalize_export", SINGLE, None, TMO_NORMAL, [
299
    ("instance", ED_INST_DICT, None),
300
    ("snap_disks", ED_FINALIZE_EXPORT_DISKS, None),
301
    ], None, None, "Request the completion of an export operation"),
302
  ("export_list", MULTI, None, TMO_FAST, [], None, None,
303
   "Gets the stored exports list"),
304
  ("export_remove", SINGLE, None, TMO_FAST, [
305
    ("export", None, None),
306
    ], None, None, "Requests removal of a given export"),
307
  ]
308

    
309
_X509_CALLS = [
310
  ("x509_cert_create", SINGLE, None, TMO_NORMAL, [
311
    ("validity", None, "Validity in seconds"),
312
    ], None, None, "Creates a new X509 certificate for SSL/TLS"),
313
  ("x509_cert_remove", SINGLE, None, TMO_NORMAL, [
314
    ("name", None, "Certificate name"),
315
    ], None, None, "Removes a X509 certificate"),
316
  ]
317

    
318
_BLOCKDEV_CALLS = [
319
  ("bdev_sizes", MULTI, None, TMO_URGENT, [
320
    ("devices", None, None),
321
    ], None, None,
322
   "Gets the sizes of requested block devices present on a node"),
323
  ("blockdev_create", SINGLE, None, TMO_NORMAL, [
324
    ("bdev", ED_OBJECT_DICT, None),
325
    ("size", None, None),
326
    ("owner", None, None),
327
    ("on_primary", None, None),
328
    ("info", None, None),
329
    ], None, None, "Request creation of a given block device"),
330
  ("blockdev_wipe", SINGLE, None, TMO_SLOW, [
331
    ("bdev", ED_OBJECT_DICT, None),
332
    ("offset", None, None),
333
    ("size", None, None),
334
    ], None, None,
335
    "Request wipe at given offset with given size of a block device"),
336
  ("blockdev_remove", SINGLE, None, TMO_NORMAL, [
337
    ("bdev", ED_OBJECT_DICT, None),
338
    ], None, None, "Request removal of a given block device"),
339
  ("blockdev_pause_resume_sync", SINGLE, None, TMO_NORMAL, [
340
    ("disks", ED_OBJECT_DICT_LIST, None),
341
    ("pause", None, None),
342
    ], None, None, "Request a pause/resume of given block device"),
343
  ("blockdev_assemble", SINGLE, None, TMO_NORMAL, [
344
    ("disk", ED_OBJECT_DICT, None),
345
    ("owner", None, None),
346
    ("on_primary", None, None),
347
    ("idx", None, None),
348
    ], None, None, "Request assembling of a given block device"),
349
  ("blockdev_shutdown", SINGLE, None, TMO_NORMAL, [
350
    ("disk", ED_OBJECT_DICT, None),
351
    ], None, None, "Request shutdown of a given block device"),
352
  ("blockdev_addchildren", SINGLE, None, TMO_NORMAL, [
353
    ("bdev", ED_OBJECT_DICT, None),
354
    ("ndevs", ED_OBJECT_DICT_LIST, None),
355
    ], None, None,
356
   "Request adding a list of children to a (mirroring) device"),
357
  ("blockdev_removechildren", SINGLE, None, TMO_NORMAL, [
358
    ("bdev", ED_OBJECT_DICT, None),
359
    ("ndevs", ED_OBJECT_DICT_LIST, None),
360
    ], None, None,
361
   "Request removing a list of children from a (mirroring) device"),
362
  ("blockdev_close", SINGLE, None, TMO_NORMAL, [
363
    ("instance_name", None, None),
364
    ("disks", ED_OBJECT_DICT_LIST, None),
365
    ], None, None, "Closes the given block devices"),
366
  ("blockdev_getsize", SINGLE, None, TMO_NORMAL, [
367
    ("disks", ED_OBJECT_DICT_LIST, None),
368
    ], None, None, "Returns the size of the given disks"),
369
  ("drbd_disconnect_net", MULTI, None, TMO_NORMAL, [
370
    ("nodes_ip", None, None),
371
    ("disks", ED_OBJECT_DICT_LIST, None),
372
    ], None, None, "Disconnects the network of the given drbd devices"),
373
  ("drbd_attach_net", MULTI, None, TMO_NORMAL, [
374
    ("nodes_ip", None, None),
375
    ("disks", ED_OBJECT_DICT_LIST, None),
376
    ("instance_name", None, None),
377
    ("multimaster", None, None),
378
    ], None, None, "Connects the given DRBD devices"),
379
  ("drbd_wait_sync", MULTI, None, TMO_SLOW, [
380
    ("nodes_ip", None, None),
381
    ("disks", ED_OBJECT_DICT_LIST, None),
382
    ], None, None,
383
   "Waits for the synchronization of drbd devices is complete"),
384
  ("blockdev_grow", SINGLE, None, TMO_NORMAL, [
385
    ("cf_bdev", ED_OBJECT_DICT, None),
386
    ("amount", None, None),
387
    ("dryrun", None, None),
388
    ], None, None, "Request a snapshot of the given block device"),
389
  ("blockdev_export", SINGLE, None, TMO_1DAY, [
390
    ("cf_bdev", ED_OBJECT_DICT, None),
391
    ("dest_node", None, None),
392
    ("dest_path", None, None),
393
    ("cluster_name", None, None),
394
    ], None, None, "Export a given disk to another node"),
395
  ("blockdev_snapshot", SINGLE, None, TMO_NORMAL, [
396
    ("cf_bdev", ED_OBJECT_DICT, None),
397
    ], None, None, "Export a given disk to another node"),
398
  ("blockdev_rename", SINGLE, None, TMO_NORMAL, [
399
    ("devlist", ED_BLOCKDEV_RENAME, None),
400
    ], None, None, "Request rename of the given block devices"),
401
  ("blockdev_find", SINGLE, None, TMO_NORMAL, [
402
    ("disk", ED_OBJECT_DICT, None),
403
    ], None, _BlockdevFindPostProc,
404
    "Request identification of a given block device"),
405
  ("blockdev_getmirrorstatus", SINGLE, None, TMO_NORMAL, [
406
    ("disks", ED_OBJECT_DICT_LIST, None),
407
    ], None, _BlockdevGetMirrorStatusPostProc,
408
    "Request status of a (mirroring) device"),
409
  ("blockdev_getmirrorstatus_multi", MULTI, None, TMO_NORMAL, [
410
    ("node_disks", ED_NODE_TO_DISK_DICT, None),
411
    ], _BlockdevGetMirrorStatusMultiPreProc,
412
   _BlockdevGetMirrorStatusMultiPostProc,
413
    "Request status of (mirroring) devices from multiple nodes"),
414
  ]
415

    
416
_OS_CALLS = [
417
  ("os_diagnose", MULTI, None, TMO_FAST, [], None, None,
418
   "Request a diagnose of OS definitions"),
419
  ("os_validate", MULTI, None, TMO_FAST, [
420
    ("required", None, None),
421
    ("name", None, None),
422
    ("checks", None, None),
423
    ("params", None, None),
424
    ], None, None, "Run a validation routine for a given OS"),
425
  ("os_get", SINGLE, None, TMO_FAST, [
426
    ("name", None, None),
427
    ], None, _OsGetPostProc, "Returns an OS definition"),
428
  ]
429

    
430
_NODE_CALLS = [
431
  ("node_has_ip_address", SINGLE, None, TMO_FAST, [
432
    ("address", None, "IP address"),
433
    ], None, None, "Checks if a node has the given IP address"),
434
  ("node_info", MULTI, None, TMO_URGENT, [
435
    ("vg_names", None,
436
     "Names of the volume groups to ask for disk space information"),
437
    ("hv_names", None,
438
     "Names of the hypervisors to ask for node information"),
439
    ], None, None, "Return node information"),
440
  ("node_verify", MULTI, None, TMO_NORMAL, [
441
    ("checkdict", None, None),
442
    ("cluster_name", None, None),
443
    ], None, None, "Request verification of given parameters"),
444
  ("node_volumes", MULTI, None, TMO_FAST, [], None, None,
445
   "Gets all volumes on node(s)"),
446
  ("node_demote_from_mc", SINGLE, None, TMO_FAST, [], None, None,
447
   "Demote a node from the master candidate role"),
448
  ("node_powercycle", SINGLE, None, TMO_NORMAL, [
449
    ("hypervisor", None, "Hypervisor type"),
450
    ], None, None, "Tries to powercycle a node"),
451
  ]
452

    
453
_MISC_CALLS = [
454
  ("lv_list", MULTI, None, TMO_URGENT, [
455
    ("vg_name", None, None),
456
    ], None, None, "Gets the logical volumes present in a given volume group"),
457
  ("vg_list", MULTI, None, TMO_URGENT, [], None, None,
458
   "Gets the volume group list"),
459
  ("bridges_exist", SINGLE, None, TMO_URGENT, [
460
    ("bridges_list", None, "Bridges which must be present on remote node"),
461
    ], None, None, "Checks if a node has all the bridges given"),
462
  ("etc_hosts_modify", SINGLE, None, TMO_NORMAL, [
463
    ("mode", None,
464
     "Mode to operate; currently L{constants.ETC_HOSTS_ADD} or"
465
     " L{constants.ETC_HOSTS_REMOVE}"),
466
    ("name", None, "Hostname to be modified"),
467
    ("ip", None, "IP address (L{constants.ETC_HOSTS_ADD} only)"),
468
    ], None, None, "Modify hosts file with name"),
469
  ("drbd_helper", MULTI, None, TMO_URGENT, [], None, None, "Gets DRBD helper"),
470
  ("run_oob", SINGLE, None, TMO_NORMAL, [
471
    ("oob_program", None, None),
472
    ("command", None, None),
473
    ("remote_node", None, None),
474
    ("timeout", None, None),
475
    ], None, None, "Runs out-of-band command"),
476
  ("hooks_runner", MULTI, None, TMO_NORMAL, [
477
    ("hpath", None, None),
478
    ("phase", None, None),
479
    ("env", None, None),
480
    ], None, None, "Call the hooks runner"),
481
  ("iallocator_runner", SINGLE, None, TMO_NORMAL, [
482
    ("name", None, "Iallocator name"),
483
    ("idata", None, "JSON-encoded input string"),
484
    ], None, None, "Call an iallocator on a remote node"),
485
  ("test_delay", MULTI, None, _TestDelayTimeout, [
486
    ("duration", None, None),
487
    ], None, None, "Sleep for a fixed time on given node(s)"),
488
  ("hypervisor_validate_params", MULTI, None, TMO_NORMAL, [
489
    ("hvname", None, "Hypervisor name"),
490
    ("hvfull", None, "Parameters to be validated"),
491
    ], None, None, "Validate hypervisor params"),
492
  ]
493

    
494
CALLS = {
495
  "RpcClientDefault": \
496
    _Prepare(_IMPEXP_CALLS + _X509_CALLS + _OS_CALLS + _NODE_CALLS +
497
             _FILE_STORAGE_CALLS + _MISC_CALLS + _INSTANCE_CALLS +
498
             _BLOCKDEV_CALLS + _STORAGE_CALLS),
499
  "RpcClientJobQueue": _Prepare([
500
    ("jobqueue_update", MULTI, None, TMO_URGENT, [
501
      ("file_name", None, None),
502
      ("content", ED_COMPRESS, None),
503
      ], None, None, "Update job queue file"),
504
    ("jobqueue_purge", SINGLE, None, TMO_NORMAL, [], None, None,
505
     "Purge job queue"),
506
    ("jobqueue_rename", MULTI, None, TMO_URGENT, [
507
      ("rename", None, None),
508
      ], None, None, "Rename job queue file"),
509
    ]),
510
  "RpcClientBootstrap": _Prepare([
511
    ("node_start_master_daemons", SINGLE, None, TMO_FAST, [
512
      ("no_voting", None, None),
513
      ], None, None, "Starts master daemons on a node"),
514
    ("node_activate_master_ip", SINGLE, None, TMO_FAST, [
515
      ("master_params", ED_OBJECT_DICT, "Network parameters of the master"),
516
      ("use_external_mip_script", None,
517
       "Whether to use the user-provided master IP address setup script"),
518
      ], None, None,
519
      "Activates master IP on a node"),
520
    ("node_stop_master", SINGLE, None, TMO_FAST, [], None, None,
521
     "Deactivates master IP and stops master daemons on a node"),
522
    ("node_deactivate_master_ip", SINGLE, None, TMO_FAST, [
523
      ("master_params", ED_OBJECT_DICT, "Network parameters of the master"),
524
      ("use_external_mip_script", None,
525
       "Whether to use the user-provided master IP address setup script"),
526
      ], None, None,
527
     "Deactivates master IP on a node"),
528
    ("node_change_master_netmask", SINGLE, None, TMO_FAST, [
529
      ("old_netmask", None, "The old value of the netmask"),
530
      ("netmask", None, "The new value of the netmask"),
531
      ("master_ip", None, "The master IP"),
532
      ("master_netdev", None, "The master network device"),
533
      ], None, None, "Change master IP netmask"),
534
    ("node_leave_cluster", SINGLE, None, TMO_NORMAL, [
535
      ("modify_ssh_setup", None, None),
536
      ], None, None,
537
     "Requests a node to clean the cluster information it has"),
538
    ("master_info", MULTI, None, TMO_URGENT, [], None, None,
539
     "Query master info"),
540
    ("version", MULTI, None, TMO_URGENT, [], None, None, "Query node version"),
541
    ]),
542
  "RpcClientConfig": _Prepare([
543
    ("upload_file", MULTI, None, TMO_NORMAL, [
544
      ("file_name", ED_FILE_DETAILS, None),
545
      ], None, None, "Upload a file"),
546
    ("write_ssconf_files", MULTI, None, TMO_NORMAL, [
547
      ("values", None, None),
548
      ], None, None, "Write ssconf files"),
549
    ]),
550
  }