Statistics
| Branch: | Tag: | Revision:

root / lib / rpc_defs.py @ a13e1743

History | View | Annotate | Download (26.7 kB)

1 d5a2a550 Michael Hanselmann
#
2 d5a2a550 Michael Hanselmann
#
3 d5a2a550 Michael Hanselmann
4 a303027b Jose A. Lopes
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Google Inc.
5 d5a2a550 Michael Hanselmann
#
6 d5a2a550 Michael Hanselmann
# This program is free software; you can redistribute it and/or modify
7 d5a2a550 Michael Hanselmann
# it under the terms of the GNU General Public License as published by
8 d5a2a550 Michael Hanselmann
# the Free Software Foundation; either version 2 of the License, or
9 d5a2a550 Michael Hanselmann
# (at your option) any later version.
10 d5a2a550 Michael Hanselmann
#
11 d5a2a550 Michael Hanselmann
# This program is distributed in the hope that it will be useful, but
12 d5a2a550 Michael Hanselmann
# WITHOUT ANY WARRANTY; without even the implied warranty of
13 d5a2a550 Michael Hanselmann
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 d5a2a550 Michael Hanselmann
# General Public License for more details.
15 d5a2a550 Michael Hanselmann
#
16 d5a2a550 Michael Hanselmann
# You should have received a copy of the GNU General Public License
17 d5a2a550 Michael Hanselmann
# along with this program; if not, write to the Free Software
18 d5a2a550 Michael Hanselmann
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 d5a2a550 Michael Hanselmann
# 02110-1301, USA.
20 d5a2a550 Michael Hanselmann
21 d5a2a550 Michael Hanselmann
"""RPC definitions for communication between master and node daemons.
22 d5a2a550 Michael Hanselmann

23 033684dd Michael Hanselmann
RPC definition fields:
24 033684dd Michael Hanselmann

25 033684dd Michael Hanselmann
  - Name as string
26 033684dd Michael Hanselmann
  - L{SINGLE} for single-node calls, L{MULTI} for multi-node
27 dd6d2d09 Michael Hanselmann
  - Name resolver option(s), can be callable receiving all arguments in a tuple
28 2ff587d4 Agata Murawska
  - Timeout (e.g. L{constants.RPC_TMO_NORMAL}), or callback receiving all
29 2ff587d4 Agata Murawska
    arguments in a tuple to calculate timeout
30 033684dd Michael Hanselmann
  - List of arguments as tuples
31 033684dd Michael Hanselmann

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

36 60154921 Iustin Pop
  - Custom body encoder (e.g. for preparing per-node bodies)
37 033684dd Michael Hanselmann
  - Return value wrapper (e.g. for deserializing into L{objects}-based objects)
38 033684dd Michael Hanselmann
  - Short call description for docstring
39 033684dd Michael Hanselmann

40 d5a2a550 Michael Hanselmann
"""
41 d5a2a550 Michael Hanselmann
42 2ff587d4 Agata Murawska
from ganeti import constants
43 a09f9847 Michael Hanselmann
from ganeti import utils
44 26d502d0 Michael Hanselmann
from ganeti import objects
45 a09f9847 Michael Hanselmann
46 d5a2a550 Michael Hanselmann
47 0d1e78dd Michael Hanselmann
# Guidelines for choosing timeouts:
48 2ff587d4 Agata Murawska
# - call used during watcher: timeout of 1min, constants.RPC_TMO_URGENT
49 2ff587d4 Agata Murawska
# - trivial (but be sure it is trivial)
50 2ff587d4 Agata Murawska
#     (e.g. reading a file): 5min, constants.RPC_TMO_FAST
51 2ff587d4 Agata Murawska
# - other calls: 15 min, constants.RPC_TMO_NORMAL
52 2ff587d4 Agata Murawska
# - special calls (instance add, etc.):
53 2ff587d4 Agata Murawska
#     either constants.RPC_TMO_SLOW (1h) or huge timeouts
54 d5a2a550 Michael Hanselmann
55 d5a2a550 Michael Hanselmann
SINGLE = "single-node"
56 d5a2a550 Michael Hanselmann
MULTI = "multi-node"
57 d5a2a550 Michael Hanselmann
58 890ea4ce Michael Hanselmann
ACCEPT_OFFLINE_NODE = object()
59 890ea4ce Michael Hanselmann
60 cd40dc53 Michael Hanselmann
# Constants for encoding/decoding
61 cd40dc53 Michael Hanselmann
(ED_OBJECT_DICT,
62 cd40dc53 Michael Hanselmann
 ED_OBJECT_DICT_LIST,
63 cd40dc53 Michael Hanselmann
 ED_INST_DICT,
64 5fce6a89 Constantinos Venetsanopoulos
 ED_INST_DICT_HVP_BEP_DP,
65 0c3d9c7c Thomas Thrainer
 ED_NODE_TO_DISK_DICT_DP,
66 b8291e00 René Nussbaumer
 ED_INST_DICT_OSP_DP,
67 cd40dc53 Michael Hanselmann
 ED_IMPEXP_IO,
68 cd40dc53 Michael Hanselmann
 ED_FILE_DETAILS,
69 cd40dc53 Michael Hanselmann
 ED_FINALIZE_EXPORT_DISKS,
70 cd40dc53 Michael Hanselmann
 ED_COMPRESS,
71 aedf5fd7 René Nussbaumer
 ED_BLOCKDEV_RENAME,
72 aedf5fd7 René Nussbaumer
 ED_DISKS_DICT_DP,
73 235a6b29 Thomas Thrainer
 ED_MULTI_DISKS_DICT_DP,
74 cbe4a0a5 Dimitris Aragiorgis
 ED_SINGLE_DISK_DICT_DP,
75 c5708931 Dimitris Aragiorgis
 ED_NIC_DICT,
76 c5708931 Dimitris Aragiorgis
 ED_DEVICE_DICT) = range(1, 17)
77 d565f83f Michael Hanselmann
78 a09f9847 Michael Hanselmann
79 a09f9847 Michael Hanselmann
def _Prepare(calls):
80 a09f9847 Michael Hanselmann
  """Converts list of calls to dictionary.
81 a09f9847 Michael Hanselmann

82 a09f9847 Michael Hanselmann
  """
83 a09f9847 Michael Hanselmann
  return utils.SequenceToDict(calls)
84 a09f9847 Michael Hanselmann
85 a09f9847 Michael Hanselmann
86 26d502d0 Michael Hanselmann
def _MigrationStatusPostProc(result):
87 ad3ab87e Santi Raffa
  """Post-processor for L{rpc.node.RpcRunner.call_instance_get_migration_status}
88 26d502d0 Michael Hanselmann

89 26d502d0 Michael Hanselmann
  """
90 26d502d0 Michael Hanselmann
  if not result.fail_msg and result.payload is not None:
91 26d502d0 Michael Hanselmann
    result.payload = objects.MigrationStatus.FromDict(result.payload)
92 26d502d0 Michael Hanselmann
  return result
