milvus-logo
LFAI
< Docs

list_users()

This operation lists the information of all existing users.

Request Syntax

list_users(
    include_role_info: bool,
    using: str,
    timeout: float | None
)

PARAMETERS

  • include_role_info (bool) -

    [REQUIRED]

    Whether Milvus lists the roles granted to the specified user.

  • using (string) -

    The alias of the employed connection.

    The default value is default, indicating that this operation employs the default connection.

  • timeout (float | None)

    The timeout duration for this operation. Setting this to None indicates that this operation timeouts when any response arrives or any error occurs.

RETURN TYPE:

UserInfo

RETURNS:

A UserInfo object that contains contains the user information.

├── UserInfo
│   └── groups  
│       └── UserItem
│           ├── username
│           ├── roles

A UserItem object contains the following fields:

  • username (str)

    The name of the user.

  • roles (str)

    The roles assigned to the user.

EXCEPTIONS:

  • MilvusException

    This exception will be raised when any error occurs during this operation.

Examples

from pymilvus import connections, utility

# Connection to localhost:19530
connections.connect()

# List the information of all existing users
user = utility.list_users(
    include_role_info=True,
    using="default"
)

# UserInfo groups:
# - UserItem: <username:admin>, <roles:('admin',)>
# - UserItem: <username:root>, <roles:()>

Related operations

The following operations are related to list_users():

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?