Using MAAS-CLI to deploy machines

I stopped using the API as the documentation is not that great.

hi
after some digging session , i arrvive to manage MAAS by ansible and call API , for the moment.
I look at some module but i prefer to do it myself ^^

https://itnext.io/maas-terraform-ansible-integration-adb57e09caf2

Hi, yes, we deploy servers, both physical and virtual using the KVM hosts nightly:
This is where the process starts, but:
https://gitlab.com/utsa-ics/osias/-/blob/master/deploy.py#L209
For our physical servers:
https://gitlab.com/utsa-ics/osias/-/blob/master/maas_base.py
For our KVM hosts/virtual servers:
https://gitlab.com/utsa-ics/osias/-/blob/master/maas_virtual.py

But that said, our physical servers have static IP’s. But the whole process is there.

@cmills, what’s offline?

Wow, i don’t even understand why I posted that? must of been a typo (late night working on MAAS), during the last month/half I have been using the MAAS API (https://maas.io/docs/api) to automate hardware provisioning.

I was able to commission but Having issues deploying a server, more specifically passing the osystem parameters

POST /MAAS/api/2.0/machines/{system_id}/?op=deploy

Passing the optionally parameters is not straightforward. It would be helpful it you guys were to provide examples of how this would be done!!!

Thanks again for your help in the past

1 Like

Actually, I remember now, I think stormrider was a website that you posted a while back that had documentation on.

taken under advisement. the api reference is automagically generated, but it does need some examples, i agree.

1 Like

and stormrider.io is back, along with the doc you’re referencing. my boss’ boss asked me to put it back up, as others were linking to it. be careful what you post!

1 Like

@cmills, i’m going to try and bring this up with my team in a couple of weeks. can you give me some more detailed examples of where the API doc is failing?

1 Like

Hello Bill,

Sorry for the late reply.
Let’s start with the api docs page https://maas.io/docs/api, this page mentions the various methods for doing updates, post, get(s) and so forth. This page should include at the top of the page https://maas.io/docs/api-authentication-reference. This reference is very important and the only reference to this is on the side halfway down the page. The contents of that reference I think should be place at the top of this page.

I also include some coding examples of how to use the methods mentioned; It took me some time to figure a lot of this out

update_srv = maas.put(MAAS_HOST + “/api/2.0/machines/” + machine.get(“system_id”) + “/”,data={“zone”: zone_info, “pool”: resource_pool, “description”: description})

set_storage = (maas.post(MAAS_HOST + “/api/2.0/machines/” + machine.get(“system_id”) + “/?op=set_storage_layout”, data={“storage_layout”: “lvm”, “root_device”: root_fs}))

Having references like this for each option or even some of the options mentioned would be very helpful

Hello Bill,

replied below

brilliant, @cmills! would OpenAPI conformance help with this, you think?

Yes, that will help greatly.

Hey, Clarence,

Thanks again for your feedback and suggestions regarding the MAAS CLI, and the API documentation. I wanted to take a minute apologize for any confusion or difficulties you’ve experienced while using the CLI and the API.

I appreciate your detailed examples and examples of where the API documentation could be improved. I will bring your feedback to my team, and we will consider how we can enhance the documentation to provide clearer explanations and more comprehensive examples for each option.

Regarding OpenAPI conformance, we’re trying to get there. OpenAPI specifications do help standardize and improve the documentation of APIs, making them more user-friendly and facilitating integration with other tools. But it’s a process.

Thanks a lot for taking the time to share your insights and suggestions, and for all the time you spend bending metal to make MAAS better. Your feedback has been – and continues to be – valuable in helping us enhance the MAAS API documentation and improve the overall product.

If you have any further questions or need assistance with the MAAS API, please don’t hesitate to reach out. We’re here to help on a best-effort basis!