Skip to content
Snippets Groups Projects
Commit 600eeb31 authored by Apollon Oikonomopoulos's avatar Apollon Oikonomopoulos
Browse files

Add network query LUXI method


Signed-off-by: default avatarApollon Oikonomopoulos <apollon@noc.grnet.gr>
parent 7ffdb1d8
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,7 @@ REQ_QUERY_JOBS = "QueryJobs"
REQ_QUERY_INSTANCES = "QueryInstances"
REQ_QUERY_NODES = "QueryNodes"
REQ_QUERY_GROUPS = "QueryGroups"
REQ_QUERY_NETWORKS = "QueryNetworks"
REQ_QUERY_EXPORTS = "QueryExports"
REQ_QUERY_CONFIG_VALUES = "QueryConfigValues"
REQ_QUERY_CLUSTER_INFO = "QueryClusterInfo"
......@@ -539,6 +540,9 @@ class Client(object):
def QueryGroups(self, names, fields, use_locking):
return self.CallMethod(REQ_QUERY_GROUPS, (names, fields, use_locking))
def QueryNetworks(self, names, fields, use_locking):
return self.CallMethod(REQ_QUERY_NETWORKS, (names, fields, use_locking))
def QueryExports(self, nodes, use_locking):
return self.CallMethod(REQ_QUERY_EXPORTS, (nodes, use_locking))
......
......@@ -301,6 +301,15 @@ class ClientOps:
op = opcodes.OpGroupQuery(names=names, output_fields=fields)
return self._Query(op)
elif method == luxi.REQ_QUERY_NETWORKS:
(names, fields, use_locking) = args
logging.info("Received network query request for %s", names)
if use_locking:
raise errors.OpPrereqError("Sync queries are not allowed",
errors.ECODE_INVAL)
op = opcodes.OpNetworkQuery(names=names, output_fields=fields)
return self._Query(op)
elif method == luxi.REQ_QUERY_EXPORTS:
nodes, use_locking = args
if use_locking:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment