<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"><<a href="mailto:romilgupta19@gmail.com" target="_blank">romilgupta19@gmail.com</a>></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"><data_centers></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><data_center id="e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3" href="/api/datacenters/e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3"></div>
<div style="margin-left:1em"><div style><name>datacenter1</name></div><div style><description/></div><div><font color="#ff0000"><link rel="storagedomains" href="/api/datacenters/e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3/storagedomains"/></font></div>
<div style><link rel="permissions" href="/api/datacenters/e1165cdf-2c42-48a9-87ca-5c3f5cfa8fb3/permissions"/></div></div><div style></data_center></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><data_center id="347748d0-b72b-439f-bb2b-bd5c82041158" href="/api/datacenters/347748d0-b72b-439f-bb2b-bd5c82041158"></div>
<div style="margin-left:1em"><div style><name>Default</name></div><div style><description/></div><div><font color="#ff0000"><link rel="storagedomains" href="/api/datacenters/347748d0-b72b-439f-bb2b-bd5c82041158/storagedomains"/></font></div>
<div style><link rel="permissions" href="/api/datacenters/347748d0-b72b-439f-bb2b-bd5c82041158/permissions"/></div><div style></data_center><br>
</div></div></div></div></div><div style="font-size:13px;font-family:monospace"></data_centers></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 "Connected to RHEVM Successful"</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"><storage_domains></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><storage_domain id="e3e3b0cd-48a4-4bb8-a75b-07813f2c165e" href="/api/storagedomains/e3e3b0cd-48a4-4bb8-a75b-07813f2c165e"></div>
<div style="margin-left:1em"><div><name>rhevmiso</name></div><div><link rel="permissions" href="/api/storagedomains/e3e3b0cd-48a4-4bb8-a75b-07813f2c165e/permissions"/></div>
<div><link rel="files" href="/api/storagedomains/e3e3b0cd-48a4-4bb8-a75b-07813f2c165e/files"/></div><div><type>iso</type></div><div><master>false</master></div>
<div><div><div><span style="display:inline-block;width:10px;vertical-align:bottom;min-height:10px;background-repeat:no-repeat no-repeat"></span><storage></div><div style="margin-left:1em">
<div><type>nfs</type></div><div><address>*.*.*.*</address></div><div><path>/iso/rhevmisonfs</path></div></div><div></storage></div></div></div>
<div><available>767725404160</available></div><div><used>94489280512</used></div><div><committed>0</committed></div><div><storage_format>v1</storage_format></div>
</div><div></storage_domain></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><storage_domain id="baa46f57-13e0-4159-ace1-f04e61e1e937" href="/api/storagedomains/baa46f57-13e0-4159-ace1-f04e61e1e937"></div>
<div style="margin-left:1em"><div><name>rhevmVMdata</name></div><div><link rel="permissions" href="/api/storagedomains/baa46f57-13e0-4159-ace1-f04e61e1e937/permissions"/></div>
<div><link rel="files" href="/api/storagedomains/baa46f57-13e0-4159-ace1-f04e61e1e937/files"/></div><div><type>data</type></div><div><master>true</master></div>
<div><div><div><span style="display:inline-block;width:10px;vertical-align:bottom;min-height:10px;background-repeat:no-repeat no-repeat"></span><storage></div><div style="margin-left:1em">
<div><type>nfs</type></div><div><address>*.*.*.*</address></div><div><path>/iso/rhevmnfs</path></div></div><div></storage></div></div></div><div>
<available>767725404160</available></div><div><used>94489280512</used></div><div><committed>100931731456</committed></div><div><storage_format>v1</storage_format></div>
</div><div></storage_domain></div></div></div></div><div style="font-size:13px;font-family:monospace"></storage_domains></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 & 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 & 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>