machi/src/machi.proto

113 lines
2.6 KiB
Protocol Buffer
Raw Normal View History

/* -------------------------------------------------------------------
**
** machi.proto: Protocol buffers for Machi
**
** Copyright (c) 2007-2015 Basho Technologies, Inc. All Rights Reserved.
**
** This file is provided to you under the Apache License,
** Version 2.0 (the "License"); you may not use this file
** except in compliance with the License. You may obtain
** a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing,
** software distributed under the License is distributed on an
** "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
** KIND, either express or implied. See the License for the
** specific language governing permissions and limitations
** under the License.
**
** -------------------------------------------------------------------
*/
/*
** Revision: 0.1
*/
// Java package specifiers
option java_package = "com.basho.machi.protobuf";
option java_outer_classname = "MachiPB";
enum MpbStatusCode {
OK = 0;
ERROR = 1;
}
enum MpbErrorGeneral {
BAD_ARG = 0;
WEDGED = 1;
BAD_CHECKSUM = 2;
}
// Must match with machi.hrl's values!
enum MpbCSumType {
CSUM_TAG_NONE = 0;
CSUM_TAG_CLIENT_GEN = 1;
CSUM_TAG_SERVER_GEN = 2;
CSUM_TAG_SERVER_REGEN = 3;
}
// chunk_pos() type
message MpbChunkPos {
2015-06-18 08:31:48 +00:00
required uint64 offset = 1;
required uint64 chunk_size = 2;
required string file_name = 3;
}
// chunk_csum() type
message MpbChunkCSum {
required MpbCSumType type = 1;
required bytes csum = 2;
}
// epoch_id() type
2015-06-18 07:16:23 +00:00
message MpbEpochId {
required uint32 epoch_num = 1;
required MpbChunkCSum epoch_csum = 2;
}
2015-06-18 07:16:23 +00:00
// Error response - may be generated for any Req
message MpbErrorResp {
2015-06-18 08:31:48 +00:00
required string errmsg = 1;
2015-06-18 07:16:23 +00:00
required uint32 errcode = 2;
}
2015-06-18 08:31:48 +00:00
// ping() request
message MpbEchoReq {
optional string message = 1;
}
message MpbEchoResp {
optional string message = 1;
}
// append_chunk() request
message MpbAppendChunkReq {
2015-06-18 07:16:23 +00:00
required string prefix = 1;
optional bytes placement_key = 2;
required bytes chunk = 3;
optional uint32 chunk_extra = 4;
}
// append_chunk() response
message MpbAppendChunkResp {
required MpbStatusCode status = 1;
optional MpbChunkPos chunk_pos = 2;
optional MbpGeneralError = 3;
}
// Authentication request
message MpbAuthReq {
required bytes user = 1;
required bytes password = 2;
}
2015-06-18 07:16:23 +00:00
2015-06-18 08:31:48 +00:00
// Dummy authentication request, not used! Included for demo purposes only.
message MpbDummyAuthReq {
required bytes user = 1;
required bytes password = 2;
}
2015-06-18 07:16:23 +00:00