<div dir="ltr">I solved it by myself , pls ignore this mail :)<br><div><div><div><div><div><div style id="__af745f8f43-e961-4b88-8424-80b67790c964__"></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Apr 4, 2013 at 8:30 PM, Romil Gupta <span dir="ltr">&lt;<a href="mailto:romilgupta19@gmail.com" target="_blank">romilgupta19@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi ,<div><br></div><div><b>I want to fetch the storagedomains details based on the datacenter id using <span style="font-family:Calibri,sans-serif;color:rgb(31,73,125)">ovirt-engine-sdk-3.2.0.2-1.</span></b></div>

<div><br></div><div>Datacenter details:</div><div><br></div><div><div style="font-size:13px;font-family:monospace">&lt;data_centers&gt;</div><div style="margin-left:1em;font-family:monospace;font-size:13px">
<div><div><div style><span style="display:inline-block;width:10px;vertical-align:bottom;min-height:10px;background-repeat:no-repeat no-repeat"></span>&lt;data_center id=&quot;e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3&quot; href=&quot;/api/datacenters/e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3&quot;&gt;</div>

<div style="margin-left:1em"><div style>&lt;name&gt;datacenter1&lt;/name&gt;</div><div style>&lt;description/&gt;</div><div><font color="#ff0000">&lt;link rel=&quot;storagedomains&quot; href=&quot;/api/datacenters/e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3/storagedomains&quot;/&gt;</font></div>

<div style>&lt;link rel=&quot;permissions&quot; href=&quot;/api/datacenters/e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3/permissions&quot;/&gt;</div></div><div style>&lt;/data_center&gt;</div>
<div style><br></div></div></div><div><div><div style><span style="display:inline-block;width:10px;vertical-align:bottom;min-height:10px;background-repeat:no-repeat no-repeat"></span>&lt;data_center id=&quot;347748d0-b72b-439f-bb2b-bd5c82041158&quot; href=&quot;/api/datacenters/347748d0-b72b-439f-bb2b-bd5c82041158&quot;&gt;</div>

<div style="margin-left:1em"><div style>&lt;name&gt;Default&lt;/name&gt;</div><div style>&lt;description/&gt;</div><div><font color="#ff0000">&lt;link rel=&quot;storagedomains&quot; href=&quot;/api/datacenters/347748d0-b72b-439f-bb2b-bd5c82041158/storagedomains&quot;/&gt;</font></div>

<div style>&lt;link rel=&quot;permissions&quot; href=&quot;/api/datacenters/347748d0-b72b-439f-bb2b-bd5c82041158/permissions&quot;/&gt;</div><div style>&lt;/data_center&gt;<br>
</div></div></div></div></div><div style="font-size:13px;font-family:monospace">&lt;/data_centers&gt;</div><div style="font-size:13px;font-family:monospace"><br></div><div>
<div><font face="monospace"><div style>I want to know how I could get the storagedomains details using the above xml ?</div><div style><br></div><div>
<b><font color="#0000ff">_session = API(url=rhevm_uri, username=rhevm_username, password=rhevm_password, insecure=True)<br></font></b></div><div><b><font color="#0000ff">print &quot;Connected to RHEVM Successful&quot;</font></b></div>

<div><b style="color:rgb(0,0,255)">datacenters = _session.datacenters.list()</b><br></div></font></div><div><font color="#0000ff" face="monospace"><b>for dc in datacenters:</b></font></div><div><font color="#0000ff" face="monospace"><b>   print <a href="http://dc.name" target="_blank">dc.name</a></b></font></div>

<div><font color="#0000ff" face="monospace"><b>   print <a href="http://dc.id" target="_blank">dc.id</a></b></font></div><div><font color="#0000ff" face="monospace"><b>   links = dc.link</b></font></div><div><font color="#0000ff" face="monospace"><b>   for l in links:</b></font></div>