93 26d502d0 Michael Hanselmann
94 26d502d0 Michael Hanselmann
95 26d502d0 Michael Hanselmann
def _BlockdevFindPostProc(result):
96 4e745e62 Santi Raffa
  """Post-processor for L{rpc.node.RpcRunner.call_blockdev_find}.
97 26d502d0 Michael Hanselmann

98 26d502d0 Michael Hanselmann
  """
99 26d502d0 Michael Hanselmann
  if not result.fail_msg and result.payload is not None:
100 26d502d0 Michael Hanselmann
    result.payload = objects.BlockDevStatus.FromDict(result.payload)
101 26d502d0 Michael Hanselmann
  return result
102 26d502d0 Michael Hanselmann
103 26d502d0 Michael Hanselmann
104 26d502d0 Michael Hanselmann
def _BlockdevGetMirrorStatusPostProc(result):
105 4e745e62 Santi Raffa
  """Post-processor for call_blockdev_getmirrorstatus.
106 26d502d0 Michael Hanselmann

107 26d502d0 Michael Hanselmann
  """
108 26d502d0 Michael Hanselmann
  if not result.fail_msg:
109 26d502d0 Michael Hanselmann
    result.payload = map(objects.BlockDevStatus.FromDict, result.payload)
110 26d502d0 Michael Hanselmann
  return result
111 26d502d0 Michael Hanselmann
112 26d502d0 Michael Hanselmann
113 5449685e Iustin Pop
def _BlockdevGetMirrorStatusMultiPreProc(node, args):
114 5449685e Iustin Pop
  """Prepares the appropriate node values for blockdev_getmirrorstatus_multi.
115 5449685e Iustin Pop

116 5449685e Iustin Pop
  """
117 5449685e Iustin Pop
  # there should be only one argument to this RPC, already holding a
118 5449685e Iustin Pop
  # node->disks dictionary, we just need to extract the value for the
119 5449685e Iustin Pop
  # current node
120 5449685e Iustin Pop
  assert len(args) == 1
121 5449685e Iustin Pop
  return [args[0][node]]
122 5449685e Iustin Pop
123 5449685e Iustin Pop
124 26d502d0 Michael Hanselmann
def _BlockdevGetMirrorStatusMultiPostProc(result):
125 4e745e62 Santi Raffa
  """Post-processor for call_blockdev_getmirrorstatus_multi.
126 26d502d0 Michael Hanselmann

127 26d502d0 Michael Hanselmann
  """
128 82cce526 Michael Hanselmann
  if not result.fail_msg:
129 82cce526 Michael Hanselmann
    for idx, (success, status) in enumerate(result.payload):
130 26d502d0 Michael Hanselmann
      if success:
131 82cce526 Michael Hanselmann
        result.payload[idx] = (success, objects.BlockDevStatus.FromDict(status))
132 26d502d0 Michael Hanselmann
133 26d502d0 Michael Hanselmann
  return result
134 26d502d0 Michael Hanselmann
135 26d502d0 Michael Hanselmann
136 1a3c5d4e Bernardo Dal Seno
def _NodeInfoPreProc(node, args):
137 da803ff1 Helga Velroyen
  """Prepare the storage_units argument for node_info calls."""
138 da803ff1 Helga Velroyen
  assert len(args) == 2
139 da803ff1 Helga Velroyen
  # The storage_units argument is either a dictionary with one value for each
140 da803ff1 Helga Velroyen
  # node, or a fixed value to be used for all the nodes
141 da803ff1 Helga Velroyen
  if type(args[0]) is dict:
142 da803ff1 Helga Velroyen
    return [args[0][node], args[1]]
143 1a3c5d4e Bernardo Dal Seno
  else:
144 1a3c5d4e Bernardo Dal Seno
    return args
145 1a3c5d4e Bernardo Dal Seno
146 1a3c5d4e Bernardo Dal Seno
147 26d502d0 Michael Hanselmann
def _ImpExpStatusPostProc(result):
148 26d502d0 Michael Hanselmann
  """Post-processor for import/export status.
149 26d502d0 Michael Hanselmann

150 26d502d0 Michael Hanselmann
  @rtype: Payload containing list of L{objects.ImportExportStatus} instances
151 26d502d0 Michael Hanselmann
  @return: Returns a list of the state of each named import/export or None if
152 26d502d0 Michael Hanselmann
           a status couldn't be retrieved
153 26d502d0 Michael Hanselmann

154 26d502d0 Michael Hanselmann
  """
155 26d502d0 Michael Hanselmann
  if not result.fail_msg:
156 26d502d0 Michael Hanselmann
    decoded = []
157 26d502d0 Michael Hanselmann
158 26d502d0 Michael Hanselmann
    for i in result.payload:
159 26d502d0 Michael Hanselmann
      if i is None:
160 26d502d0 Michael Hanselmann
        decoded.append(None)
161 26d502d0 Michael Hanselmann
        continue
162 26d502d0 Michael Hanselmann
      decoded.append(objects.ImportExportStatus.FromDict(i))
163 26d502d0 Michael Hanselmann
164 26d502d0 Michael Hanselmann
    result.payload = decoded
165 26d502d0 Michael Hanselmann
166 26d502d0 Michael Hanselmann
  return result
167 26d502d0 Michael Hanselmann
168 26d502d0 Michael Hanselmann
169 f7d9b3aa Michael Hanselmann
def _TestDelayTimeout((duration, )):
170 f7d9b3aa Michael Hanselmann
  """Calculate timeout for "test_delay" RPC.
171 f7d9b3aa Michael Hanselmann

172 f7d9b3aa Michael Hanselmann
  """
173 f7d9b3aa Michael Hanselmann
  return int(duration + 5)
174 f7d9b3aa Michael Hanselmann
175 f7d9b3aa Michael Hanselmann
176 033684dd Michael Hanselmann
_FILE_STORAGE_CALLS = [
177 2ff587d4 Agata Murawska
  ("file_storage_dir_create", SINGLE, None, constants.RPC_TMO_FAST, [
178 033684dd Michael Hanselmann
    ("file_storage_dir", None, "File storage directory"),
179 60154921 Iustin Pop
    ], None, None, "Create the given file storage directory"),
180 2ff587d4 Agata Murawska
  ("file_storage_dir_remove", SINGLE, None, constants.RPC_TMO_FAST, [
181 033684dd Michael Hanselmann
    ("file_storage_dir", None, "File storage directory"),
182 60154921 Iustin Pop
    ], None, None, "Remove the given file storage directory"),
183 2ff587d4 Agata Murawska
  ("file_storage_dir_rename", SINGLE, None, constants.RPC_TMO_FAST, [
184 033684dd Michael Hanselmann
    ("old_file_storage_dir", None, "Old name"),
185 033684dd Michael Hanselmann
    ("new_file_storage_dir", None, "New name"),
186 60154921 Iustin Pop
    ], None, None, "Rename file storage directory"),
187 033684dd Michael Hanselmann
  ]
