-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add initial protobuf for replistore integration
- Loading branch information
1 parent
3d3c322
commit 7e07d3f
Showing
1 changed file
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// Copyright (C) 2023 Felix Huettner | ||
// | ||
// This file is part of DTRD. | ||
// | ||
// DTRD is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// DTRD is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
syntax = "proto3"; | ||
|
||
package replistore; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
|
||
message Bucket { string name = 1; } | ||
|
||
message CreateBucketRequest { string name = 1; } | ||
message CreateBucketResponse { Bucket bucket = 1; } | ||
|
||
message ListBucketRequest {} | ||
message ListBucketResponse { repeated Bucket buckets = 1; } | ||
|
||
message DeleteBucketRequest { string name = 1; } | ||
message DeleteBucketResponse {} | ||
|
||
message ReplicationPeer { | ||
string endpoint = 1; | ||
google.protobuf.Timestamp last_contact = 2; | ||
} | ||
|
||
message CreateReplicationPeerRequest { string endpoint = 1; } | ||
message CreateReplicationPeerResponse { ReplicationPeer peer = 1; } | ||
|
||
message ListReplicationPeerRequest {} | ||
message ListReplicationPeerResponse { repeated ReplicationPeer peers = 1; } | ||
|
||
message DeleteReplicationPeerRequest { string name = 1; } | ||
message DeleteReplicationPeerResponse {} | ||
|
||
message BucketReplicationConfig { | ||
string endpoint = 1; | ||
string target_bucket_name = 2; | ||
} | ||
|
||
message BucketReplicationStatus { | ||
google.protobuf.Timestamp last_sent = 1; | ||
google.protobuf.Timestamp last_recived = 2; | ||
uint64 current_local_version = 3; | ||
uint64 last_known_peer_version = 4; | ||
|
||
enum ReplicationType { | ||
SENDING = 0; | ||
RECEIVING = 1; | ||
} | ||
ReplicationType type = 5; | ||
} | ||
|
||
message BucketReplication { | ||
BucketReplicationConfig config = 1; | ||
BucketReplicationStatus status = 2; | ||
} | ||
|
||
message SetBucketReplicationRequest { | ||
string bucket_name = 1; | ||
repeated BucketReplicationConfig configs = 2; | ||
} | ||
message SetBucketReplicationResponse { | ||
repeated BucketReplication replication = 1; | ||
} | ||
|
||
message ListBucketReplicationRequest { string bucket_name = 1; } | ||
message ListBucketReplicationResponse { | ||
repeated BucketReplication replication = 1; | ||
} | ||
|
||
service AdminService { | ||
rpc CreateBucket(CreateBucketRequest) returns (CreateBucketResponse); | ||
rpc ListBucket(ListBucketRequest) returns (ListBucketResponse); | ||
rpc DeleteBucket(DeleteBucketRequest) returns (DeleteBucketResponse); | ||
|
||
rpc CreateReplicationPeer(CreateReplicationPeerRequest) | ||
returns (CreateReplicationPeerResponse); | ||
rpc ListReplicationPeer(ListReplicationPeerRequest) | ||
returns (ListReplicationPeerResponse); | ||
rpc DeleteReplicationPeer(DeleteReplicationPeerRequest) | ||
returns (DeleteReplicationPeerResponse); | ||
|
||
rpc SetBucketReplication(SetBucketReplicationRequest) | ||
returns (SetBucketReplicationResponse); | ||
rpc ListBucketReplication(ListBucketReplicationRequest) | ||
returns (ListBucketReplicationResponse); | ||
} |