For anyone with an admin account who has logged into the MAAS api and is using maas-cli, they should be able to list all machines a user owns, in any state, or in a specified state...
the user story would be "As a MAAS admin, I want to see every machine $USER currently owns in any state so I can determine if they have too many allocated systems"
or
"As a MAAS admin, I want to see every deployed machine $USER currently owns"
I use "machines" here because getting info about machines is part of machine/machines commands in maas-cli. The JSON output for maas LOGIN machines read includes ownership ( "owner": "bladernr") and status like power state ("power_state": "on") and deployment status ("status_name": "Deployed")
So it seems reasonable that maas-cli could just add those fields as filters like it already does for things like id, hostname, vlan, etc.
In fact, it already lets you grab a dump of every machine in a given status:
maas LOGIN machines read status=deployed
So it seems just adding in owner as a new constraint would resolve this. (*well, you'd also need to define "status" better, because status appears to be not well described. But searching for status=failed_deployment seems to work just fine, I just had to guess a few times before I found the right status value to use)
For anyone with an admin account who has logged into the MAAS api and is using maas-cli, they should be able to list all machines a user owns, in any state, or in a specified state...
the user story would be "As a MAAS admin, I want to see every machine $USER currently owns in any state so I can determine if they have too many allocated systems"
or
"As a MAAS admin, I want to see every deployed machine $USER currently owns"
As a workaround it IS kinda possible to do this with some jq hackery (sauce: https:/ /maas.io/ docs/cli- cookbook# heading- -lsmm):
$ maasuser=jdoe; maas $MYMAAS machines read | jq -r '(.[] | [.hostname, .system_id, .owner]) | @tsv' | column -t |grep $maasuser
littleserver pqfcag jdoe
bigserver 86wp7a jdoe
however, this seems like such a basic admin task that any account with admin privileges should be able to do this without hackery like so:
maas $MYMASS machines read owner=jdoe name="Deployed"
maas $MYMAAS machines read owner=jdoe status_
I use "machines" here because getting info about machines is part of machine/machines commands in maas-cli. The JSON output for maas LOGIN machines read includes ownership ( "owner": "bladernr") and status like power state ("power_state": "on") and deployment status ("status_name": "Deployed")
So it seems reasonable that maas-cli could just add those fields as filters like it already does for things like id, hostname, vlan, etc.
In fact, it already lets you grab a dump of every machine in a given status:
maas LOGIN machines read status=deployed
So it seems just adding in owner as a new constraint would resolve this. (*well, you'd also need to define "status" better, because status appears to be not well described. But searching for status= failed_ deployment seems to work just fine, I just had to guess a few times before I found the right status value to use)