188 033684dd Michael Hanselmann
189 033684dd Michael Hanselmann
_STORAGE_CALLS = [
190 2ff587d4 Agata Murawska
  ("storage_list", MULTI, None, constants.RPC_TMO_NORMAL, [
191 033684dd Michael Hanselmann
    ("su_name", None, None),
192 033684dd Michael Hanselmann
    ("su_args", None, None),
193 033684dd Michael Hanselmann
    ("name", None, None),
194 033684dd Michael Hanselmann
    ("fields", None, None),
195 60154921 Iustin Pop
    ], None, None, "Get list of storage units"),
196 2ff587d4 Agata Murawska
  ("storage_modify", SINGLE, None, constants.RPC_TMO_NORMAL, [
197 033684dd Michael Hanselmann
    ("su_name", None, None),
198 033684dd Michael Hanselmann
    ("su_args", None, None),
199 033684dd Michael Hanselmann
    ("name", None, None),
200 033684dd Michael Hanselmann
    ("changes", None, None),
201 60154921 Iustin Pop
    ], None, None, "Modify a storage unit"),
202 2ff587d4 Agata Murawska
  ("storage_execute", SINGLE, None, constants.RPC_TMO_NORMAL, [
203 033684dd Michael Hanselmann
    ("su_name", None, None),
204 033684dd Michael Hanselmann
    ("su_args", None, None),
205 033684dd Michael Hanselmann
    ("name", None, None),
206 033684dd Michael Hanselmann
    ("op", None, None),
207 60154921 Iustin Pop
    ], None, None, "Executes an operation on a storage unit"),
208 033684dd Michael Hanselmann
  ]
209 033684dd Michael Hanselmann
210 033684dd Michael Hanselmann
_INSTANCE_CALLS = [
211 2ff587d4 Agata Murawska
  ("instance_info", SINGLE, None, constants.RPC_TMO_URGENT, [
212 033684dd Michael Hanselmann
    ("instance", None, "Instance name"),
213 033684dd Michael Hanselmann
    ("hname", None, "Hypervisor type"),
214 0bbec3af Helga Velroyen
    ("hvparams", None, "Hypervisor parameters"),
215 60154921 Iustin Pop
    ], None, None, "Returns information about a single instance"),
216 2ff587d4 Agata Murawska
  ("all_instances_info", MULTI, None, constants.RPC_TMO_URGENT, [
217 033684dd Michael Hanselmann
    ("hypervisor_list", None, "Hypervisors to query for instances"),
218 0200a1af Helga Velroyen
    ("all_hvparams", None, "Dictionary mapping hypervisor names to hvparams"),
219 60154921 Iustin Pop
    ], None, None,
220 60154921 Iustin Pop
   "Returns information about all instances on the given nodes"),
221 2ff587d4 Agata Murawska
  ("instance_list", MULTI, None, constants.RPC_TMO_URGENT, [
222 033684dd Michael Hanselmann
    ("hypervisor_list", None, "Hypervisors to query for instances"),
223 8ac806e6 Helga Velroyen
    ("hvparams", None, "Hvparams of all hypervisors"),
224 60154921 Iustin Pop
    ], None, None, "Returns the list of running instances on the given nodes"),
225 2ff587d4 Agata Murawska
  ("instance_reboot", SINGLE, None, constants.RPC_TMO_NORMAL, [
226 cd40dc53 Michael Hanselmann
    ("inst", ED_INST_DICT, "Instance object"),
227 033684dd Michael Hanselmann
    ("reboot_type", None, None),
228 033684dd Michael Hanselmann
    ("shutdown_timeout", None, None),
229 55cec070 Michele Tartara
    ("reason", None, "The reason for the reboot"),
230 60154921 Iustin Pop
    ], None, None, "Returns the list of running instances on the given nodes"),
231 2ff587d4 Agata Murawska
  ("instance_shutdown", SINGLE, None, constants.RPC_TMO_NORMAL, [
232 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, "Instance object"),
233 033684dd Michael Hanselmann
    ("timeout", None, None),
234 1f350e0f Michele Tartara
    ("reason", None, "The reason for the shutdown"),
235 60154921 Iustin Pop
    ], None, None, "Stops an instance"),
236 2ff587d4 Agata Murawska
  ("instance_balloon_memory", SINGLE, None, constants.RPC_TMO_NORMAL, [
237 ebe466d8 Guido Trotter
    ("instance", ED_INST_DICT, "Instance object"),
238 ebe466d8 Guido Trotter
    ("memory", None, None),
239 ebe466d8 Guido Trotter
    ], None, None, "Modify the amount of an instance's runtime memory"),
240 2ff587d4 Agata Murawska
  ("instance_run_rename", SINGLE, None, constants.RPC_TMO_SLOW, [
241 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, "Instance object"),
242 033684dd Michael Hanselmann
    ("old_name", None, None),
243 033684dd Michael Hanselmann
    ("debug", None, None),
244 60154921 Iustin Pop
    ], None, None, "Run the OS rename script for an instance"),
245 2ff587d4 Agata Murawska
  ("instance_migratable", SINGLE, None, constants.RPC_TMO_NORMAL, [
246 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, "Instance object"),
247 60154921 Iustin Pop
    ], None, None, "Checks whether the given instance can be migrated"),
248 2ff587d4 Agata Murawska
  ("migration_info", SINGLE, None, constants.RPC_TMO_NORMAL, [
249 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, "Instance object"),
250 60154921 Iustin Pop
    ], None, None,
251 033684dd Michael Hanselmann
    "Gather the information necessary to prepare an instance migration"),
252 2ff587d4 Agata Murawska
  ("accept_instance", SINGLE, None, constants.RPC_TMO_NORMAL, [
253 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, "Instance object"),
254 033684dd Michael Hanselmann
    ("info", None, "Result for the call_migration_info call"),
255 033684dd Michael Hanselmann
    ("target", None, "Target hostname (usually an IP address)"),
256 60154921 Iustin Pop
    ], None, None, "Prepare a node to accept an instance"),
257 2ff587d4 Agata Murawska
  ("instance_finalize_migration_dst", SINGLE, None, constants.RPC_TMO_NORMAL, [
258 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, "Instance object"),
259 033684dd Michael Hanselmann
    ("info", None, "Result for the call_migration_info call"),
260 033684dd Michael Hanselmann
    ("success", None, "Whether the migration was a success or failure"),
261 60154921 Iustin Pop
    ], None, None, "Finalize any target-node migration specific operation"),
262 2ff587d4 Agata Murawska
  ("instance_migrate", SINGLE, None, constants.RPC_TMO_SLOW, [
263 bc0a2284 Helga Velroyen
    ("cluster_name", None, "Cluster name"),
264 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, "Instance object"),
265 033684dd Michael Hanselmann
    ("target", None, "Target node name"),
266 033684dd Michael Hanselmann
    ("live", None, "Whether the migration should be done live or not"),
267 60154921 Iustin Pop
    ], None, None, "Migrate an instance"),
268 2ff587d4 Agata Murawska
  ("instance_finalize_migration_src", SINGLE, None, constants.RPC_TMO_SLOW, [
269 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, "Instance object"),
270 033684dd Michael Hanselmann
    ("success", None, "Whether the migration succeeded or not"),
271 033684dd Michael Hanselmann
    ("live", None, "Whether the user requested a live migration or not"),
272 60154921 Iustin Pop
    ], None, None, "Finalize the instance migration on the source node"),
