canonical / gomaasclient

Go MAAS client
Apache License 2.0
23 stars 28 forks source link

feat: add loggedin user account related entities and API endpoint interactions #52

Closed sachin120 closed 10 months ago

sachin120 commented 10 months ago

What does this implement

Added user account-related API

sachin120 commented 10 months ago

Hi @sachin120,

It seems that you need to create two entities since MAAS returns different response on listing tokens and at create response. Please take a look at the example:

ubuntu@maas-dev:~$ maas admin account create-authorisation-token
Success.
Machine-readable output follows:
{"token_key": "abcabc", "token_secret": "123123", "consumer_key": "!@#!@#", "name": "MAAS consumer"}

ubuntu@maas-dev:~$ maas admin account list-authorisation-tokens
Success.
Machine-readable output follows:
[
    {
        "name": "MAAS consumer",
        "token": "!@#!@#:abcabc:123123"
    }
]

So we need an entity for each one of them. Please update your PR and I will be glad to merge it 🙂

I missed it. Thanks @skatsaounis