clean up
diff --git a/archive/pfs/api/api.proto b/archive/pfs/api/api.proto
new file mode 100644
index 0000000..56a8e9e
--- /dev/null
+++ b/archive/pfs/api/api.proto
@@ -0,0 +1,132 @@
+syntax = "proto3";
+
+package pcloud.api;
+
+option go_package = "api";
+
+enum ChunkStatus {
+ NEW = 0;
+ CREATED = 1;
+ WRITING = 2;
+ REPLICATING = 3;
+ READY = 4;
+}
+
+enum ReplicaRole {
+ SECONDARY = 0;
+ PRIMARY = 1;
+}
+
+// ChunkStorage
+
+service ChunkStorage {
+ rpc ListChunks(ListChunksRequest) returns (ListChunksResponse) {}
+
+ rpc CreateChunk(CreateChunkRequest) returns (CreateChunkResponse) {}
+
+ rpc GetChunkStatus(GetChunkStatusRequest) returns (GetChunkStatusResponse) {}
+
+ rpc ReadChunk(ReadChunkRequest) returns (ReadChunkResponse) {}
+
+ rpc WriteChunk(WriteChunkRequest) returns (WriteChunkResponse) {}
+
+ rpc RemoveChunk(RemoveChunkRequest) returns (RemoveChunkResponse) {}
+}
+
+message ListChunksRequest {
+}
+
+message ListChunksResponse {
+ repeated string chunk_id = 1;
+}
+
+message CreateChunkRequest {
+ string chunk_id = 1;
+ int32 size = 2;
+ ReplicaRole role = 3;
+ string primary_address = 4;
+}
+
+message CreateChunkResponse {
+}
+
+message GetChunkStatusRequest {
+ string chunk_id = 1;
+}
+
+message GetChunkStatusResponse {
+ ChunkStatus status = 1;
+ int32 total_bytes = 2;
+ int32 committed_bytes = 3;
+}
+
+message ReadChunkRequest {
+ string chunk_id = 1;
+ int32 offset = 2;
+ int32 num_bytes = 3;
+}
+
+message ReadChunkResponse {
+ bytes data = 1;
+}
+
+message WriteChunkRequest {
+ string chunk_id = 1;
+ int32 offset = 2;
+ bytes data = 3;
+}
+
+message WriteChunkResponse {
+ int32 bytes_written = 1;
+}
+
+message RemoveChunkRequest {
+ string chunk_id = 1;
+}
+
+message RemoveChunkResponse {
+}
+
+// MetadataStorage
+
+message ChunkStorageMetadata {
+ string chunk_id = 1;
+ int32 size_bytes = 2;
+ repeated string server = 3;
+}
+
+service MetadataStorage {
+ rpc AddChunkServer(AddChunkServerRequest) returns (AddChunkServerResponse) {}
+
+ rpc CreateBlob(CreateBlobRequest) returns (CreateBlobResponse) {}
+
+ rpc GetBlobMetadata(GetBlobMetadataRequest) returns (GetBlobMetadataResponse) {}
+}
+
+message AddChunkServerRequest {
+ string address = 1;
+}
+
+message AddChunkServerResponse {
+}
+
+message CreateBlobRequest {
+ int32 size_bytes = 1;
+ int32 chunk_size_bytes = 2;
+ int32 num_replicas = 3;
+}
+
+message CreateBlobResponse {
+ string blob_id = 1;
+ repeated ChunkStorageMetadata chunk = 2;
+}
+
+message GetBlobMetadataRequest {
+ string blob_id = 1;
+}
+
+message GetBlobMetadataResponse {
+ string blob_id = 1;
+ int32 size_bytes = 2;
+ repeated ChunkStorageMetadata chunk = 3;
+}
\ No newline at end of file