Skip to content

Commit

Permalink
add initial protobuf for replistore integration
Browse files Browse the repository at this point in the history
  • Loading branch information
huettner94 committed Jul 28, 2024
1 parent 3d3c322 commit 7e07d3f
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions protobuf/replistore/replistore.proto
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);
}

0 comments on commit 7e07d3f

Please sign in to comment.