milvus-logo
LFAI
< Docs
  • Python

drop()

This operation drops an existing role. The operation will succeed if the specified role exists. Otherwise, this operation will fail.

Request Syntax

drop()

PARAMETERS:

N/A

RETURN TYPE:

NoneType

RETURNS:

None

EXCEPTIONS:

  • MilvusException

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

Examples

from pymilvus import Role, utility

# Create a new role
role = Role(name="test")

role.create()

# List all roles
roles = utility.list_roles(include_user_info=True)

# Output
# RoleInfo groups:
# - RoleItem: <role_name:public>, <users:()>
# - RoleItem: <role_name:test>, <users:()>

# Drop the role
role.drop()

# List all roles
roles = utility.list_roles(include_user_info=True)

# Output
# RoleInfo groups:
# - RoleItem: <role_name:public>, <users:()>

Related operations

The following operations are related to drop():

Feedback

Was this page helpful?