BulkImportResponse
The envelope returned by the Milvus bulk-import REST endpoints: the server code/message plus the endpoint-specific data payload. CreateImportJobs(), GetImportJobProgress(), ListImportJobs(), CommitImport(), and AbortImport() all return this same response type through the response out-parameter of a Status call.
class BulkImportResponse
METHODS:
const nlohmann::json& RawJson() constReturns the raw JSON body.
int64_t Code() constReturns the REST envelope code.
std::string Message() constReturns the REST envelope message.
const nlohmann::json& Data() constReturns the REST envelope data object.
std::string JobId() constReturns the created job ID when applicable; otherwise returns an empty string.
Example
#include "milvus/MilvusClientV2.h"
#include "milvus/BulkImport.h"
#include <iostream>
auto request = milvus::MilvusImportRequest()
.WithApiKey("root:Milvus")
.WithCollectionName("demo")
.WithFiles({{"backup/1.parquet", "backup/2.parquet"}});
milvus::BulkImportResponse response;
auto status = milvus::BulkImport::CreateImportJobs(
"http://localhost:19530", request, response);
if (status.IsOk() && response.Code() == 0) {
std::cout << "job created: " << response.JobId() << std::endl;
}