[Engine-devel] storagedomain status via API
Ryan Harper
ryanh at us.ibm.com
Mon Aug 27 13:36:49 UTC 2012
Should all created storage domains have 'status' in the API? Below, I've got one active NFS data domain, and a second ISO domain defined, but not activated. the <status> element is only available for the the ISO domain.
I'd really like a way to enumerate the storage domains, and check whether a domain is OK or not.
via python shell ovirt-sdk:
>>> iso = api.storagedomains.get(name='isos-20120614')
>>> iso.name
'isos-20120614'
>>> iso.status.state
'unattached'
>>> sd = api.storagedomains.get(name='images-cluster1')
>>> sd.name
'images-cluster1'
>>> sd.status.state
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'state'
Refrence XML via https://enginehost/api/storagedomains/
<storage_domains>
<storage_domain href="/api/storagedomains/73c7f296-6dac-4bc3-95c1-f0d88a1db7ad" id="73c7f296-6dac-4bc3-95c1-f0d88a1db7ad">
<name>images-cluster1</name>
<link href="/api/storagedomains/73c7f296-6dac-4bc3-95c1-f0d88a1db7ad/permissions" rel="permissions"/>
<type>data</type>
<master>true</master>
<storage>
<type>nfs</type>
<address>ichigo-dom209.phx.austin.ibm.com</address>
<path>/images-cluster1</path>
</storage>
<available>6442450944</available>
<used>39728447488</used>
<committed>0</committed>
<storage_format>v1</storage_format>
</storage_domain>
<storage_domain href="/api/storagedomains/723c254e-7585-4c33-b8d1-cb88a2245d7d" id="723c254e-7585-4c33-b8d1-cb88a2245d7d">
<name>isos-20120614</name>
<link href="/api/storagedomains/723c254e-7585-4c33-b8d1-cb88a2245d7d/permissions" rel="permissions"/>
<link href="/api/storagedomains/723c254e-7585-4c33-b8d1-cb88a2245d7d/files" rel="files"/>
<type>iso</type>
<status>
<state>unattached</state>
</status>
<master>false</master>
<storage>
<type>nfs</type>
<address>ichigo-dom209.phx.austin.ibm.com</address>
<path>/iso-cluster1</path>
</storage>
<available>6442450944</available>
<used>39728447488</used>
<committed>0</committed>
<storage_format>v1</storage_format>
</storage_domain>
</storage_domains>
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh at us.ibm.com
More information about the Devel
mailing list