273 2ff587d4 Agata Murawska
  ("instance_get_migration_status", SINGLE, None, constants.RPC_TMO_SLOW, [
274 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, "Instance object"),
275 60154921 Iustin Pop
    ], None, _MigrationStatusPostProc, "Report migration status"),
276 2ff587d4 Agata Murawska
  ("instance_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
277 5fce6a89 Constantinos Venetsanopoulos
    ("instance_hvp_bep", ED_INST_DICT_HVP_BEP_DP, None),
278 c4de9b7a Michael Hanselmann
    ("startup_paused", None, None),
279 1fa6fcba Michele Tartara
    ("reason", None, "The reason for the startup"),
280 60154921 Iustin Pop
    ], None, None, "Starts an instance"),
281 2ff587d4 Agata Murawska
  ("instance_os_add", SINGLE, None, constants.RPC_TMO_1DAY, [
282 d4102e0c Santi Raffa
    ("instance_osp", ED_INST_DICT_OSP_DP, "Tuple: (target instance,"
283 d4102e0c Santi Raffa
                                          " temporary OS parameters"
284 d4102e0c Santi Raffa
                                          " overriding configuration)"),
285 d4102e0c Santi Raffa
    ("reinstall", None, "Whether the instance is being reinstalled"),
286 d4102e0c Santi Raffa
    ("debug", None, "Debug level for the OS install script to use"),
287 d4102e0c Santi Raffa
    ], None, None, "Installs an operative system onto an instance"),
288 c5708931 Dimitris Aragiorgis
  ("hotplug_device", SINGLE, None, constants.RPC_TMO_NORMAL, [
289 c5708931 Dimitris Aragiorgis
    ("instance", ED_INST_DICT, "Instance object"),
290 c5708931 Dimitris Aragiorgis
    ("action", None, "Hotplug Action"),
291 c5708931 Dimitris Aragiorgis
    ("dev_type", None, "Device type"),
292 c5708931 Dimitris Aragiorgis
    ("device", ED_DEVICE_DICT, "Device dict"),
293 c5708931 Dimitris Aragiorgis
    ("extra", None, "Extra info for device (dev_path for disk)"),
294 c5708931 Dimitris Aragiorgis
    ("seq", None, "Device seq"),
295 c5708931 Dimitris Aragiorgis
    ], None, None, "Hoplug a device to a running instance"),
296 24711492 Dimitris Aragiorgis
  ("hotplug_supported", SINGLE, None, constants.RPC_TMO_NORMAL, [
297 24711492 Dimitris Aragiorgis
    ("instance", ED_INST_DICT, "Instance object"),
298 24711492 Dimitris Aragiorgis
    ], None, None, "Check if hotplug is supported"),
299 033684dd Michael Hanselmann
  ]
300 033684dd Michael Hanselmann
301 033684dd Michael Hanselmann
_IMPEXP_CALLS = [
302 2ff587d4 Agata Murawska
  ("import_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
303 cd40dc53 Michael Hanselmann
    ("opts", ED_OBJECT_DICT, None),
304 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, None),
305 46c293f0 Michael Hanselmann
    ("component", None, None),
306 cd40dc53 Michael Hanselmann
    ("dest", ED_IMPEXP_IO, "Import destination"),
307 60154921 Iustin Pop
    ], None, None, "Starts an import daemon"),
308 2ff587d4 Agata Murawska
  ("export_start", SINGLE, None, constants.RPC_TMO_NORMAL, [
309 cd40dc53 Michael Hanselmann
    ("opts", ED_OBJECT_DICT, None),
310 46c293f0 Michael Hanselmann
    ("host", None, None),
311 46c293f0 Michael Hanselmann
    ("port", None, None),
312 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, None),
313 46c293f0 Michael Hanselmann
    ("component", None, None),
314 cd40dc53 Michael Hanselmann
    ("source", ED_IMPEXP_IO, "Export source"),
315 60154921 Iustin Pop
    ], None, None, "Starts an export daemon"),
316 2ff587d4 Agata Murawska
  ("impexp_status", SINGLE, None, constants.RPC_TMO_FAST, [
317 033684dd Michael Hanselmann
    ("names", None, "Import/export names"),
318 60154921 Iustin Pop
    ], None, _ImpExpStatusPostProc, "Gets the status of an import or export"),
319 2ff587d4 Agata Murawska
  ("impexp_abort", SINGLE, None, constants.RPC_TMO_NORMAL, [
320 033684dd Michael Hanselmann
    ("name", None, "Import/export name"),
321 60154921 Iustin Pop
    ], None, None, "Aborts an import or export"),
322 2ff587d4 Agata Murawska
  ("impexp_cleanup", SINGLE, None, constants.RPC_TMO_NORMAL, [
323 033684dd Michael Hanselmann
    ("name", None, "Import/export name"),
324 60154921 Iustin Pop
    ], None, None, "Cleans up after an import or export"),
325 2ff587d4 Agata Murawska
  ("export_info", SINGLE, None, constants.RPC_TMO_FAST, [
326 033684dd Michael Hanselmann
    ("path", None, None),
327 60154921 Iustin Pop
    ], None, None, "Queries the export information in a given path"),
328 2ff587d4 Agata Murawska
  ("finalize_export", SINGLE, None, constants.RPC_TMO_NORMAL, [
329 cd40dc53 Michael Hanselmann
    ("instance", ED_INST_DICT, None),
330 cd40dc53 Michael Hanselmann
    ("snap_disks", ED_FINALIZE_EXPORT_DISKS, None),
331 60154921 Iustin Pop
    ], None, None, "Request the completion of an export operation"),
332 2ff587d4 Agata Murawska
  ("export_list", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
333 60154921 Iustin Pop
   "Gets the stored exports list"),
334 2ff587d4 Agata Murawska
  ("export_remove", SINGLE, None, constants.RPC_TMO_FAST, [
335 033684dd Michael Hanselmann
    ("export", None, None),
336 60154921 Iustin Pop
    ], None, None, "Requests removal of a given export"),
337 033684dd Michael Hanselmann
  ]
338 033684dd Michael Hanselmann
339 033684dd Michael Hanselmann
_X509_CALLS = [
340 2ff587d4 Agata Murawska
  ("x509_cert_create", SINGLE, None, constants.RPC_TMO_NORMAL, [
341 033684dd Michael Hanselmann
    ("validity", None, "Validity in seconds"),
342 60154921 Iustin Pop
    ], None, None, "Creates a new X509 certificate for SSL/TLS"),
343 2ff587d4 Agata Murawska
  ("x509_cert_remove", SINGLE, None, constants.RPC_TMO_NORMAL, [
344 033684dd Michael Hanselmann
    ("name", None, "Certificate name"),
345 60154921 Iustin Pop
    ], None, None, "Removes a X509 certificate"),
346 033684dd Michael Hanselmann
  ]
