describe_role()
This operation returns the description and privileges of a specific role.
Request Syntax
python
describe_role(
role_name: str,
timeout: Optional[float] = None,
**kwargs,
) -> dict
PARAMETERS:
-
role_name (str) -
[REQUIRED]
The name of the role to describe. -
timeout (Optional[float]) -
Default:None
The maximum time, in seconds, to wait for the RPC to complete. -
kwargs (Any) -
The additional request context options.
RETURN TYPE:
dict
RETURNS:
Dictionary with role, description, and privileges.
EXCEPTIONS:
- MilvusException
Raised when the server rejects the request or the RPC fails. Inspect the server error message for exact failure details.
Examples
Demonstrates describe role usage.
python
from pymilvus import MilvusClient
client = MilvusClient(uri="YOUR_CLUSTER_ENDPOINT", token="YOUR_CLUSTER_TOKEN")
client.create_user("analyst", "Milvus123", description="Analytics account")
client.update_user("analyst", description="Updated analytics account")
client.create_role("read_only", description="Read-only role")
client.alter_role("read_only", description="Updated read-only role")
print(client.describe_user("analyst"))
print(client.describe_role("read_only"))