DescribeRole()

Retrieves a role and its assignments.

pub async fn describe_role(&self, request: DescribeRoleRequest) -> Result<DescribeRoleResponse>

Request Syntax

let request = DescribeRoleRequest::builder()
    .role_name("analyst")
    .database_name("default")
    .build()?;

REQUEST FIELDS:

  • role_name: String

    Name of the role to describe. Required.

  • database_name: String

    Database scope used to resolve the role’s grants.

RETURNS:

Result

DescribeRoleResponse exposes description() returning a RoleDescription with the role name, description, and its granted GrantItem list (each carrying the object type, object name, database name, privilege, and grantor). Returns an Error on failure.

Example

let request = DescribeRoleRequest::builder()
    .role_name("analyst")
    .build()?;
let resp = client.describe_role(request).await?;
for grant in resp.description().get_grant_items() {
    println!("grant: {} on {}", grant.get_privilege(), grant.get_object_name());
}

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?