0

We can use python-maas-client for accessing the maas API.

I need to know the way of performing the post request towards maas using the python-maas-client.

Here it is important links:

Link for MAAS API documentation:

https://maas.ubuntu.com/docs/api.html

Making GET request sample:

how to query maas API with curl

Some one please provide me with a sample post request.

0
sshKeys = {"key": [keyValue]}
maas_access.post(u"account/prefs/sshkeys/", "new", **sshKeys)

The above code will post the ssh key into the maas using maas-api.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.