Adding permissions with rhevm-shell

Latest response

The RHEV 3.1 Command Line Shell Guide provides the following example for adding a permission with rhevm-shell:

[RHEVM shell (connected)]# add permission --vm-identifier MyVM1 --role-id MyRole --user-id jsmith

When I run that command, the response is the following:

error: 
status: 400
reason: Bad Request
detail: 
Invalid UUID string: jsmith

It seems that a UUID for the role and a UUID for the user is required to add a permission. 

I can query the UUID for the role with the following command:

show role MyRole

It took me more than one command to get the UUID from a users name with rhevm-shell.  First, I  queried users by first name with the following command:

list users --name Jane

This will provide a list of UUIDs with that first name.  Then, I can query the last_name and the user_name for each user with the following command:

show user UUID

With the UUID for the role and the UUID for the user, I was able to add the permission to the VM.

Responses

It seems that the following command will return results only if the user is one of the first hundred (ordered by first name).

list users --name Jane

Edit: A support case (810926) has been filed for this issue.

Thanks for the feedback here Aram. I'll be passing this along.

The following command is now working for me to get the UUID for a user by first name:

list users --name Jane --max 200

Apparently, the argument to the --max option should be greater than or equal to the total number of users in RHEV-M.