phenix admin¶
Every command on this page also accepts the global flags.
phenix admin¶
Administration of users, roles and API tokens
Synopsis¶
Administration of users, roles and API tokens
The list and get commands read the store. The commands that change users,
roles or tokens call the running phenix server over its unix socket
(--unix-socket), as the user global-admin. The server then closes the
websockets of a user whose role changes, revokes the capture grants of a
deleted user, and signs tokens with its JWT signing key.
Options¶
SEE ALSO¶
- phenix - A cli application for phēnix
- phenix admin role - List, get, create, update, or delete roles
- phenix admin token - Create API tokens
- phenix admin user - List, get, create, update, or delete users
phenix admin role¶
List, get, create, update, or delete roles
Synopsis¶
List, get, create, update, or delete roles
A role is a list of policies. A policy gives verbs on resources, and
optionally only on some resource names. Give a policy as
resources=<list>;verbs=<list>[;names=<list>], each list separated by
commas. Only custom roles change: a built-in role cannot. A role cannot
give more than the user global-admin of the unix socket holds, and no
custom role may give roles create, patch or delete.
Options¶
SEE ALSO¶
- phenix admin - Administration of users, roles and API tokens
- phenix admin role create - Create a custom role
- phenix admin role delete - Delete a custom role that no user has
- phenix admin role get - Show the policies of a role
- phenix admin role list - List the roles
- phenix admin role update - Replace the policies of a custom role
phenix admin role create¶
Create a custom role
Synopsis¶
Create a custom role
Creates a role with the policies that --policy gives. The config name is
--config-name, or else the role name in lower case with a "-" for each run
of other characters. Give the role to a user with phenix admin user
update <username> --role <role name>.
Examples¶
phenix admin role create "Lab Viewer" --policy 'resources=experiments,vms;verbs=list,get;names=lab-*'
Options¶
--config-name string Config name of the role (default from the role name)
-h, --help help for create
--policy stringArray Policy of the role, as resources=<list>;verbs=<list>[;names=<list>] (repeatable)
SEE ALSO¶
- phenix admin role - List, get, create, update, or delete roles
phenix admin role delete¶
Delete a custom role that no user has
Synopsis¶
Delete a custom role that no user has
--dry-run reads the store: it checks that the role exists, is not built
in, and that no user has it, and does not call the server. The server
also refuses a role that its settings name, such as in ui.users.
Options¶
SEE ALSO¶
- phenix admin role - List, get, create, update, or delete roles
phenix admin role get¶
Show the policies of a role
Synopsis¶
Show the policies of a role
The role name is its name or its config name. -o json and -o yaml print
the role with the fields of GET /roles/{name} and its config name
(configName).
Options¶
SEE ALSO¶
- phenix admin role - List, get, create, update, or delete roles
phenix admin role list¶
List the roles
Synopsis¶
List the roles
-o json and -o yaml print each role with the fields of GET /roles and its
config name (configName), sorted by config name.
Options¶
SEE ALSO¶
- phenix admin role - List, get, create, update, or delete roles
phenix admin role update¶
Replace the policies of a custom role
Synopsis¶
Replace the policies of a custom role
Replaces all policies of the role with those that --policy gives. Each
user with the role gets the new policies, with the resource names that
the user had, and the websockets of those users close.
Examples¶
Options¶
-h, --help help for update
--policy stringArray Policy of the role, as resources=<list>;verbs=<list>[;names=<list>] (repeatable)
SEE ALSO¶
- phenix admin role - List, get, create, update, or delete roles
phenix admin token¶
Create API tokens
Options¶
SEE ALSO¶
- phenix admin - Administration of users, roles and API tokens
- phenix admin token create - Create an API token for a user
phenix admin token create¶
Create an API token for a user
Synopsis¶
Create an API token for a user
The running phenix server signs the token with its JWT signing key
(ui.jwt-signing-key) and adds it to the tokens of the user. The command
writes the token to stdout and its expiry to stderr. Send the token in the
X-Phenix-Auth-Token header. The token is valid until it expires or the
user signs out with it. --lifetime is a duration, such as 12h, or a whole
number of days.
Examples¶
phenix admin token create alice
TOKEN=$(phenix admin token create ci-bot --lifetime 30 --description "CI runner")
Options¶
--description string Description of the token (default "manually generated" and the time)
-h, --help help for create
--lifetime string How long the token is valid: a duration or a whole number of days (default "24h")
SEE ALSO¶
- phenix admin token - Create API tokens
phenix admin user¶
List, get, create, update, or delete users
Options¶
SEE ALSO¶
- phenix admin - Administration of users, roles and API tokens
- phenix admin user create - Create a user
- phenix admin user delete - Delete a user
- phenix admin user get - Show a user and the policies of its role
- phenix admin user list - List the users
- phenix admin user update - Change the names, role, resource names, or password of a user
phenix admin user create¶
Create a user
Synopsis¶
Create a user
Creates a user with the role --role. --resource-names limits the role to
those resource names, such as my-exp/*. The command asks for the password
twice on the terminal, or reads it from the first line of stdin with
--password-stdin. The password must meet the password settings. The user
may get and update their own user.
Examples¶
phenix admin user create alice --role experiment-user --resource-names 'lab-*'
printf '%s\n' "$PASSWORD" | phenix admin user create bob --role global-viewer --password-stdin
Options¶
--first-name string First name of the user
-h, --help help for create
--last-name string Last name of the user
--password-stdin Read the password from the first line of stdin
--resource-names strings Resource names that the role applies to (comma list)
--role string Role of the user, by its name or its config name
SEE ALSO¶
- phenix admin user - List, get, create, update, or delete users
phenix admin user delete¶
Delete a user
Synopsis¶
Delete a user
Deletes the user, closes the websockets of the user, and revokes the
capture grants given to the user. --dry-run reads the store: it checks
that the user exists and is not global-admin, and does not call the
server.
Options¶
SEE ALSO¶
- phenix admin user - List, get, create, update, or delete users
phenix admin user get¶
Show a user and the policies of its role
Synopsis¶
Show a user and the policies of its role
-o json and -o yaml print the user with the fields of GET /users/{username}.
Options¶
SEE ALSO¶
- phenix admin user - List, get, create, update, or delete users
phenix admin user list¶
List the users
Synopsis¶
List the users
-o json and -o yaml print each user with the fields of GET /users, sorted
by username.
Options¶
SEE ALSO¶
- phenix admin user - List, get, create, update, or delete users
phenix admin user update¶
Change the names, role, resource names, or password of a user
Synopsis¶
Change the names, role, resource names, or password of a user
Changes only what the flags give. --resource-names without --role keeps
the role of the user. --password changes the password: the command asks
for the current password and the new password on the terminal, or reads
them from the first two lines of stdin with --password-stdin. The API
changes a password only with the current password.
Examples¶
phenix admin user update alice --role experiment-admin
phenix admin user update alice --first-name Alice --last-name Smith
phenix admin user update alice --password
Options¶
--first-name string New first name of the user
-h, --help help for update
--last-name string New last name of the user
--password Change the password
--password-stdin Change the password, and read the current and the new password from stdin
--resource-names strings Resource names that the role applies to (comma list)
--role string New role of the user, by its name or its config name
SEE ALSO¶
- phenix admin user - List, get, create, update, or delete users