milvus.proto 9.1 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 35 36 37 38 39 40 41 42 43
  rpc DropIndex(DropIndexRequest) returns (common.Status) {}

  rpc Insert(InsertRequest) returns (InsertResponse) {}
  rpc Search(SearchRequest) returns (SearchResults) {}
  rpc Flush(FlushRequest) returns (common.Status) {}

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

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

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

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

message HasCollectionRequest {
60
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
61
  string db_name = 2;
62 63 64
  string collection_name = 3;
}

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

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

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

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

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

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

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

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

G
godchen 已提交
113
message ShowCollectionsRequest {
114
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
115
  string db_name = 2;
116 117
}

G
godchen 已提交
118
message ShowCollectionsResponse {
Z
zhenshan.cao 已提交
119 120
  common.Status status = 1;
  repeated string collection_names = 2;
121 122 123
}

message CreatePartitionRequest {
124
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
125
  string db_name = 2;
126 127 128 129 130
  string collection_name = 3;
  string partition_name = 4;
}

message DropPartitionRequest {
131
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
132
  string db_name = 2;
133 134 135 136 137
  string collection_name = 3;
  string partition_name = 4;
}

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

G
godchen 已提交
144
message LoadPartitionsRequest {
145
  common.MsgBase base = 1;
146 147 148 149 150
  string db_name = 2;
  string collection_name = 3;
  repeated string partition_names = 4;
}

G
godchen 已提交
151
message ReleasePartitionsRequest {
152
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
153
  string db_name = 2;
154
  string collection_name = 3;
G
godchen 已提交
155
  repeated string partition_names = 4;
156 157
}

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

G
godchen 已提交
165
message GetPartitionStatisticsResponse {
Z
zhenshan.cao 已提交
166 167
  common.Status status = 1;
  repeated common.KeyValuePair stats = 2;
168 169
}

G
godchen 已提交
170
message ShowPartitionsRequest {
171
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
172
  string db_name = 2;
173
  string collection_name = 3;
174
  int64 collectionID = 4;
175 176
}

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

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

message DescribeSegmentResponse {
  common.Status status = 1;
  int64 indexID = 2;
N
neza2017 已提交
192
  int64 buildID = 3;
193
  bool enable_index = 4;
194 195
}

G
godchen 已提交
196
message ShowSegmentsRequest {
197 198 199 200 201
  common.MsgBase base = 1;
  int64 collectionID = 2;
  int64 partitionID = 3;
}

G
godchen 已提交
202
message ShowSegmentsResponse {
203 204 205
  common.Status status = 1;
  repeated int64 segmentIDs = 2;
}
206 207

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

message DescribeIndexRequest {
216
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
217
  string db_name = 2;
218 219
  string collection_name = 3;
  string field_name = 4;
220
  string index_name = 5;
221 222 223 224
}

message IndexDescription {
  string index_name = 1;
G
godchen 已提交
225
  int64 indexID = 2;
226
  repeated common.KeyValuePair params = 3;
227
  string field_name = 4;
228 229 230
}

message DescribeIndexResponse {
231 232 233 234
  common.Status status = 1;
  repeated IndexDescription index_descriptions = 2;
}

235 236 237 238 239 240 241 242 243 244 245 246 247 248
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 已提交
249
message GetIndexStateRequest {
250 251 252 253 254 255 256
  common.MsgBase base = 1;
  string db_name = 2 ;
  string collection_name = 3;
  string field_name = 4;
  string index_name = 5;
}

G
godchen 已提交
257
message GetIndexStateResponse {
258 259
  common.Status status = 1;
  common.IndexState state = 2;
260 261
}

X
xige-16 已提交
262 263 264 265 266 267 268 269
message DropIndexRequest {
  common.MsgBase base = 1;
  string db_name = 2;
  string collection_name = 3;
  string field_name = 4;
  string index_name = 5;
}

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

message InsertResponse {
Z
zhenshan.cao 已提交
280
  common.Status status = 1;
G
godchen 已提交
281 282
  int64 rowID_begin = 2;
  int64 rowID_end = 3;
Y
yukun 已提交
283 284 285
}

enum PlaceholderType {
G
godchen 已提交
286 287 288
  None = 0;
  BinaryVector = 100;
  FloatVector = 101;
Y
yukun 已提交
289 290 291 292 293 294 295 296 297 298 299
}

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;
300 301 302
}

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

message Hits {
  repeated int64 IDs = 1;
  repeated bytes row_data = 2;
  repeated float scores = 3;
}

320
message SearchResults {
Y
yukun 已提交
321 322
  common.Status status = 1;
  repeated bytes hits = 2;
323 324 325
}

message FlushRequest {
326
  common.MsgBase base = 1;
327
  string db_name = 2;
328
  repeated string collection_names = 3;
Y
yukun 已提交
329 330
}

Z
zhenshan.cao 已提交
331 332 333 334 335 336 337 338 339 340 341 342
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 已提交
343
message GetPersistentSegmentInfoRequest {
Z
zhenshan.cao 已提交
344 345 346 347 348
  common.MsgBase base = 1;
  string dbName = 2;
  string collectionName = 3;
}

G
godchen 已提交
349
message GetPersistentSegmentInfoResponse {
Z
zhenshan.cao 已提交
350 351 352 353
  common.Status status = 1;
  repeated PersistentSegmentInfo infos = 2;
}

Z
zhenshan.cao 已提交
354 355 356 357 358 359 360 361 362 363
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 已提交
364
message GetQuerySegmentInfoRequest {
Z
zhenshan.cao 已提交
365 366 367 368 369
  common.MsgBase base = 1;
  string dbName = 2;
  string collectionName = 3;
}

G
godchen 已提交
370
message GetQuerySegmentInfoResponse {
Z
zhenshan.cao 已提交
371 372 373 374
  common.Status status = 1;
  repeated QuerySegmentInfo infos = 2;
}

Z
zhenshan.cao 已提交
375

G
godchen 已提交
376
message RegisterLinkRequest {
Y
yukun 已提交
377
}
D
dragondriver 已提交
378 379 380 381 382 383 384

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

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