milvus.proto 9.0 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 51 52
}

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

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

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

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

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

message DescribeCollectionResponse {
Y
yukun 已提交
82 83
  common.Status status = 1;
  schema.CollectionSchema schema = 2;
84
  int64 collectionID = 3;
85 86 87
}

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

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

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

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

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

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

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

message DropPartitionRequest {
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 HasPartitionRequest {
135
  common.MsgBase base = 1;
Z
zhenshan.cao 已提交
136
  string db_name = 2;
137 138 139 140
  string collection_name = 3;
  string partition_name = 4;
}

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

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

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

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

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

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

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

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

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

G
godchen 已提交
199
message ShowSegmentsResponse {
200 201 202
  common.Status status = 1;
  repeated int64 segmentIDs = 2;
}
203 204

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

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

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

message DescribeIndexResponse {
228 229 230 231
  common.Status status = 1;
  repeated IndexDescription index_descriptions = 2;
}

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

G
godchen 已提交
254
message GetIndexStateResponse {
255 256
  common.Status status = 1;
  common.IndexState state = 2;
257 258
}

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

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

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

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

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;
297 298 299
}

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

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

317
message SearchResults {
Y
yukun 已提交
318 319
  common.Status status = 1;
  repeated bytes hits = 2;
320 321 322
}

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

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

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

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

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

Z
zhenshan.cao 已提交
372

G
godchen 已提交
373
message RegisterLinkRequest {
Y
yukun 已提交
374
}
D
dragondriver 已提交
375 376 377 378 379 380 381

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

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