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.

share|improve this question
up vote 0 down vote accepted
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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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