347 033684dd Michael Hanselmann
348 033684dd Michael Hanselmann
_BLOCKDEV_CALLS = [
349 2ff587d4 Agata Murawska
  ("bdev_sizes", MULTI, None, constants.RPC_TMO_URGENT, [
350 033684dd Michael Hanselmann
    ("devices", None, None),
351 60154921 Iustin Pop
    ], None, None,
352 60154921 Iustin Pop
   "Gets the sizes of requested block devices present on a node"),
353 2ff587d4 Agata Murawska
  ("blockdev_create", SINGLE, None, constants.RPC_TMO_NORMAL, [
354 0c3d9c7c Thomas Thrainer
    ("bdev", ED_SINGLE_DISK_DICT_DP, None),
355 033684dd Michael Hanselmann
    ("size", None, None),
356 033684dd Michael Hanselmann
    ("owner", None, None),
357 033684dd Michael Hanselmann
    ("on_primary", None, None),
358 033684dd Michael Hanselmann
    ("info", None, None),
359 ee1478e5 Bernardo Dal Seno
    ("exclusive_storage", None, None),
360 60154921 Iustin Pop
    ], None, None, "Request creation of a given block device"),
361 a303027b Jose A. Lopes
  ("blockdev_image", SINGLE, None, constants.RPC_TMO_SLOW, [
362 a303027b Jose A. Lopes
    ("bdev", ED_SINGLE_DISK_DICT_DP, None),
363 a303027b Jose A. Lopes
    ("image", None, None),
364 a303027b Jose A. Lopes
    ("size", None, None),
365 a303027b Jose A. Lopes
    ], None, None,
366 a303027b Jose A. Lopes
    "Request to dump an image with given size onto a block device"),
367 2ff587d4 Agata Murawska
  ("blockdev_wipe", SINGLE, None, constants.RPC_TMO_SLOW, [
368 c7ea9827 René Nussbaumer
    ("bdev", ED_SINGLE_DISK_DICT_DP, None),
369 033684dd Michael Hanselmann
    ("offset", None, None),
370 033684dd Michael Hanselmann
    ("size", None, None),
371 60154921 Iustin Pop
    ], None, None,
372 033684dd Michael Hanselmann
    "Request wipe at given offset with given size of a block device"),
373 2ff587d4 Agata Murawska
  ("blockdev_remove", SINGLE, None, constants.RPC_TMO_NORMAL, [
374 0c3d9c7c Thomas Thrainer
    ("bdev", ED_SINGLE_DISK_DICT_DP, None),
375 60154921 Iustin Pop
    ], None, None, "Request removal of a given block device"),
376 2ff587d4 Agata Murawska
  ("blockdev_pause_resume_sync", SINGLE, None, constants.RPC_TMO_NORMAL, [
377 c7ea9827 René Nussbaumer
    ("disks", ED_DISKS_DICT_DP, None),
378 033684dd Michael Hanselmann
    ("pause", None, None),
379 60154921 Iustin Pop
    ], None, None, "Request a pause/resume of given block device"),
380 2ff587d4 Agata Murawska
  ("blockdev_assemble", SINGLE, None, constants.RPC_TMO_NORMAL, [
381 c7ea9827 René Nussbaumer
    ("disk", ED_SINGLE_DISK_DICT_DP, None),
382 033684dd Michael Hanselmann
    ("owner", None, None),
383 033684dd Michael Hanselmann
    ("on_primary", None, None),
384 033684dd Michael Hanselmann
    ("idx", None, None),
385 60154921 Iustin Pop
    ], None, None, "Request assembling of a given block device"),
386 2ff587d4 Agata Murawska
  ("blockdev_shutdown", SINGLE, None, constants.RPC_TMO_NORMAL, [
387 55de1d68 René Nussbaumer
    ("disk", ED_SINGLE_DISK_DICT_DP, None),
388 60154921 Iustin Pop
    ], None, None, "Request shutdown of a given block device"),
389 2ff587d4 Agata Murawska
  ("blockdev_addchildren", SINGLE, None, constants.RPC_TMO_NORMAL, [
390 c7ea9827 René Nussbaumer
    ("bdev", ED_SINGLE_DISK_DICT_DP, None),
391 0c3d9c7c Thomas Thrainer
    ("ndevs", ED_DISKS_DICT_DP, None),
392 60154921 Iustin Pop
    ], None, None,
393 60154921 Iustin Pop
   "Request adding a list of children to a (mirroring) device"),
394 2ff587d4 Agata Murawska
  ("blockdev_removechildren", SINGLE, None, constants.RPC_TMO_NORMAL, [
395 0c3d9c7c Thomas Thrainer
    ("bdev", ED_SINGLE_DISK_DICT_DP, None),
396 0c3d9c7c Thomas Thrainer
    ("ndevs", ED_DISKS_DICT_DP, None),
397 60154921 Iustin Pop
    ], None, None,
398 60154921 Iustin Pop
   "Request removing a list of children from a (mirroring) device"),
399 2ff587d4 Agata Murawska
  ("blockdev_close", SINGLE, None, constants.RPC_TMO_NORMAL, [
400 033684dd Michael Hanselmann
    ("instance_name", None, None),
401 0c3d9c7c Thomas Thrainer
    ("disks", ED_DISKS_DICT_DP, None),
402 60154921 Iustin Pop
    ], None, None, "Closes the given block devices"),
403 6ef8077e Bernardo Dal Seno
  ("blockdev_getdimensions", SINGLE, None, constants.RPC_TMO_NORMAL, [
404 0c3d9c7c Thomas Thrainer
    ("disks", ED_MULTI_DISKS_DICT_DP, None),
405 6ef8077e Bernardo Dal Seno
    ], None, None, "Returns size and spindles of the given disks"),
406 2ff587d4 Agata Murawska
  ("drbd_disconnect_net", MULTI, None, constants.RPC_TMO_NORMAL, [
407 0c3d9c7c Thomas Thrainer
    ("disks", ED_DISKS_DICT_DP, None),
408 0c3d9c7c Thomas Thrainer
    ], None, None,
409 1c3231aa Thomas Thrainer
   "Disconnects the network of the given drbd devices"),
410 2ff587d4 Agata Murawska
  ("drbd_attach_net", MULTI, None, constants.RPC_TMO_NORMAL, [
411 c7ea9827 René Nussbaumer
    ("disks", ED_DISKS_DICT_DP, None),
412 033684dd Michael Hanselmann
    ("instance_name", None, None),
413 033684dd Michael Hanselmann
    ("multimaster", None, None),
414 0c3d9c7c Thomas Thrainer
    ], None, None, "Connects the given DRBD devices"),
415 2ff587d4 Agata Murawska
  ("drbd_wait_sync", MULTI, None, constants.RPC_TMO_SLOW, [
416 c7ea9827 René Nussbaumer
    ("disks", ED_DISKS_DICT_DP, None),
417 0c3d9c7c Thomas Thrainer
    ], None, None,
418 60154921 Iustin Pop
   "Waits for the synchronization of drbd devices is complete"),
419 235a6b29 Thomas Thrainer
  ("drbd_needs_activation", SINGLE, None, constants.RPC_TMO_NORMAL, [
420 235a6b29 Thomas Thrainer
    ("disks", ED_MULTI_DISKS_DICT_DP, None),
421 0c3d9c7c Thomas Thrainer
    ], None, None,
422 235a6b29 Thomas Thrainer
   "Returns the drbd disks which need activation"),
423 2ff587d4 Agata Murawska
  ("blockdev_grow", SINGLE, None, constants.RPC_TMO_NORMAL, [
424 c7ea9827 René Nussbaumer
    ("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
425 033684dd Michael Hanselmann
    ("amount", None, None),
426 033684dd Michael Hanselmann
    ("dryrun", None, None),
427 cad0723b Iustin Pop
    ("backingstore", None, None),
428 e43a624e Bernardo Dal Seno
    ("es_flag", None, None),
429 cad0723b Iustin Pop
    ], None, None, "Request growing of the given block device by a"
430 cad0723b Iustin Pop
   " given amount"),
431 2ff587d4 Agata Murawska
  ("blockdev_snapshot", SINGLE, None, constants.RPC_TMO_NORMAL, [
432 c7ea9827 René Nussbaumer
    ("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
433 60154921 Iustin Pop
    ], None, None, "Export a given disk to another node"),
434 2ff587d4 Agata Murawska
  ("blockdev_rename", SINGLE, None, constants.RPC_TMO_NORMAL, [
435 cd40dc53 Michael Hanselmann
    ("devlist", ED_BLOCKDEV_RENAME, None),
436 60154921 Iustin Pop
    ], None, None, "Request rename of the given block devices"),
437 2ff587d4 Agata Murawska
  ("blockdev_find", SINGLE, None, constants.RPC_TMO_NORMAL, [
438 0c3d9c7c Thomas Thrainer
    ("disk", ED_SINGLE_DISK_DICT_DP, None),
439 60154921 Iustin Pop
    ], None, _BlockdevFindPostProc,
440 033684dd Michael Hanselmann
    "Request identification of a given block device"),
441 2ff587d4 Agata Murawska
  ("blockdev_getmirrorstatus", SINGLE, None, constants.RPC_TMO_NORMAL, [
442 70817cee René Nussbaumer
    ("disks", ED_DISKS_DICT_DP, None),
443 60154921 Iustin Pop
    ], None, _BlockdevGetMirrorStatusPostProc,
444 033684dd Michael Hanselmann
    "Request status of a (mirroring) device"),
445 2ff587d4 Agata Murawska
  ("blockdev_getmirrorstatus_multi", MULTI, None, constants.RPC_TMO_NORMAL, [
446 0c3d9c7c Thomas Thrainer
    ("node_disks", ED_NODE_TO_DISK_DICT_DP, None),
447 5449685e Iustin Pop
    ], _BlockdevGetMirrorStatusMultiPreProc,
448 5449685e Iustin Pop
   _BlockdevGetMirrorStatusMultiPostProc,
449 033684dd Michael Hanselmann
    "Request status of (mirroring) devices from multiple nodes"),
450 48e175a2 Iustin Pop
  ("blockdev_setinfo", SINGLE, None, constants.RPC_TMO_NORMAL, [
451 0c3d9c7c Thomas Thrainer
    ("disk", ED_SINGLE_DISK_DICT_DP, None),
452 48e175a2 Iustin Pop
    ("info", None, None),
453 48e175a2 Iustin Pop
    ], None, None, "Sets metadata information on a given block device"),
454 033684dd Michael Hanselmann
  ]
455 033684dd Michael Hanselmann
456 033684dd Michael Hanselmann
_OS_CALLS = [
457 2ff587d4 Agata Murawska
  ("os_diagnose", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
458 033684dd Michael Hanselmann
   "Request a diagnose of OS definitions"),
459 2ff587d4 Agata Murawska
  ("os_validate", MULTI, None, constants.RPC_TMO_FAST, [
460 033684dd Michael Hanselmann
    ("required", None, None),
461 033684dd Michael Hanselmann
    ("name", None, None),
462 033684dd Michael Hanselmann
    ("checks", None, None),
463 033684dd Michael Hanselmann
    ("params", None, None),
464 ff030c75 Jose A. Lopes
    ("force_variant", None, None),
465 60154921 Iustin Pop
    ], None, None, "Run a validation routine for a given OS"),
466 033684dd Michael Hanselmann
  ]
467 033684dd Michael Hanselmann
468 b954f097 Constantinos Venetsanopoulos
_EXTSTORAGE_CALLS = [
469 b954f097 Constantinos Venetsanopoulos
  ("extstorage_diagnose", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
470 b954f097 Constantinos Venetsanopoulos
   "Request a diagnose of ExtStorage Providers"),
471 b954f097 Constantinos Venetsanopoulos
  ]
472 b954f097 Constantinos Venetsanopoulos
473 033684dd Michael Hanselmann
_NODE_CALLS = [
474 2ff587d4 Agata Murawska
  ("node_has_ip_address", SINGLE, None, constants.RPC_TMO_FAST, [
475 033684dd Michael Hanselmann
    ("address", None, "IP address"),
476 60154921 Iustin Pop
    ], None, None, "Checks if a node has the given IP address"),
477 2ff587d4 Agata Murawska
  ("node_info", MULTI, None, constants.RPC_TMO_URGENT, [
478 4b92e992 Helga Velroyen
    ("storage_units", None,
479 da803ff1 Helga Velroyen
     "List of tuples '<storage_type>,<key>,[<param>]' to ask for disk space"
480 da803ff1 Helga Velroyen
     " information; the parameter list varies depending on the storage_type"),
481 030ab01a Helga Velroyen
    ("hv_specs", None,
482 030ab01a Helga Velroyen
     "List of hypervisor specification (name, hvparams) to ask for node "
483 030ab01a Helga Velroyen
     "information"),
484 1a3c5d4e Bernardo Dal Seno
    ], _NodeInfoPreProc, None, "Return node information"),
485 2ff587d4 Agata Murawska
  ("node_verify", MULTI, None, constants.RPC_TMO_NORMAL, [
486 5b0dfcef Helga Velroyen
    ("checkdict", None, "What to verify"),
487 5b0dfcef Helga Velroyen
    ("cluster_name", None, "Cluster name"),
488 5b0dfcef Helga Velroyen
    ("all_hvparams", None, "Dictionary mapping hypervisor names to hvparams"),
489 a9f33339 Petr Pudlak
    ("node_groups", None, "node names mapped to their group uuids"),
490 a9f33339 Petr Pudlak
    ("groups_cfg", None,
491 a9f33339 Petr Pudlak
      "a dictionary mapping group uuids to their configuration"),
492 60154921 Iustin Pop
    ], None, None, "Request verification of given parameters"),
493 2ff587d4 Agata Murawska
  ("node_volumes", MULTI, None, constants.RPC_TMO_FAST, [], None, None,
494 60154921 Iustin Pop
   "Gets all volumes on node(s)"),
495 2ff587d4 Agata Murawska
  ("node_demote_from_mc", SINGLE, None, constants.RPC_TMO_FAST, [], None, None,
496 033684dd Michael Hanselmann
   "Demote a node from the master candidate role"),
497 2ff587d4 Agata Murawska
  ("node_powercycle", SINGLE, ACCEPT_OFFLINE_NODE, constants.RPC_TMO_NORMAL, [
498 033684dd Michael Hanselmann
    ("hypervisor", None, "Hypervisor type"),
499 8ef418bb Helga Velroyen
    ("hvparams", None, "Hypervisor parameters"),
500 60154921 Iustin Pop
    ], None, None, "Tries to powercycle a node"),
501 90d8d4d1 Sebastian Gebhard
  ("node_configure_ovs", SINGLE, None, constants.RPC_TMO_NORMAL, [
502 90d8d4d1 Sebastian Gebhard
    ("ovs_name", None, "Name of the OpenvSwitch to create"),
503 90d8d4d1 Sebastian Gebhard
    ("ovs_link", None, "Link of the OpenvSwitch to the outside"),
504 90d8d4d1 Sebastian Gebhard
    ], None, None, "This will create and setup the OpenvSwitch"),
505 b544a3c2 Helga Velroyen
  ("node_crypto_tokens", SINGLE, None, constants.RPC_TMO_NORMAL, [
506 d722af8b Helga Velroyen
    ("token_request", None,
507 d722af8b Helga Velroyen
     "List of tuples of requested crypto token types, actions"),
508 d722af8b Helga Velroyen
    ], None, None, "Handle crypto tokens of the node."),
509 033684dd Michael Hanselmann
  ]
510 033684dd Michael Hanselmann
511 033684dd Michael Hanselmann
_MISC_CALLS = [
512 2ff587d4 Agata Murawska
  ("lv_list", MULTI, None, constants.RPC_TMO_URGENT, [
513 033684dd Michael Hanselmann
    ("vg_name", None, None),
514 60154921 Iustin Pop
    ], None, None, "Gets the logical volumes present in a given volume group"),
515 2ff587d4 Agata Murawska
  ("vg_list", MULTI, None, constants.RPC_TMO_URGENT, [], None, None,
516 dd6d2d09 Michael Hanselmann
   "Gets the volume group list"),
517 2ff587d4 Agata Murawska
  ("bridges_exist", SINGLE, None, constants.RPC_TMO_URGENT, [
518 033684dd Michael Hanselmann
    ("bridges_list", None, "Bridges which must be present on remote node"),
519 60154921 Iustin Pop
    ], None, None, "Checks if a node has all the bridges given"),
520 2ff587d4 Agata Murawska
  ("etc_hosts_modify", SINGLE, None, constants.RPC_TMO_NORMAL, [
521 033684dd Michael Hanselmann
    ("mode", None,
522 033684dd Michael Hanselmann
     "Mode to operate; currently L{constants.ETC_HOSTS_ADD} or"
523 033684dd Michael Hanselmann
     " L{constants.ETC_HOSTS_REMOVE}"),
524 033684dd Michael Hanselmann
    ("name", None, "Hostname to be modified"),
525 033684dd Michael Hanselmann
    ("ip", None, "IP address (L{constants.ETC_HOSTS_ADD} only)"),
526 60154921 Iustin Pop
    ], None, None, "Modify hosts file with name"),
527 2ff587d4 Agata Murawska
  ("drbd_helper", MULTI, None, constants.RPC_TMO_URGENT, [],
528 2ff587d4 Agata Murawska
   None, None, "Gets DRBD helper"),
529 db2203e0 Michael Hanselmann
  ("restricted_command", MULTI, None, constants.RPC_TMO_SLOW, [
530 db2203e0 Michael Hanselmann
    ("cmd", None, "Command name"),
531 db2203e0 Michael Hanselmann
    ], None, None, "Runs restricted command"),
532 2ff587d4 Agata Murawska
  ("run_oob", SINGLE, None, constants.RPC_TMO_NORMAL, [
533 033684dd Michael Hanselmann
    ("oob_program", None, None),
534 033684dd Michael Hanselmann
    ("command", None, None),
535 033684dd Michael Hanselmann
    ("remote_node", None, None),
536 033684dd Michael Hanselmann
    ("timeout", None, None),
537 60154921 Iustin Pop
    ], None, None, "Runs out-of-band command"),
538 2ff587d4 Agata Murawska
  ("hooks_runner", MULTI, None, constants.RPC_TMO_NORMAL, [
539 033684dd Michael Hanselmann
    ("hpath", None, None),
540 033684dd Michael Hanselmann
    ("phase", None, None),
541 033684dd Michael Hanselmann
    ("env", None, None),
542 60154921 Iustin Pop
    ], None, None, "Call the hooks runner"),
543 2ff587d4 Agata Murawska
  ("iallocator_runner", SINGLE, None, constants.RPC_TMO_NORMAL, [
544 033684dd Michael Hanselmann
    ("name", None, "Iallocator name"),
545 033684dd Michael Hanselmann
    ("idata", None, "JSON-encoded input string"),
546 0359e5d0 Spyros Trigazis
    ("default_iallocator_params", None, "Additional iallocator parameters"),
547 60154921 Iustin Pop
    ], None, None, "Call an iallocator on a remote node"),
548 dd6d2d09 Michael Hanselmann
  ("test_delay", MULTI, None, _TestDelayTimeout, [
549 033684dd Michael Hanselmann
    ("duration", None, None),
550 60154921 Iustin Pop
    ], None, None, "Sleep for a fixed time on given node(s)"),
551 2ff587d4 Agata Murawska
  ("hypervisor_validate_params", MULTI, None, constants.RPC_TMO_NORMAL, [
552 68959ca5 Michael Hanselmann
    ("hvname", None, "Hypervisor name"),
553 68959ca5 Michael Hanselmann
    ("hvfull", None, "Parameters to be validated"),
554 60154921 Iustin Pop
    ], None, None, "Validate hypervisor params"),
555 ec5af888 Michael Hanselmann
  ("get_watcher_pause", SINGLE, None, constants.RPC_TMO_URGENT, [],
556 ec5af888 Michael Hanselmann
    None, None, "Get watcher pause end"),
557 99e222b1 Michael Hanselmann
  ("set_watcher_pause", MULTI, None, constants.RPC_TMO_URGENT, [
558 99e222b1 Michael Hanselmann
    ("until", None, None),
559 99e222b1 Michael Hanselmann
    ], None, None, "Set watcher pause end"),
560 033684dd Michael Hanselmann
  ]
561 033684dd Michael Hanselmann
562 d5a2a550 Michael Hanselmann
CALLS = {
563 5ae4945a Iustin Pop
  "RpcClientDefault":
564 a09f9847 Michael Hanselmann
    _Prepare(_IMPEXP_CALLS + _X509_CALLS + _OS_CALLS + _NODE_CALLS +
565 a09f9847 Michael Hanselmann
             _FILE_STORAGE_CALLS + _MISC_CALLS + _INSTANCE_CALLS +
566 b954f097 Constantinos Venetsanopoulos
             _BLOCKDEV_CALLS + _STORAGE_CALLS + _EXTSTORAGE_CALLS),
567 a09f9847 Michael Hanselmann
  "RpcClientJobQueue": _Prepare([
568 2ff587d4 Agata Murawska
    ("jobqueue_update", MULTI, None, constants.RPC_TMO_URGENT, [
569 fb1ffbca Michael Hanselmann
      ("file_name", None, None),
570 cd40dc53 Michael Hanselmann
      ("content", ED_COMPRESS, None),
571 60154921 Iustin Pop
      ], None, None, "Update job queue file"),
572 2ff587d4 Agata Murawska
    ("jobqueue_purge", SINGLE, None, constants.RPC_TMO_NORMAL, [], None, None,
573 dd6d2d09 Michael Hanselmann
     "Purge job queue"),
574 2ff587d4 Agata Murawska
    ("jobqueue_rename", MULTI, None, constants.RPC_TMO_URGENT, [
575 fb1ffbca Michael Hanselmann
      ("rename", None, None),
576 60154921 Iustin Pop
      ], None, None, "Rename job queue file"),
577 be6c403e Michael Hanselmann
    ("jobqueue_set_drain_flag", MULTI, None, constants.RPC_TMO_URGENT, [
578 be6c403e Michael Hanselmann
      ("flag", None, None),
579 be6c403e Michael Hanselmann
      ], None, None, "Set job queue drain flag"),
580 a09f9847 Michael Hanselmann
    ]),
581 a09f9847 Michael Hanselmann
  "RpcClientBootstrap": _Prepare([
582 2ff587d4 Agata Murawska
    ("node_start_master_daemons", SINGLE, None, constants.RPC_TMO_FAST, [
583 db04ce5d Michael Hanselmann
      ("no_voting", None, None),
584 60154921 Iustin Pop
      ], None, None, "Starts master daemons on a node"),
585 2ff587d4 Agata Murawska
    ("node_activate_master_ip", SINGLE, None, constants.RPC_TMO_FAST, [
586 c79198a0 Andrea Spadaccini
      ("master_params", ED_OBJECT_DICT, "Network parameters of the master"),
587 57c7bc57 Andrea Spadaccini
      ("use_external_mip_script", None,
588 57c7bc57 Andrea Spadaccini
       "Whether to use the user-provided master IP address setup script"),
589 60154921 Iustin Pop
      ], None, None,
590 8da2bd43 Andrea Spadaccini
      "Activates master IP on a node"),
591 2ff587d4 Agata Murawska
    ("node_stop_master", SINGLE, None, constants.RPC_TMO_FAST, [], None, None,
592 db04ce5d Michael Hanselmann
     "Deactivates master IP and stops master daemons on a node"),
593 2ff587d4 Agata Murawska
    ("node_deactivate_master_ip", SINGLE, None, constants.RPC_TMO_FAST, [
594 c79198a0 Andrea Spadaccini
      ("master_params", ED_OBJECT_DICT, "Network parameters of the master"),
595 57c7bc57 Andrea Spadaccini
      ("use_external_mip_script", None,
596 57c7bc57 Andrea Spadaccini
       "Whether to use the user-provided master IP address setup script"),
597 60154921 Iustin Pop
      ], None, None,
598 db04ce5d Michael Hanselmann
     "Deactivates master IP on a node"),
599 2ff587d4 Agata Murawska
    ("node_change_master_netmask", SINGLE, None, constants.RPC_TMO_FAST, [
600 41e079ce Andrea Spadaccini
      ("old_netmask", None, "The old value of the netmask"),
601 41e079ce Andrea Spadaccini
      ("netmask", None, "The new value of the netmask"),
602 41e079ce Andrea Spadaccini
      ("master_ip", None, "The master IP"),
603 41e079ce Andrea Spadaccini
      ("master_netdev", None, "The master network device"),
604 60154921 Iustin Pop
      ], None, None, "Change master IP netmask"),
605 2ff587d4 Agata Murawska
    ("node_leave_cluster", SINGLE, None, constants.RPC_TMO_NORMAL, [
606 db04ce5d Michael Hanselmann
      ("modify_ssh_setup", None, None),
607 60154921 Iustin Pop
      ], None, None,
608 60154921 Iustin Pop
     "Requests a node to clean the cluster information it has"),
609 cb8028f3 Jose A. Lopes
    ("master_node_name", MULTI, None, constants.RPC_TMO_URGENT, [], None, None,
610 cb8028f3 Jose A. Lopes
     "Returns the master node name"),
611 bd6d1202 René Nussbaumer
    ]),
612 bd6d1202 René Nussbaumer
  "RpcClientDnsOnly": _Prepare([
613 2ff587d4 Agata Murawska
    ("version", MULTI, ACCEPT_OFFLINE_NODE, constants.RPC_TMO_URGENT, [], None,
614 2ff587d4 Agata Murawska
     None, "Query node version"),
615 14fe92c7 Bernardo Dal Seno
    ("node_verify_light", MULTI, None, constants.RPC_TMO_NORMAL, [
616 5b0dfcef Helga Velroyen
      ("checkdict", None, "What to verify"),
617 5b0dfcef Helga Velroyen
      ("cluster_name", None, "Cluster name"),
618 5b0dfcef Helga Velroyen
      ("hvparams", None, "Dictionary mapping hypervisor names to hvparams"),
619 a9f33339 Petr Pudlak
      ("node_groups", None, "node names mapped to their group uuids"),
620 a9f33339 Petr Pudlak
      ("groups_cfg", None,
621 a9f33339 Petr Pudlak
       "a dictionary mapping group uuids to their configuration"),
622 14fe92c7 Bernardo Dal Seno
      ], None, None, "Request verification of given parameters"),
623 a09f9847 Michael Hanselmann
    ]),
624 a09f9847 Michael Hanselmann
  "RpcClientConfig": _Prepare([
625 2ff587d4 Agata Murawska
    ("upload_file", MULTI, None, constants.RPC_TMO_NORMAL, [
626 cd40dc53 Michael Hanselmann
      ("file_name", ED_FILE_DETAILS, None),
627 b3590640 Petr Pudlak
      ], None, None, "Upload files"),
628 b3590640 Petr Pudlak
    ("upload_file_single", MULTI, None, constants.RPC_TMO_NORMAL, [
629 b3590640 Petr Pudlak
      ("file_name", None, "The name of the file"),
630 b3590640 Petr Pudlak
      ("content", ED_COMPRESS, "The data to be uploaded"),
631 b3590640 Petr Pudlak
      ("mode", None, "The mode of the file or None"),
632 b3590640 Petr Pudlak
      ("uid", None, "The owner of the file"),
633 b3590640 Petr Pudlak
      ("gid", None, "The group of the file"),
634 b3590640 Petr Pudlak
      ("atime", None, "The file's last access time"),
635 b3590640 Petr Pudlak
      ("mtime", None, "The file's last modification time"),
636 b3590640 Petr Pudlak
      ], None, None, "Upload files"),
637 2ff587d4 Agata Murawska
    ("write_ssconf_files", MULTI, None, constants.RPC_TMO_NORMAL, [
638 415a7304 Michael Hanselmann
      ("values", None, None),
639 60154921 Iustin Pop
      ], None, None, "Write ssconf files"),
640 a09f9847 Michael Hanselmann
    ]),
641 d5a2a550 Michael Hanselmann
  }