milvus.proto 9.5 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 37 38 39 40 41 42 43 44
  rpc Flush(FlushRequest) returns (common.Status) {}

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

  // TODO: remove
  rpc RegisterLink(RegisterLinkRequest) returns (RegisterLinkResponse) {}
}

45
message CreateCollectionRequest {
46
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
47
  string db_name = 2;
48
  string collection_name = 3;
Y
yukun 已提交
49
  // `schema` is the serialized `schema.CollectionSchema`
Z
zhenshan.cao 已提交
50
  bytes schema = 4;
51
  int32 shards_num = 5;
52 53 54
}

message DropCollectionRequest {
55
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
56
  string db_name = 2;
57
  string collection_name = 3;
58 59 60
}

message HasCollectionRequest {
61
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
62
  string db_name = 2;
63
  string collection_name = 3;
N
neza2017 已提交
64
  uint64 time_stamp = 4;
65 66
}

Y
yukun 已提交
67 68 69 70 71
message BoolResponse {
  common.Status status = 1;
  bool value = 2;
}

Z
zhenshan.cao 已提交
72 73 74 75 76
message StringResponse {
  common.Status status = 1;
  string value = 2;
}

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

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

message LoadCollectionRequest {
94
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
95
  string db_name = 2;
96 97 98 99
  string collection_name = 3;
}

message ReleaseCollectionRequest {
100
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
101
  string db_name = 2;
102 103 104
  string collection_name = 3;
}

G
godchen 已提交
105
message GetCollectionStatisticsRequest {
106
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
107
  string db_name = 2;
108 109 110
  string collection_name = 3;
}

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

G
godchen 已提交
116
message ShowCollectionsRequest {
117
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
118
  string db_name = 2;
N
neza2017 已提交
119
  uint64 time_stamp = 3;
120 121
}

G
godchen 已提交
122
message ShowCollectionsResponse {
Z
zhenshan.cao 已提交
123 124
  common.Status status = 1;
  repeated string collection_names = 2;
125 126 127
}

message CreatePartitionRequest {
128
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
129
  string db_name = 2;
130 131 132 133 134
  string collection_name = 3;
  string partition_name = 4;
}

message DropPartitionRequest {
135
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
136
  string db_name = 2;
137 138 139 140 141
  string collection_name = 3;
  string partition_name = 4;
}

message HasPartitionRequest {
142
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
143
  string db_name = 2;
144 145 146 147
  string collection_name = 3;
  string partition_name = 4;
}

G
godchen 已提交
148
message LoadPartitionsRequest {
149
  common.MsgBase base = 1;
150 151 152 153 154
  string db_name = 2;
  string collection_name = 3;
  repeated string partition_names = 4;
}

G
godchen 已提交
155
message ReleasePartitionsRequest {
156
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
157
  string db_name = 2;
158
  string collection_name = 3;
G
godchen 已提交
159
  repeated string partition_names = 4;
160 161
}

G
godchen 已提交
162
message GetPartitionStatisticsRequest {
163
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
164
  string db_name = 2;
165 166 167 168
  string collection_name = 3;
  string partition_name = 4;
}

G
godchen 已提交
169
message GetPartitionStatisticsResponse {
Z
zhenshan.cao 已提交
170 171
  common.Status status = 1;
  repeated common.KeyValuePair stats = 2;
172 173
}

G
godchen 已提交
174
message ShowPartitionsRequest {
175
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
176
  string db_name = 2;
177
  string collection_name = 3;
178
  int64 collectionID = 4;
179 180
}

G
godchen 已提交
181
message ShowPartitionsResponse {
Z
zhenshan.cao 已提交
182 183 184
  common.Status status = 1;
  repeated string partition_names = 2;
  repeated int64 partitionIDs = 3;
185 186 187 188 189 190 191 192 193 194 195
}

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

message DescribeSegmentResponse {
  common.Status status = 1;
  int64 indexID = 2;
N
neza2017 已提交
196
  int64 buildID = 3;
197
  bool enable_index = 4;
198 199
}

G
godchen 已提交
200
message ShowSegmentsRequest {
201 202 203 204 205
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
}

G
godchen 已提交
206
message ShowSegmentsResponse {
207 208 209
  common.Status status = 1;
  repeated int64 segmentIDs = 2;
}
210 211

message CreateIndexRequest {
212
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
213
  string db_name = 2;
214 215 216 217 218 219
  string collection_name = 3;
  string field_name = 4;
  repeated common.KeyValuePair extra_params = 5;
}

message DescribeIndexRequest {
220
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
221
  string db_name = 2;
222 223
  string collection_name = 3;
  string field_name = 4;
224
  string index_name = 5;
225 226 227 228
}

