<p dir="ltr">Ok. Will it take long time for that sdk to release? </p>
<div class="gmail_quote">On 20 Feb 2014 04:11, &quot;Moti Asayag&quot; &lt;<a href="mailto:masayag@redhat.com">masayag@redhat.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Tejesh M&quot; &lt;<a href="mailto:tejeshmk@gmail.com">tejeshmk@gmail.com</a>&gt;<br>
&gt; To: &quot;users@oVirt.org&quot; &lt;<a href="mailto:users@ovirt.org">users@ovirt.org</a>&gt;<br>
&gt; Sent: Wednesday, February 19, 2014 3:24:40 PM<br>
&gt; Subject: [Users] Fwd: Sample code for setting NIC - CloudInit<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; Can someone share me sample java code for assigning IP address for VM on eth0<br>
&gt; through Java SDK via CloudInit ?<br>
&gt;<br>
<br>
Hi Tejesh,<br>
<br>
I&#39;ve attached a sample code that sends the required request (as the output is demonstrated in debug mode).<br>
Note that the code is jdk-7 compliant.<br>
I haven&#39;t configured cloud-init and haven&#39;t tested it end-to-end.<br>
Please try to test it on your environment and provide a feedback for it.<br>
<br>
Thanks,<br>
Moti<br>
<br>
&gt; Something Like this but in Java:<br>
&gt; &lt;network_configuration&gt;<br>
&gt;          &lt;nics&gt;<br>
&gt;            &lt;nic&gt;<br>
&gt;              &lt;name&gt;eth0&lt;/name&gt;<br>
&gt;              &lt;boot_protocol&gt;STATIC&lt;/boot_protocol&gt;<br>
&gt;              &lt;network&gt;<br>
&gt;                &lt;ip address=&quot;192.168.2.11&quot; netmask=&quot;255.255.0.0&quot;<br>
&gt;                gateway=&quot;192.168.2.1&quot; /&gt;<br>
&gt;              &lt;/network&gt;<br>
&gt;              &lt;on_boot&gt;true&lt;/on_boot&gt;<br>
&gt;            &lt;/nic&gt;<br>
&gt;            &lt;nic&gt;<br>
&gt;              &lt;name&gt;eth1&lt;/name&gt;<br>
&gt;              &lt;boot_protocol&gt;DHCP&lt;/boot_protocol&gt;<br>
&gt;            &lt;/nic&gt;<br>
&gt;            &lt;nic&gt;<br>
&gt;              &lt;name&gt;eth2&lt;/name&gt;<br>
&gt;              &lt;boot_protocol&gt;NONE&lt;/boot_protocol&gt;<br>
&gt;              &lt;on_boot&gt;true&lt;/on_boot&gt;<br>
&gt;            &lt;/nic&gt;<br>
&gt;          &lt;/nics&gt;<br>
&gt;          &lt;dns&gt;<br>
&gt;            &lt;servers&gt;<br>
&gt;              &lt;host&gt;<br>
&gt;                &lt;address&gt;1.1.2.2&lt;/address&gt;<br>
&gt;              &lt;/host&gt;<br>
&gt;              &lt;host&gt;<br>
&gt;                &lt;address&gt;1.2.3.4&lt;/address&gt;<br>
&gt;              &lt;/host&gt;<br>
&gt;            &lt;/servers&gt;<br>
&gt;            &lt;search_domains&gt;<br>
&gt;              &lt;host&gt;<br>
&gt;                &lt;address&gt;qa.lab&lt;/address&gt;<br>
&gt;              &lt;/host&gt;<br>
&gt;              &lt;host&gt;<br>
&gt;                &lt;address&gt; <a href="http://google.com" target="_blank">google.com</a> &lt;/address&gt;<br>
&gt;              &lt;/host&gt;<br>
&gt;            &lt;/search_domains&gt;<br>
&gt;          &lt;/dns&gt;<br>
&gt;        &lt;/network_configuration&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Thanks &amp; Regards<br>
&gt; Tejesh<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@ovirt.org">Users@ovirt.org</a><br>
&gt; <a href="http://lists.ovirt.org/mailman/listinfo/users" target="_blank">http://lists.ovirt.org/mailman/listinfo/users</a><br>
&gt;<br>
</blockquote></div>