Revision 2af8b9c9 lib/rapi/rlib2.py
b/lib/rapi/rlib2.py | ||
---|---|---|
225 | 225 |
"""Returns cluster information. |
226 | 226 |
|
227 | 227 |
""" |
228 |
client = self.GetClient(query=True)
|
|
228 |
client = self.GetClient() |
|
229 | 229 |
return client.QueryClusterInfo() |
230 | 230 |
|
231 | 231 |
|
... | ... | |
296 | 296 |
@return: a dictionary with jobs id and uri. |
297 | 297 |
|
298 | 298 |
""" |
299 |
client = self.GetClient(query=True)
|
|
299 |
client = self.GetClient() |
|
300 | 300 |
|
301 | 301 |
if self.useBulk(): |
302 | 302 |
bulkdata = client.QueryJobs(None, J_FIELDS_BULK) |
... | ... | |
325 | 325 |
|
326 | 326 |
""" |
327 | 327 |
job_id = self.items[0] |
328 |
result = self.GetClient(query=True).QueryJobs([job_id, ], J_FIELDS)[0]
|
|
328 |
result = self.GetClient().QueryJobs([job_id, ], J_FIELDS)[0] |
|
329 | 329 |
if result is None: |
330 | 330 |
raise http.HttpNotFound() |
331 | 331 |
return baserlib.MapFields(J_FIELDS, result) |
... | ... | |
397 | 397 |
"""Returns a list of all nodes. |
398 | 398 |
|
399 | 399 |
""" |
400 |
client = self.GetClient(query=True)
|
|
400 |
client = self.GetClient() |
|
401 | 401 |
|
402 | 402 |
if self.useBulk(): |
403 | 403 |
bulkdata = client.QueryNodes([], N_FIELDS, False) |
... | ... | |
419 | 419 |
|
420 | 420 |
""" |
421 | 421 |
node_name = self.items[0] |
422 |
client = self.GetClient(query=True)
|
|
422 |
client = self.GetClient() |
|
423 | 423 |
|
424 | 424 |
result = baserlib.HandleItemQueryErrors(client.QueryNodes, |
425 | 425 |
names=[node_name], fields=N_FIELDS, |
... | ... | |
457 | 457 |
|
458 | 458 |
""" |
459 | 459 |
node_name = self.items[0] |
460 |
client = self.GetClient(query=True)
|
|
460 |
client = self.GetClient() |
|
461 | 461 |
result = client.QueryNodes(names=[node_name], fields=["role"], |
462 | 462 |
use_locking=self.useLocking()) |
463 | 463 |
|
... | ... | |
673 | 673 |
"""Returns a list of all networks. |
674 | 674 |
|
675 | 675 |
""" |
676 |
client = self.GetClient(query=True)
|
|
676 |
client = self.GetClient() |
|
677 | 677 |
|
678 | 678 |
if self.useBulk(): |
679 | 679 |
bulkdata = client.QueryNetworks([], NET_FIELDS, False) |
... | ... | |
696 | 696 |
|
697 | 697 |
""" |
698 | 698 |
network_name = self.items[0] |
699 |
client = self.GetClient(query=True)
|
|
699 |
client = self.GetClient() |
|
700 | 700 |
|
701 | 701 |
result = baserlib.HandleItemQueryErrors(client.QueryNetworks, |
702 | 702 |
names=[network_name], |
... | ... | |
789 | 789 |
"""Returns a list of all node groups. |
790 | 790 |
|
791 | 791 |
""" |
792 |
client = self.GetClient(query=True)
|
|
792 |
client = self.GetClient() |
|
793 | 793 |
|
794 | 794 |
if self.useBulk(): |
795 | 795 |
bulkdata = client.QueryGroups([], G_FIELDS, False) |
... | ... | |
812 | 812 |
|
813 | 813 |
""" |
814 | 814 |
group_name = self.items[0] |
815 |
client = self.GetClient(query=True)
|
|
815 |
client = self.GetClient() |
|
816 | 816 |
|
817 | 817 |
result = baserlib.HandleItemQueryErrors(client.QueryGroups, |
818 | 818 |
names=[group_name], fields=G_FIELDS, |
... | ... | |
917 | 917 |
"""Returns a list of all available instances. |
918 | 918 |
|
919 | 919 |
""" |
920 |
client = self.GetClient(query=True)
|
|
920 |
client = self.GetClient() |
|
921 | 921 |
|
922 | 922 |
use_locking = self.useLocking() |
923 | 923 |
if self.useBulk(): |
... | ... | |
998 | 998 |
"""Send information about an instance. |
999 | 999 |
|
1000 | 1000 |
""" |
1001 |
client = self.GetClient(query=True)
|
|
1001 |
client = self.GetClient() |
|
1002 | 1002 |
instance_name = self.items[0] |
1003 | 1003 |
|
1004 | 1004 |
result = baserlib.HandleItemQueryErrors(client.QueryInstances, |
... | ... | |
1384 | 1384 |
|
1385 | 1385 |
""" |
1386 | 1386 |
instance_name = self.items[0] |
1387 |
client = self.GetClient(query=True)
|
|
1387 |
client = self.GetClient() |
|
1388 | 1388 |
|
1389 | 1389 |
((console, oper_state), ) = \ |
1390 | 1390 |
client.QueryInstances([instance_name], ["console", "oper_state"], False) |
... | ... | |
1529 | 1529 |
if not self.name: |
1530 | 1530 |
raise http.HttpBadRequest("Missing name on tag request") |
1531 | 1531 |
|
1532 |
cl = self.GetClient(query=True)
|
|
1532 |
cl = self.GetClient() |
|
1533 | 1533 |
tags = list(cl.QueryTags(kind, self.name)) |
1534 | 1534 |
|
1535 | 1535 |
elif kind == constants.TAG_CLUSTER: |
Also available in: Unified diff