hasRole()

This operation checks if a role exists in the Milvus cluster.

await milvusClient.hasRole(data: HasRoleReq)

Request Syntax

await milvusClient.hasRole({
    roleName: string,
    timeout?: number,
})

PARAMETERS:

  • roleName (string) -

    [REQUIRED]

    The name of the role to check.

  • timeout (number) -

    RPC timeout in milliseconds. Optional.

RETURNS:

Promise

The response contains a hasRole boolean indicating whether the role exists.

EXCEPTIONS:

  • MilvusError

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

Example

import { MilvusClient } from '@zilliz/milvus2-sdk-node';

const client = new MilvusClient({
    address: 'localhost:19530',
    token: 'root:Milvus',
});
const res = await client.hasRole({ roleName: 'my_role' });
console.log(res.hasRole); // true or false

Try Managed Milvus for Free

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

Get Started
Feedback

Was this page helpful?