<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Hi Daniel,</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Tue, Nov 14, 2017 at 10:11 AM, Daniel Souza <span dir="ltr"><<a href="mailto:daniel.batista@maxihost.com.br" target="_blank">daniel.batista@maxihost.com.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>I have a scrip that authenticate to MAAS API 2.0 and execute the
request, then, I have tried:<br></p><p>
<span>rubytesteapi.rb
"/machines/{system_id}/?op=<wbr>commission" "{skip_networking: <b>'1'</b>}"<br>
or<br>
</span><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">rubytesteapi.rb
"/machines/{system_id}/?op=<wbr>commission" "{skip_networking:<b> 1</b>}"<br>
or<br>
rubytesteapi.rb /machines/{system_id}/?op=<wbr>commission&<b>skip_networking=1</b></span></p>
<p>The same script works to other requests. I need to keep the
node's network config when commissioning, that is why I am using
"skip_networking". If I use MAAS CLI, this works fine "commission
{system_id} skip_networking=1", but through API it doesn't work.</p>
<p>Does someone know the correct way to use this parameter?</p></div></blockquote><div>The MAAS API generally uses GET requests for reading and POST requests for writing. My guess is that passing the parameters on the URL string instead of the body of the POST request is causing this issue.</div><div><br></div><div>I also encourage you to look at our Python API, available here:</div><div><br></div><div> <a href="https://github.com/maas/python-libmaas">https://github.com/maas/python-libmaas</a><br></div><div><br></div><div>You might find it easier to use it directly, or you may find examples here of the types of things you want to do.</div><div><br></div><div>Regards,</div><div>Mike</div></div></div></div>