<div><font color="#0000ff" face="monospace"><b>      print l.rel</b></font></div><div><font color="#0000ff" face="monospace"><b>      print l.href</b></font></div><div><b style="color:rgb(0,0,255);font-family:monospace">but this wont give any storagedomain details :(</b><br>

</div><div><font color="#000000" face="monospace">    </font></div><div><font color="#000000" face="monospace"><br></font></div><div><font color="#000000" face="monospace"><br>
</font></div><div><font color="#38761d" face="monospace">I tried this :</font></div><div><span style="font-family:monospace"><font color="#38761d">storages = _session.storagedomains.list()</font></span></div>
<div><font color="#38761d" face="monospace">for storage in storages:</font></div><div><font color="#38761d" face="monospace">    print <a href="http://storage.name" target="_blank">storage.name</a></font></div><div>
<font color="#ff9900" face="monospace"><br></font></div><div><div style="font-size:13px;font-family:monospace">&lt;storage_domains&gt;</div><div style="font-size:13px;margin-left:1em;font-family:monospace">
<div><div><div><span style="display:inline-block;width:10px;vertical-align:bottom;min-height:10px;background-repeat:no-repeat no-repeat"></span>&lt;storage_domain id=&quot;e3e3b0cd-48a4-4bb8-a75b-07813f2c165e&quot; href=&quot;/api/storagedomains/e3e3b0cd-48a4-4bb8-a75b-07813f2c165e&quot;&gt;</div>

<div style="margin-left:1em"><div>&lt;name&gt;rhevmiso&lt;/name&gt;</div><div>&lt;link rel=&quot;permissions&quot; href=&quot;/api/storagedomains/e3e3b0cd-48a4-4bb8-a75b-07813f2c165e/permissions&quot;/&gt;</div>
<div>&lt;link rel=&quot;files&quot; href=&quot;/api/storagedomains/e3e3b0cd-48a4-4bb8-a75b-07813f2c165e/files&quot;/&gt;</div><div>&lt;type&gt;iso&lt;/type&gt;</div><div>&lt;master&gt;false&lt;/master&gt;</div>
<div><div><div><span style="display:inline-block;width:10px;vertical-align:bottom;min-height:10px;background-repeat:no-repeat no-repeat"></span>&lt;storage&gt;</div><div style="margin-left:1em">
<div>&lt;type&gt;nfs&lt;/type&gt;</div><div>&lt;address&gt;*.*.*.*&lt;/address&gt;</div><div>&lt;path&gt;/iso/rhevmisonfs&lt;/path&gt;</div></div><div>&lt;/storage&gt;</div></div></div>
<div>&lt;available&gt;767725404160&lt;/available&gt;</div><div>&lt;used&gt;94489280512&lt;/used&gt;</div><div>&lt;committed&gt;0&lt;/committed&gt;</div><div>&lt;storage_format&gt;v1&lt;/storage_format&gt;</div>
</div><div>&lt;/storage_domain&gt;</div></div></div><div><div><div><span style="display:inline-block;width:10px;vertical-align:bottom;min-height:10px;background-repeat:no-repeat no-repeat"></span>&lt;storage_domain id=&quot;baa46f57-13e0-4159-ace1-f04e61e1e937&quot; href=&quot;/api/storagedomains/baa46f57-13e0-4159-ace1-f04e61e1e937&quot;&gt;</div>

<div style="margin-left:1em"><div>&lt;name&gt;rhevmVMdata&lt;/name&gt;</div><div>&lt;link rel=&quot;permissions&quot; href=&quot;/api/storagedomains/baa46f57-13e0-4159-ace1-f04e61e1e937/permissions&quot;/&gt;</div>
<div>&lt;link rel=&quot;files&quot; href=&quot;/api/storagedomains/baa46f57-13e0-4159-ace1-f04e61e1e937/files&quot;/&gt;</div><div>&lt;type&gt;data&lt;/type&gt;</div><div>&lt;master&gt;true&lt;/master&gt;</div>
<div><div><div><span style="display:inline-block;width:10px;vertical-align:bottom;min-height:10px;background-repeat:no-repeat no-repeat"></span>&lt;storage&gt;</div><div style="margin-left:1em">
<div>&lt;type&gt;nfs&lt;/type&gt;</div><div>&lt;address&gt;*.*.*.*&lt;/address&gt;</div><div>&lt;path&gt;/iso/rhevmnfs&lt;/path&gt;</div></div><div>&lt;/storage&gt;</div></div></div><div>
&lt;available&gt;767725404160&lt;/available&gt;</div><div>&lt;used&gt;94489280512&lt;/used&gt;</div><div>&lt;committed&gt;100931731456&lt;/committed&gt;</div><div>&lt;storage_format&gt;v1&lt;/storage_format&gt;</div>
</div><div>&lt;/storage_domain&gt;</div></div></div></div><div style="font-size:13px;font-family:monospace">&lt;/storage_domains&gt;</div></div><div><font color="#ff9900" face="monospace">   </font></div>
<div><font color="#38761d">but it wont contains datacenter ID :(</font></div><div><br></div><div>help me out !<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div style="font-size:13px;font-family:monospace">

<br></div></font></span></div><span class="HOEnZb"><font color="#888888"><div style="font-size:13px;font-family:monospace"><br></div></font></span></div><span class="HOEnZb"><font color="#888888"><div>-- <br><div dir="ltr">
<b style="color:rgb(102,102,102)">Thanks &amp; Regards,</b><div><b style="color:rgb(102,102,102)">Romil Gupta<br>
</b><br></div></div>
</div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><b style="color:rgb(102,102,102)">Thanks &amp; Regards,</b><div><b style="color:rgb(102,102,102)">Romil Gupta<br>M.Tech (CSE), Manipal<br>Intern @ HP ISO,Bangalore<br>
Contact No. : 8880414133</b><br></div></div>
</div></div>