I solved it by myself , pls ignore this mail :)
On Thu, Apr 4, 2013 at 8:30 PM, Romil Gupta <romilgupta19(a)gmail.com> wrote:
Hi ,
*I want to fetch the storagedomains details based on the datacenter id
using ovirt-engine-sdk-3.2.0.2-1.*
Datacenter details:
<data_centers>
<data_center id="e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3"
href="/api/datacenters/e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3">
<name>datacenter1</name>
<description/>
<link rel="storagedomains"
href="/api/datacenters/e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3/storagedomains"/>
<link rel="permissions"
href="/api/datacenters/e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3/permissions"/>
</data_center>
<data_center id="347748d0-b72b-439f-bb2b-bd5c82041158"
href="/api/datacenters/347748d0-b72b-439f-bb2b-bd5c82041158">
<name>Default</name>
<description/>
<link rel="storagedomains"
href="/api/datacenters/347748d0-b72b-439f-bb2b-bd5c82041158/storagedomains"/>
<link rel="permissions"
href="/api/datacenters/347748d0-b72b-439f-bb2b-bd5c82041158/permissions"/>
</data_center>
</data_centers>
I want to know how I could get the storagedomains details using the above
xml ?
*_session = API(url=rhevm_uri, username=rhevm_username,
password=rhevm_password, insecure=True)
*
*print "Connected to RHEVM Successful"*
*datacenters = _session.datacenters.list()*
*for dc in datacenters:*
* print dc.name*
* print dc.id*
* links = dc.link*
* for l in links:*
* print l.rel*
* print l.href*
*but this wont give any storagedomain details :(*
I tried this :
storages = _session.storagedomains.list()
for storage in storages:
print storage.name
<storage_domains>
<storage_domain id="e3e3b0cd-48a4-4bb8-a75b-07813f2c165e"
href="/api/storagedomains/e3e3b0cd-48a4-4bb8-a75b-07813f2c165e">
<name>rhevmiso</name>
<link rel="permissions"
href="/api/storagedomains/e3e3b0cd-48a4-4bb8-a75b-07813f2c165e/permissions"/>
<link rel="files"
href="/api/storagedomains/e3e3b0cd-48a4-4bb8-a75b-07813f2c165e/files"/>
<type>iso</type>
<master>false</master>
<storage>
<type>nfs</type>
<address>*.*.*.*</address>
<path>/iso/rhevmisonfs</path>
</storage>
<available>767725404160</available>
<used>94489280512</used>
<committed>0</committed>
<storage_format>v1</storage_format>
</storage_domain>
<storage_domain id="baa46f57-13e0-4159-ace1-f04e61e1e937"
href="/api/storagedomains/baa46f57-13e0-4159-ace1-f04e61e1e937">
<name>rhevmVMdata</name>
<link rel="permissions"
href="/api/storagedomains/baa46f57-13e0-4159-ace1-f04e61e1e937/permissions"/>
<link rel="files"
href="/api/storagedomains/baa46f57-13e0-4159-ace1-f04e61e1e937/files"/>
<type>data</type>
<master>true</master>
<storage>
<type>nfs</type>
<address>*.*.*.*</address>
<path>/iso/rhevmnfs</path>
</storage>
<available>767725404160</available>
<used>94489280512</used>
<committed>100931731456</committed>
<storage_format>v1</storage_format>
</storage_domain>
</storage_domains>
but it wont contains datacenter ID :(
help me out !
--
*Thanks & Regards,*
*Romil Gupta
*
--
*Thanks & Regards,*
*Romil Gupta
M.Tech (CSE), Manipal
Intern @ HP ISO,Bangalore
Contact No. : 8880414133*