< Docs
  • Java


A MilvusClient interface. This method gets all roles that a user has.

Note: Get all roles that a user has.
R<SelectUserResponse> selectUser(SelectUserParam requestParam);


Use the SelectUserParam.Builder to construct a SelectUserParam object.

import io.milvus.param.SelectUserParam;
SelectUserParam.Builder builder = SelectUserParam.newBuilder();

Methods of SelectUserParam.Builder:

withUsername(String username)Sets the username.
The username cannot be empty or null.
username: The user name.
withIncludeRoleInfo(boolean includeRoleInfo)Sets the includeRoleInfo.
The default value of includeRoleInfo is False.
includeRoleInfo: The include role info or not.

The can throw the following exceptions:

  • ParamException: error if the parameter is invalid.


This method catches all the exceptions and returns an R object.

  • If the API fails on the server side, it returns an error code and an error message.
  • If the API fails due to RPC exceptions, it returns R.Status.Unknown and error message of the exception.
  • If the API succeeds, it returns R.Status.Success.


import io.milvus.param.SelectUserParam;

R<RpcStatus> response = client.selectUser(SelectUserParam.newBuilder()

if (response.getStatus() != R.Status.Success.getCode()) {
    throw new RuntimeException(response.getMessage());


Was this page helpful?