createRole()

This operation creates a role and optionally stores a description for that role.

public void createRole(CreateRoleReq request)

Request Syntax

client.createRole(CreateRoleReq.builder()
    .roleName(String roleName)
    .description(String description)
    .build()
);

BUILDER METHODS:

  • roleName(String roleName)

    [REQUIRED]

    The name of the role to create.

  • description(String description)

    An optional description of the role. Defaults to an empty string.

RETURNS:

void

This operation returns no value.

EXCEPTIONS:

  • MilvusClientException

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

Example

import io.milvus.v2.service.rbac.request.CreateRoleReq;

client.createRole(CreateRoleReq.builder()
    .roleName("analytics_reader")
    .description("Grants read-only access to analytics collections")
    .build());

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?