milvus.proto 11.3 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
  rpc DropIndex(DropIndexRequest) returns (common.Status) {}

33
  rpc Insert(InsertRequest) returns (MutationResult) {}
G
godchen 已提交
34
  rpc Search(SearchRequest) returns (SearchResults) {}
35
  rpc Retrieve(RetrieveRequest) returns (RetrieveResults) {}
36
  rpc Flush(FlushRequest) returns (FlushResponse) {}
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
  uint32 num_rows = 7;
292 293
}

294
message MutationResult {
Z
zhenshan.cao 已提交
295
  common.Status status = 1;
296 297 298 299 300 301 302 303
  schema.IDs IDs = 2; // required for insert, delete
  repeated uint32 succ_index = 3; // error indexes indicate
  repeated uint32 err_index = 4; // error indexes indicate
  bool acknowledged = 5;
  int64 insert_cnt = 6;
  int64 delete_cnt = 7;
  int64 upsert_cnt = 8;
  uint64 timestamp = 9;
Y
yukun 已提交
304 305 306
}

enum PlaceholderType {
G
godchen 已提交
307 308 309
  None = 0;
  BinaryVector = 100;
  FloatVector = 101;
Y
yukun 已提交
310 311 312 313 314 315 316 317 318 319 320
}

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;
321 322 323
}

message SearchRequest {
Z
zhenshan.cao 已提交
324
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
325
  string db_name = 2;
Z
zhenshan.cao 已提交
326 327 328
  string collection_name = 3; // must
  repeated string partition_names = 4; // must
  string dsl = 5; // must
Y
yukun 已提交
329
  // serialized `PlaceholderGroup`
Z
zhenshan.cao 已提交
330 331
  bytes placeholder_group = 6; // must
  common.DslType dsl_type = 7; // must
332 333 334
  repeated string output_fields = 8;
  repeated common.KeyValuePair search_params = 9; // must
  uint64 travel_timestamp = 10;
335
  uint64 guarantee_timestamp = 11; // guarantee_timestamp
Y
yukun 已提交
336 337
}

338
message RetrieveRequest {
Z
zhenshan.cao 已提交
339
  common.MsgBase base = 1; // must
340
  string db_name = 2;
Z
zhenshan.cao 已提交
341 342 343 344
  string collection_name = 3; // must
  repeated string partition_names = 4; // must
  schema.IDs ids = 5; // must
  repeated string output_fields = 6; // must
345
  uint64 travel_timestamp = 7;
346
  uint64 guarantee_timestamp = 8; // guarantee_timestamp
347 348 349 350 351 352 353 354
}

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

Y
yukun 已提交
355 356 357 358 359 360
message Hits {
  repeated int64 IDs = 1;
  repeated bytes row_data = 2;
  repeated float scores = 3;
}

361
message SearchResults {
Y
yukun 已提交
362
  common.Status status = 1;
363
  schema.SearchResultData results = 2;
364 365 366
}

message FlushRequest {
367
  common.MsgBase base = 1;
368
  string db_name = 2;
369
  repeated string collection_names = 3;
Y
yukun 已提交
370 371
}

372 373 374 375 376 377
message FlushResponse{
  common.Status status = 1;
  string db_name = 2;
  map<string, schema.LongArray> coll_segIDs = 3;
}

X
Xiangyu Wang 已提交
378 379 380 381 382 383 384 385 386 387 388 389 390 391
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 已提交
392 393 394 395
message PersistentSegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
396 397
  int64 num_rows = 4;
  common.SegmentState state = 5;
Z
zhenshan.cao 已提交
398 399
}

G
godchen 已提交
400
message GetPersistentSegmentInfoRequest {
Z
zhenshan.cao 已提交
401
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
402
  string dbName = 2;
Z
zhenshan.cao 已提交
403
  string collectionName = 3; // must
Z
zhenshan.cao 已提交
404 405
}

G
godchen 已提交
406
message GetPersistentSegmentInfoResponse {
Z
zhenshan.cao 已提交
407 408 409 410
  common.Status status = 1;
  repeated PersistentSegmentInfo infos = 2;
}

Z
zhenshan.cao 已提交
411 412 413 414 415 416 417 418 419 420
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 已提交
421
message GetQuerySegmentInfoRequest {
Z
zhenshan.cao 已提交
422
  common.MsgBase base = 1; // must
Z
zhenshan.cao 已提交
423
  string dbName = 2;
Z
zhenshan.cao 已提交
424
  string collectionName = 3; // must
Z
zhenshan.cao 已提交
425 426
}

G
godchen 已提交
427
message GetQuerySegmentInfoResponse {
Z
zhenshan.cao 已提交
428 429 430 431
  common.Status status = 1;
  repeated QuerySegmentInfo infos = 2;
}

X
Xiangyu Wang 已提交
432 433 434 435 436 437 438
message DummyRequest {
  string request_type = 1;
}

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

G
godchen 已提交
440
message RegisterLinkRequest {
Y
yukun 已提交
441
}
D
dragondriver 已提交
442 443 444 445 446 447 448

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

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