Commissioning Task Via API

Mike Pontillo mike.pontillo at canonical.com
Tue Nov 14 18:32:30 UTC 2017


Hi Daniel,

On Tue, Nov 14, 2017 at 10:11 AM, Daniel Souza <
daniel.batista at maxihost.com.br> wrote:

> I have a scrip that authenticate to MAAS API 2.0 and execute the request,
> then, I have tried:
>
> rubytesteapi.rb "/machines/{system_id}/?op=commission" "{skip_networking:
> *'1'*}"
> or
> rubytesteapi.rb "/machines/{system_id}/?op=commission" "{skip_networking:*
> 1*}"
> or
> rubytesteapi.rb /machines/{system_id}/?op=commission&*skip_networking=1*
>
> 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.
>
> Does someone know the correct way to use this parameter?
>
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.

I also encourage you to look at our Python API, available here:

    https://github.com/maas/python-libmaas

You might find it easier to use it directly, or you may find examples here
of the types of things you want to do.

Regards,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/maas-devel/attachments/20171114/740ae812/attachment.html>


More information about the Maas-devel mailing list