Commit a79ef2a5 authored by Adeodato Simo's avatar Adeodato Simo Committed by Iustin Pop
Browse files

Querying node groups: add luxi.REQ_QUERY_GROUPS



This also updates masterd.py.
Signed-off-by: default avatarAdeodato Simo <dato@google.com>
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 70a6a926
......@@ -56,6 +56,7 @@ REQ_AUTOARCHIVE_JOBS = "AutoArchiveJobs"
REQ_QUERY_JOBS = "QueryJobs"
REQ_QUERY_INSTANCES = "QueryInstances"
REQ_QUERY_NODES = "QueryNodes"
REQ_QUERY_GROUPS = "QueryGroups"
REQ_QUERY_EXPORTS = "QueryExports"
REQ_QUERY_CONFIG_VALUES = "QueryConfigValues"
REQ_QUERY_CLUSTER_INFO = "QueryClusterInfo"
......@@ -495,6 +496,9 @@ class Client(object):
def QueryNodes(self, names, fields, use_locking):
return self.CallMethod(REQ_QUERY_NODES, (names, fields, use_locking))
def QueryGroups(self, names, fields, use_locking):
return self.CallMethod(REQ_QUERY_GROUPS, (names, fields, use_locking))
def QueryExports(self, nodes, use_locking):
return self.CallMethod(REQ_QUERY_EXPORTS, (nodes, use_locking))
......
......@@ -256,6 +256,15 @@ class ClientOps:
use_locking=use_locking)
return self._Query(op)
elif method == luxi.REQ_QUERY_GROUPS:
(names, fields, use_locking) = args
logging.info("Received group query request for %s", names)
if use_locking:
raise errors.OpPrereqError("Sync queries are not allowed",
errors.ECODE_INVAL)
op = opcodes.OpQueryGroups(names=names, output_fields=fields)
return self._Query(op)
elif method == luxi.REQ_QUERY_EXPORTS:
nodes, use_locking = args
if use_locking:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment