milvus.proto 10.7 KB
Newer Older
1 2 3
syntax = "proto3";
package milvus.proto.milvus;

X
Xiangyu Wang 已提交
4
option go_package = "github.com/milvus-io/milvus/internal/proto/milvuspb";
5 6

import "common.proto";
Y
yukun 已提交
7
import "schema.proto";
8

G
godchen 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
service MilvusService {
  rpc CreateCollection(CreateCollectionRequest) returns (common.Status) {}
  rpc DropCollection(DropCollectionRequest) returns (common.Status) {}
  rpc HasCollection(HasCollectionRequest) returns (BoolResponse) {}
  rpc LoadCollection(LoadCollectionRequest) returns (common.Status) {}
  rpc ReleaseCollection(ReleaseCollectionRequest) returns (common.Status) {}
  rpc DescribeCollection(DescribeCollectionRequest) returns (DescribeCollectionResponse) {}
  rpc GetCollectionStatistics(GetCollectionStatisticsRequest) returns (GetCollectionStatisticsResponse) {}
  rpc ShowCollections(ShowCollectionsRequest) returns (ShowCollectionsResponse) {}

  rpc CreatePartition(CreatePartitionRequest) returns (common.Status) {}
  rpc DropPartition(DropPartitionRequest) returns (common.Status) {}
  rpc HasPartition(HasPartitionRequest) returns (BoolResponse) {}
  rpc LoadPartitions(LoadPartitionsRequest) returns (common.Status) {}
  rpc ReleasePartitions(ReleasePartitionsRequest) returns (common.Status) {}
  rpc GetPartitionStatistics(GetPartitionStatisticsRequest) returns (GetPartitionStatisticsResponse) {}
  rpc ShowPartitions(ShowPartitionsRequest) returns (ShowPartitionsResponse) {}

  rpc CreateIndex(CreateIndexRequest) returns (common.Status) {}
  rpc DescribeIndex(DescribeIndexRequest) returns (DescribeIndexResponse) {}
  rpc GetIndexState(GetIndexStateRequest) returns (GetIndexStateResponse) {}
30
  rpc GetIndexBuildProgress(GetIndexBuildProgressRequest) returns (GetIndexBuildProgressResponse) {}
G
godchen 已提交
31 32 33 34
  rpc DropIndex(DropIndexRequest) returns (common.Status) {}

  rpc Insert(InsertRequest) returns (InsertResponse) {}
  rpc Search(SearchRequest) returns (SearchResults) {}
35
  rpc Retrieve(RetrieveRequest) returns (RetrieveResults) {}
G
godchen 已提交
36
  rpc Flush(FlushRequest) returns (common.Status) {}
X
Xiangyu Wang 已提交
37
  rpc Query(QueryRequest) returns (QueryResults) {}
G
godchen 已提交
38 39 40 41

  rpc GetPersistentSegmentInfo(GetPersistentSegmentInfoRequest) returns (GetPersistentSegmentInfoResponse) {}
  rpc GetQuerySegmentInfo(GetQuerySegmentInfoRequest) returns (GetQuerySegmentInfoResponse) {}

X
Xiangyu Wang 已提交
42 43
  rpc Dummy(DummyRequest) returns (DummyResponse) {}

G
godchen 已提交
44 45 46 47
  // TODO: remove
  rpc RegisterLink(RegisterLinkRequest) returns (RegisterLinkResponse) {}
}

48
message CreateCollectionRequest {
Z
zhenshan.cao 已提交
49
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
50
  string db_name = 2;
Z
zhenshan.cao 已提交
51
  string collection_name = 3; // must
Y
yukun 已提交
52
  // `schema` is the serialized `schema.CollectionSchema`
Z
zhenshan.cao 已提交
53 54
  bytes schema = 4; // must
  int32 shards_num = 5; // must. Once set, no modification is allowed
55 56 57
}

message DropCollectionRequest {
Z
zhenshan.cao 已提交
58
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
59
  string db_name = 2;
Z
zhenshan.cao 已提交
60
  string collection_name = 3; // must
61 62 63
}

message HasCollectionRequest {
Z
zhenshan.cao 已提交
64
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
65
  string db_name = 2;
Z
zhenshan.cao 已提交
66
  string collection_name = 3; // must
N
neza2017 已提交
67
  uint64 time_stamp = 4;
68 69
}

Y
yukun 已提交
70 71 72 73 74
message BoolResponse {
  common.Status status = 1;
  bool value = 2;
}

Z
zhenshan.cao 已提交
75 76 77 78 79
message StringResponse {
  common.Status status = 1;
  string value = 2;
}

80
message DescribeCollectionRequest {
Z
zhenshan.cao 已提交
81
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
82
  string db_name = 2;
Z
zhenshan.cao 已提交
83
  string collection_name = 3; // must
N
neza2017 已提交
84
  int64 collectionID = 4;
N
neza2017 已提交
85
  uint64 time_stamp = 5;
86 87 88
}

message DescribeCollectionResponse {
Y
yukun 已提交
89 90
  common.Status status = 1;
  schema.CollectionSchema schema = 2;
91
  int64 collectionID = 3;
92 93
  repeated string virtual_channel_names = 4;
  repeated string physical_channel_names = 5;
94 95 96
}

message LoadCollectionRequest {
Z
zhenshan.cao 已提交
97
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
98
  string db_name = 2;
Z
zhenshan.cao 已提交
99
  string collection_name = 3; // must
100 101 102
}

message ReleaseCollectionRequest {
Z
zhenshan.cao 已提交
103
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
104
  string db_name = 2;
Z
zhenshan.cao 已提交
105
  string collection_name = 3; // must
106 107
}

G
godchen 已提交
108
message GetCollectionStatisticsRequest {
Z
zhenshan.cao 已提交
109
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
110
  string db_name = 2;
Z
zhenshan.cao 已提交
111
  string collection_name = 3; // must
112 113
}

G
godchen 已提交
114
message GetCollectionStatisticsResponse {
Z
zhenshan.cao 已提交
115 116
  common.Status status = 1;
  repeated common.KeyValuePair stats = 2;
117 118
}

119 120 121 122 123
enum ShowCollectionsType {
  All = 0;
  InMemory = 1;
}

G
godchen 已提交
124
message ShowCollectionsRequest {
Z
zhenshan.cao 已提交
125
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
126
  string db_name = 2;
N
neza2017 已提交
127
  uint64 time_stamp = 3;
128
  ShowCollectionsType type = 4;
129 130
}

G
godchen 已提交
131
message ShowCollectionsResponse {
Z
zhenshan.cao 已提交
132 133
  common.Status status = 1;
  repeated string collection_names = 2;
134
  repeated int64 collection_ids = 3;
135 136 137
}

message CreatePartitionRequest {
Z
zhenshan.cao 已提交
138
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
139
  string db_name = 2;
Z
zhenshan.cao 已提交
140 141
  string collection_name = 3; // must
  string partition_name = 4; // must
142 143 144
}

message DropPartitionRequest {
Z
zhenshan.cao 已提交
145
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
146
  string db_name = 2;
Z
zhenshan.cao 已提交
147 148
  string collection_name = 3; // must
  string partition_name = 4; // must
149 150 151
}

message HasPartitionRequest {
Z
zhenshan.cao 已提交
152
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
153
  string db_name = 2;
Z
zhenshan.cao 已提交
154 155
  string collection_name = 3; // must
  string partition_name = 4; // must
156 157
}

G
godchen 已提交
158
message LoadPartitionsRequest {
Z
zhenshan.cao 已提交
159
  common.MsgBase base = 1; // must
160
  string db_name = 2;
Z
zhenshan.cao 已提交
161 162
  string collection_name = 3; // must
  repeated string partition_names = 4; // must
163 164
}

G
godchen 已提交
165
message ReleasePartitionsRequest {
Z
zhenshan.cao 已提交
166
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
167
  string db_name = 2;
Z
zhenshan.cao 已提交
168 169
  string collection_name = 3; // must
  repeated string partition_names = 4; // must
170 171
}

G
godchen 已提交
172
message GetPartitionStatisticsRequest {
Z
zhenshan.cao 已提交
173
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
174
  string db_name = 2;
Z
zhenshan.cao 已提交
175 176
  string collection_name = 3; // must
  string partition_name = 4; // must
177 178
}

G
godchen 已提交
179
message GetPartitionStatisticsResponse {
Z
zhenshan.cao 已提交
180 181
  common.Status status = 1;
  repeated common.KeyValuePair stats = 2;
182 183
}

G
godchen 已提交
184
message ShowPartitionsRequest {
Z
zhenshan.cao 已提交
185
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
186
  string db_name = 2;
Z
zhenshan.cao 已提交
187
  string collection_name = 3; // must
188
  int64 collectionID = 4;
189 190
}

G
godchen 已提交
191
message ShowPartitionsResponse {
Z
zhenshan.cao 已提交
192 193 194
  common.Status status = 1;
  repeated string partition_names = 2;
  repeated int64 partitionIDs = 3;
195 196 197 198 199 200 201 202 203 204 205
}

message DescribeSegmentRequest {
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 segmentID = 3;
}

message DescribeSegmentResponse {
  common.Status status = 1;
  int64 indexID = 2;
N
neza2017 已提交
206
  int64 buildID = 3;
207
  bool enable_index = 4;
208 209
}

G
godchen 已提交
210
message ShowSegmentsRequest {
211 212 213 214 215
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
}

G
godchen 已提交
216
message ShowSegmentsResponse {
217 218 219
  common.Status status = 1;
  repeated int64 segmentIDs = 2;
}
220 221

message CreateIndexRequest {
Z
zhenshan.cao 已提交
222
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
223
  string db_name = 2;
Z
zhenshan.cao 已提交
224 225 226
  string collection_name = 3; // must
  string field_name = 4; // must
  repeated common.KeyValuePair extra_params = 5; // must
227 228 229
}

message DescribeIndexRequest {
Z
zhenshan.cao 已提交
230
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
231
  string db_name = 2;
Z
zhenshan.cao 已提交
232
  string collection_name = 3; // must
233
  string field_name = 4;
Z
zhenshan.cao 已提交
234
  string index_name = 5; // No need to set up for now @2021.06.30
235 236 237 238
}

message IndexDescription {
  string index_name = 1;
G
godchen 已提交
239
  int64 indexID = 2;
240
  repeated common.KeyValuePair params = 3;
241
  string field_name = 4;
242 243 244
}

message DescribeIndexResponse {
245 246 247 248
  common.Status status = 1;
  repeated IndexDescription index_descriptions = 2;
}

249
message GetIndexBuildProgressRequest {
Z
zhenshan.cao 已提交
250
  common.MsgBase base = 1; // must
251
  string db_name = 2 ;
Z
zhenshan.cao 已提交
252
  string collection_name = 3; // must
253
  string field_name = 4;
Z
zhenshan.cao 已提交
254
  string index_name = 5; // must
255 256 257 258 259 260 261 262
}

message GetIndexBuildProgressResponse {
  common.Status status = 1;
  int64 indexed_rows = 2;
  int64 total_rows = 3;
}

G
godchen 已提交
263
message GetIndexStateRequest {
Z
zhenshan.cao 已提交
264
  common.MsgBase base = 1; // must
265
  string db_name = 2 ;
Z
zhenshan.cao 已提交
266
  string collection_name = 3; // must
267
  string field_name = 4;
Z
zhenshan.cao 已提交
268
  string index_name = 5; // No need to set up for now @2021.06.30
269 270
}

G
godchen 已提交
271
message GetIndexStateResponse {
272 273
  common.Status status = 1;
  common.IndexState state = 2;
274 275
}

X
xige-16 已提交
276
message DropIndexRequest {
Z
zhenshan.cao 已提交
277
  common.MsgBase base = 1; // must
X
xige-16 已提交
278
  string db_name = 2;
Z
zhenshan.cao 已提交
279
  string collection_name = 3; // must
X
xige-16 已提交
280
  string field_name = 4;
Z
zhenshan.cao 已提交
281
  string index_name = 5; // No need to set up for now @2021.06.30
X
xige-16 已提交
282 283
}

284
message InsertRequest {
285
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
286
  string db_name = 2;
287 288 289 290
  string collection_name = 3;
  string partition_name = 4;
  repeated schema.FieldData fields_data = 5;
  repeated uint32 hash_keys = 6;
291 292 293
}

message InsertResponse {
Z
zhenshan.cao 已提交
294
  common.Status status = 1;
G
godchen 已提交
295 296
  int64 rowID_begin = 2;
  int64 rowID_end = 3;
Y
yukun 已提交
297 298 299
}

enum PlaceholderType {
G
godchen 已提交
300 301 302
  None = 0;
  BinaryVector = 100;
  FloatVector = 101;
Y
yukun 已提交
303 304 305 306 307 308 309 310 311 312 313
}

message PlaceholderValue {
  string tag = 1;
  PlaceholderType type = 2;
  // values is a 2d-array, every array contains a vector
  repeated bytes values = 3;
}

message PlaceholderGroup {
  repeated PlaceholderValue placeholders = 1;
314 315 316
}

message SearchRequest {
Z
zhenshan.cao 已提交
317
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
318
  string db_name = 2;
Z
zhenshan.cao 已提交
319 320 321
  string collection_name = 3; // must
  repeated string partition_names = 4; // must
  string dsl = 5; // must
Y
yukun 已提交
322
  // serialized `PlaceholderGroup`
Z
zhenshan.cao 已提交
323 324 325
  bytes placeholder_group = 6; // must
  common.DslType dsl_type = 7; // must
  repeated common.KeyValuePair search_params = 8; // must
Y
yukun 已提交
326 327
}

328
message RetrieveRequest {
Z
zhenshan.cao 已提交
329
  common.MsgBase base = 1; // must
330
  string db_name = 2;
Z
zhenshan.cao 已提交
331 332 333 334
  string collection_name = 3; // must
  repeated string partition_names = 4; // must
  schema.IDs ids = 5; // must
  repeated string output_fields = 6; // must
335 336 337 338 339 340 341 342
}

message RetrieveResults {
  common.Status status = 1;
  schema.IDs ids = 2;
  repeated schema.FieldData fields_data = 3;
}

Y
yukun 已提交
343 344 345 346 347 348
message Hits {
  repeated int64 IDs = 1;
  repeated bytes row_data = 2;
  repeated float scores = 3;
}

349
message SearchResults {
Y
yukun 已提交
350 351
  common.Status status = 1;
  repeated bytes hits = 2;
352 353 354
}

message FlushRequest {
355
  common.MsgBase base = 1;
356
  string db_name = 2;
357
  repeated string collection_names = 3;
Y
yukun 已提交
358 359
}

X
Xiangyu Wang 已提交
360 361 362 363 364 365 366 367 368 369 370 371 372 373
message QueryRequest {
  common.MsgBase base = 1;
  string db_name = 2;
  string collection_name = 3;
  string expr = 4;
  repeated string output_fields = 5;
  repeated string partition_names = 6;
}

message QueryResults {
  common.Status status = 1;
  repeated schema.FieldData fields_data = 2;
}

Z
zhenshan.cao 已提交
374 375 376 377
message PersistentSegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
378 379
  int64 num_rows = 4;
  common.SegmentState state = 5;
Z
zhenshan.cao 已提交
380 381
}

G
godchen 已提交
382
message GetPersistentSegmentInfoRequest {
Z
zhenshan.cao 已提交
383
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
384
  string dbName = 2;
Z
zhenshan.cao 已提交
385
  string collectionName = 3; // must
Z
zhenshan.cao 已提交
386 387
}

G
godchen 已提交
388
message GetPersistentSegmentInfoResponse {
Z
zhenshan.cao 已提交
389 390 391 392
  common.Status status = 1;
  repeated PersistentSegmentInfo infos = 2;
}

Z
zhenshan.cao 已提交
393 394 395 396 397 398 399 400 401 402
message QuerySegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
  int64 mem_size = 4;
  int64 num_rows = 5;
  string index_name = 6;
  int64 indexID = 7;
}

G
godchen 已提交
403
message GetQuerySegmentInfoRequest {
Z
zhenshan.cao 已提交
404
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
405
  string dbName = 2;
Z
zhenshan.cao 已提交
406
  string collectionName = 3; // must
Z
zhenshan.cao 已提交
407 408
}

G
godchen 已提交
409
message GetQuerySegmentInfoResponse {
Z
zhenshan.cao 已提交
410 411 412 413
  common.Status status = 1;
  repeated QuerySegmentInfo infos = 2;
}

X
Xiangyu Wang 已提交
414 415 416 417 418 419 420
message DummyRequest {
  string request_type = 1;
}

message DummyResponse {
  string response = 1;
}
Z
zhenshan.cao 已提交
421

G
godchen 已提交
422
message RegisterLinkRequest {
Y
yukun 已提交
423
}
D
dragondriver 已提交
424 425 426 427 428 429 430

message RegisterLinkResponse {
  common.Address address = 1;
  common.Status status = 2;
}

service ProxyService {
G
godchen 已提交
431
  rpc RegisterLink(RegisterLinkRequest) returns (RegisterLinkResponse) {}
D
dragondriver 已提交
432
}