[Engine-devel] Fwd: storagedomain status via API
Michael Pasternak
mpastern at redhat.com
Mon Aug 27 14:22:43 UTC 2012
Hi Ryan,
SD status available only in datacenter context [1], as some of domains
may be shared between datacenters, i.e:
dc = api.datacenters.get(name="xxx")
sd = dc.storagedomains.get(name="images-cluster1")
sd.status
[1] except of 'unatached' domains.
On 08/27/2012 05:11 PM, Itamar Heim wrote:
>
>
>
> -------- Original Message --------
> Subject: [Engine-devel] storagedomain status via API
> Date: Mon, 27 Aug 2012 08:36:49 -0500
> From: Ryan Harper <ryanh at us.ibm.com>
> To: engine-devel at ovirt.org
>
> 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>
>
>
--
Michael Pasternak
RedHat, ENG-Virtualization R&D
More information about the Devel
mailing list