2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-15 12:17:47 +00:00

Further flesh out the storage api support

Add ability to list arrays and volumes.
This commit is contained in:
Jarrod Johnson 2018-10-15 16:27:12 -04:00
parent f835057ae4
commit 8a4bf22a7e

View File

@ -940,6 +940,15 @@ class IpmiHandler(object):
if len(storelem) == 1:
return self.list_disks()
return self.show_disk(storelem[1])
elif storelem[0] == 'arrays':
if len(storelem) == 1:
return self.list_arrays()
return self.show_array(storelem[1])
elif storelem[0] == 'volumes':
if len(storelem) == 1:
return self.list_volumes()
return self.show_volume(storelem[1])
def handle_sensors(self):
if self.element[-1] == '':
@ -980,6 +989,19 @@ class IpmiHandler(object):
for disk in scfg.disks:
self.output.put(msg.ChildCollection(simplify_name(disk.name)))
def list_arrays(self):
scfg = self.ipmicmd.get_storage_configuration()
self.output.put(msg.ChildCollection('all'))
for arr in scfg.arrays:
self.output.put(msg.ChildCollection('{0}-{1}'.format(*arr.id)))
def list_volumes(self):
scfg = self.ipmicmd.get_storage_configuration()
self.output.put(msg.ChildCollection('all'))
for arr in scfg.arrays:
for vol in arr.volumes:
self.output.put(msg.ChildCollection(simplify_name(vol.name)))
def list_sensors(self):
try:
sensors = self.ipmicmd.get_sensor_descriptions()