DropRowPolicy()
Drops a row policy by name. Dropping a policy that does not exist succeeds.
Status DropRowPolicy(const DropRowPolicyRequest& request)
Request Syntax
auto request = milvus::DropRowPolicyRequest()
.WithDatabaseName("default")
.WithCollectionName("messages")
.WithPolicyName("tenant_read_only");
REQUEST METHODS:
WithDatabaseName(const std::string& db_name)Sets the database name. Use the default database when it is empty.
SetDatabaseName(const std::string& db_name)Sets the database name. Use the default database when it is empty.
WithCollectionName(const std::string& collection_name)Sets the collection that owns the policy.
SetCollectionName(const std::string& collection_name)Sets the collection that owns the policy.
WithPolicyName(const std::string& policy_name)Sets the policy to drop.
SetPolicyName(const std::string& policy_name)Sets the policy to drop.
RETURNS:
Returns a Status indicating whether the operation succeeded.
ERROR HANDLING:
-
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"
#include <iostream>
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;
}
auto request = milvus::DropRowPolicyRequest()
.WithDatabaseName("default")
.WithCollectionName("messages")
.WithPolicyName("tenant_read_only");
status = client->DropRowPolicy(request);
if (!status.IsOk()) {
std::cout << status.Message() << std::endl;
}