Revision 081dc516
b/lib/cmdlib/__init__.py | ||
---|---|---|
49 | 49 |
from ganeti.cmdlib.group import \ |
50 | 50 |
LUGroupAdd, \ |
51 | 51 |
LUGroupAssignNodes, \ |
52 |
LUGroupQuery, \ |
|
53 | 52 |
LUGroupSetParams, \ |
54 | 53 |
LUGroupRemove, \ |
55 | 54 |
LUGroupRename, \ |
b/lib/cmdlib/group.py | ||
---|---|---|
28 | 28 |
from ganeti import errors |
29 | 29 |
from ganeti import locking |
30 | 30 |
from ganeti import objects |
31 |
from ganeti import query |
|
32 | 31 |
from ganeti import utils |
33 | 32 |
from ganeti.masterd import iallocator |
34 |
from ganeti.cmdlib.base import LogicalUnit, NoHooksLU, QueryBase, \ |
|
35 |
ResultWithJobs |
|
33 |
from ganeti.cmdlib.base import LogicalUnit, NoHooksLU, ResultWithJobs |
|
36 | 34 |
from ganeti.cmdlib.common import MergeAndVerifyHvState, \ |
37 | 35 |
MergeAndVerifyDiskState, GetWantedNodes, GetUpdatedParams, \ |
38 | 36 |
CheckNodeGroupInstances, GetUpdatedIPolicy, \ |
... | ... | |
284 | 282 |
list(previously_split_instances & all_split_instances)) |
285 | 283 |
|
286 | 284 |
|
287 |
class GroupQuery(QueryBase): |
|
288 |
FIELDS = query.GROUP_FIELDS |
|
289 |
|
|
290 |
def ExpandNames(self, lu): |
|
291 |
raise NotImplementedError |
|
292 |
|
|
293 |
def DeclareLocks(self, lu, level): |
|
294 |
pass |
|
295 |
|
|
296 |
def _GetQueryData(self, lu): |
|
297 |
raise NotImplementedError |
|
298 |
|
|
299 |
|
|
300 |
class LUGroupQuery(NoHooksLU): |
|
301 |
"""Logical unit for querying node groups. |
|
302 |
|
|
303 |
""" |
|
304 |
REQ_BGL = False |
|
305 |
|
|
306 |
def CheckArguments(self): |
|
307 |
raise NotImplementedError |
|
308 |
|
|
309 |
def ExpandNames(self): |
|
310 |
raise NotImplementedError |
|
311 |
|
|
312 |
def DeclareLocks(self, level): |
|
313 |
raise NotImplementedError |
|
314 |
|
|
315 |
def Exec(self, feedback_fn): |
|
316 |
raise NotImplementedError |
|
317 |
|
|
318 |
|
|
319 | 285 |
class LUGroupSetParams(LogicalUnit): |
320 | 286 |
"""Modifies the parameters of a node group. |
321 | 287 |
|
b/lib/rapi/rlib2.py | ||
---|---|---|
771 | 771 |
"""/2/groups resource. |
772 | 772 |
|
773 | 773 |
""" |
774 |
GET_OPCODE = opcodes.OpGroupQuery |
|
775 | 774 |
POST_OPCODE = opcodes.OpGroupAdd |
776 | 775 |
POST_RENAME = { |
777 | 776 |
"name": "group_name", |
b/src/Ganeti/OpCodes.hs | ||
---|---|---|
697 | 697 |
, withDoc "List of node UUIDs to assign" pRequiredNodeUuids |
698 | 698 |
], |
699 | 699 |
"group_name") |
700 |
, ("OpGroupQuery", |
|
701 |
[t| [[JSValue]] |], |
|
702 |
OpDoc.opGroupQuery, |
|
703 |
[ pOutputFields |
|
704 |
, withDoc "Empty list to query all groups, group names otherwise" pNames |
|
705 |
], |
|
706 |
[]) |
|
707 | 700 |
, ("OpGroupSetParams", |
708 | 701 |
[t| [(NonEmptyString, JSValue)] |], |
709 | 702 |
OpDoc.opGroupSetParams, |
b/test/py/ganeti.opcodes_unittest.py | ||
---|---|---|
128 | 128 |
self.assertEqual(opcodes.OpClusterPostInit().TinySummary(), "C_POST_INIT") |
129 | 129 |
self.assertEqual(opcodes.OpNodeRemove().TinySummary(), "N_REMOVE") |
130 | 130 |
self.assertEqual(opcodes.OpInstanceMigrate().TinySummary(), "I_MIGRATE") |
131 |
self.assertEqual(opcodes.OpGroupQuery().TinySummary(), "G_QUERY") |
|
132 | 131 |
self.assertEqual(opcodes.OpTestJqueue().TinySummary(), "TEST_JQUEUE") |
133 | 132 |
|
134 | 133 |
def testListSummary(self): |
Also available in: Unified diff