message IndexDescription {
  string index_name = 1;
G
godchen 已提交
229
  int64 indexID = 2;
230
  repeated common.KeyValuePair params = 3;
231
  string field_name = 4;
232 233 234
}

message DescribeIndexResponse {
235 236 237 238
  common.Status status = 1;
  repeated IndexDescription index_descriptions = 2;
}

239 240 241 242 243 244 245 246 247 248 249 250 251 252
message GetIndexBuildProgressRequest {
  common.MsgBase base = 1;
  string db_name = 2 ;
  string collection_name = 3;
  string field_name = 4;
  string index_name = 5;
}

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

G
godchen 已提交
253
message GetIndexStateRequest {
254 255 256 257 258 259 260
  common.MsgBase base = 1;
  string db_name = 2 ;
  string collection_name = 3;
  string field_name = 4;
  string index_name = 5;
}

G
godchen 已提交
261
message GetIndexStateResponse {
262 263
  common.Status status = 1;
  common.IndexState state = 2;
264 265
}

X
xige-16 已提交
266 267 268 269 270 271 272 273
message DropIndexRequest {
  common.MsgBase base = 1;
  string db_name = 2;
  string collection_name = 3;
  string field_name = 4;
  string index_name = 5;
}

274
message InsertRequest {
275
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
276
  string db_name = 2;
277 278 279
  string collection_name = 3;
  string partition_name = 4;
  repeated common.Blob row_data = 5;
G
godchen 已提交
280
  repeated uint32 hash_keys = 6;
281 282 283
}

message InsertResponse {
Z
zhenshan.cao 已提交
284
  common.Status status = 1;
G
godchen 已提交
285 286
  int64 rowID_begin = 2;
  int64 rowID_end = 3;
Y
yukun 已提交
287 288 289
}

enum PlaceholderType {
G
godchen 已提交
290 291 292
  None = 0;
  BinaryVector = 100;
  FloatVector = 101;
Y
yukun 已提交
293 294 295 296 297 298 299 300 301 302 303
}

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;
304 305 306
}

message SearchRequest {
307
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
308
  string db_name = 2;
309
  string collection_name = 3;
G
godchen 已提交
310
  repeated string partition_names = 4;
311
  string dsl = 5;
Y
yukun 已提交
312 313
  // serialized `PlaceholderGroup`
  bytes placeholder_group = 6;
314 315
  common.DslType dsl_type = 7;
  repeated common.KeyValuePair search_params = 8;
Y
yukun 已提交
316 317
}

318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
message RetrieveRequest {
  common.MsgBase base = 1;
  string db_name = 2;
  string collection_name = 3;
  repeated string partition_names = 4;
  schema.IDs ids = 5;
  repeated string output_fields = 6;
}

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

Y
yukun 已提交
333 334 335 336 337 338
message Hits {
  repeated int64 IDs = 1;
  repeated bytes row_data = 2;
  repeated float scores = 3;
}

339
message SearchResults {
Y
yukun 已提交
340 341
  common.Status status = 1;
  repeated bytes hits = 2;
342 343 344
}

message FlushRequest {
345
  common.MsgBase base = 1;
346
  string db_name = 2;
347
  repeated string collection_names = 3;
Y
yukun 已提交
348 349
}

Z
zhenshan.cao 已提交
350 351 352 353 354 355 356 357 358 359 360 361
message PersistentSegmentInfo {
  int64 segmentID = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
  uint64 open_time = 4;
  uint64 sealed_time = 5;
  uint64 flushed_time = 6;
  int64 num_rows = 7;
  int64 mem_size = 8;
  common.SegmentState state = 9;
}

G
godchen 已提交
362
message GetPersistentSegmentInfoRequest {
Z
zhenshan.cao 已提交
363 364 365 366 367
  common.MsgBase base = 1;
  string dbName = 2;
  string collectionName = 3;
}

G
godchen 已提交
368
message GetPersistentSegmentInfoResponse {
Z
zhenshan.cao 已提交
369 370 371 372
  common.Status status = 1;
  repeated PersistentSegmentInfo infos = 2;
}

Z
zhenshan.cao 已提交
373 374 375 376 377 378 379 380 381 382
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 已提交
383
message GetQuerySegmentInfoRequest {
Z
zhenshan.cao 已提交
384 385 386 387 388
  common.MsgBase base = 1;
  string dbName = 2;
  string collectionName = 3;
}

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

Z
zhenshan.cao 已提交
394

G
godchen 已提交
395
message RegisterLinkRequest {
Y
yukun 已提交
396
}
D
dragondriver 已提交
397 398 399 400 401 402 403

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

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