AlterRole()
This operation updates the description of a role.
Status AlterRole(const AlterRoleRequest& request)
Request Syntax
auto request = AlterRoleRequest()
.WithRoleName(role_name)
.WithDescription(description);
REQUEST METHODS:
WithRoleName(const std::string& role_name)Sets the name of the role.
SetRoleName(const std::string& role_name)Set the role name.
WithDescription(const std::string& description)Sets the role’s description.
SetDescription(const std::string& description)Set the role description.
RETURNS:
Status
Check status.IsOk() to confirm success.
ERROR HANDLING:
Status
Failures are reported through the returned Status. The SDK converts internal exceptions into a non-OK Status; public API calls do not throw. Inspect
status.IsOk()andstatus.Message()for failure details. See Status.
Example
#include "milvus/MilvusClientV2.h"
auto client = milvus::MilvusClientV2::Create();
milvus::ConnectParam connect_param{"http://localhost:19530", "root:Milvus"};
auto status = client->Connect(connect_param);
if (!status.IsOk()) {
std::cout << status.Message() << std::endl;
}
status = client->AlterRole(
milvus::AlterRoleRequest()
.WithRoleName(role_name)
.WithDescription(description)
);
if (!status.IsOk()) {
std::cout << status.Message() << std::endl;
}