blob: ecd9dde4959598a02c56b6b9a02f1280428a90ce [file] [log] [blame]
Giorgi Lekveishvilic548ec52020-03-16 21:59:14 +04001syntax = "proto3";
2
Giorgi Lekveishvilib8f089f2020-03-18 23:28:12 +04003package pcloud.api;
4
5option go_package = "api";
Giorgi Lekveishvilic548ec52020-03-16 21:59:14 +04006
7message Chunk {
8 string chunk_id = 1;
9 int32 size_bytes = 2;
10 bytes data = 3;
11}
12
13// ChunkStorage
14
15service ChunkStorage {
16 rpc ListChunks(ListChunksRequest) returns (ListChunksResponse) {}
17
18 rpc ReadChunk(ReadChunkRequest) returns (ReadChunkResponse) {}
19
20 rpc StoreChunk(StoreChunkRequest) returns (StoreChunkResponse) {}
21}
22
23message ListChunksRequest {
24}
25
26message ListChunksResponse {
27 repeated string chunk_id = 1;
28}
29
30message ReadChunkRequest {
31 string chunk_id = 1;
32 int32 offset = 2;
33 int32 num_bytes = 3;
34}
35
36message ReadChunkResponse {
37 bytes data = 1;
38}
39
40message StoreChunkRequest {
41 string chunk_id = 1;
42 bytes data = 2;
43}
44
45message StoreChunkResponse {
46}
47
48// MetadataStorage
49
50message ChunkStorageMetadata {
51 string chunk_id = 1;
52 int32 size_bytes = 2;
53 repeated string server = 3;
54}
55
56service MetadataStorage {
57 rpc AddChunkServer(AddChunkServerRequest) returns (AddChunkServerResponse) {}
58
59 rpc CreateBlob(CreateBlobRequest) returns (CreateBlobResponse) {}
60
61 rpc GetBlobMetadata(GetBlobMetadataRequest) returns (GetBlobMetadataResponse) {}
62}
63
64message AddChunkServerRequest {
65 string address = 1;
66}
67
68message AddChunkServerResponse {
69}
70
71message CreateBlobRequest {
72 int32 size_bytes = 1;
73 int32 chunk_size_bytes = 2;
74 int32 num_replicas = 3;
75}
76
77message CreateBlobResponse {
78 string blob_id = 1;
79 repeated ChunkStorageMetadata chunk = 2;
80}
81
82message GetBlobMetadataRequest {
83 string blob_id = 1;
84}
85
86message GetBlobMetadataResponse {
87 string blob_id = 1;
88 int32 size_bytes = 2;
89 repeated ChunkStorageMetadata chunk = 3;
90}