Skip to content

Commit 73151d1

Browse files
committed
test adding a stream on the server
1 parent fbfa08b commit 73151d1

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

provisionerd/proto/provisionerd.proto

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,34 @@ message CompletedJob {
106106
}
107107
}
108108

109+
enum DataUploadType {
110+
UPLOAD_TYPE_UNKNOWN = 0;
111+
// UPLOAD_TYPE_MODULE_FILES is used to stream over terraform module files.
112+
// These files are located in `.terraform/modules` and are used for dynamic
113+
// parameters.
114+
UPLOAD_TYPE_MODULE_FILES = 1;
115+
}
116+
117+
message DataUpload {
118+
DataUploadType upload_type = 1;
119+
// data_hash is the sha256 of the payload to be uploaded.
120+
// This is also used to uniquely identify the upload.
121+
bytes data_hash = 2;
122+
// file_size is the total size of the data being uploaded.
123+
int64 file_size = 3;
124+
// Number of chunks to be uploaded.
125+
int32 chunks = 4;
126+
}
127+
128+
// ChunkPiece is used to stream over large files (over the 4mb limit).
129+
message ChunkPiece {
130+
bytes data = 1;
131+
// full_data_hash should match the hash from the original
132+
// DataUpload message
133+
bytes full_data_hash = 2;
134+
int32 piece_index = 3;
135+
}
136+
109137
// LogSource represents the sender of the log.
110138
enum LogSource {
111139
PROVISIONER_DAEMON = 0;
@@ -153,6 +181,14 @@ message CommitQuotaResponse {
153181

154182
message CancelAcquire {}
155183

184+
message CompleteWithFilesRequest {
185+
oneof type {
186+
CompletedJob complete = 1;
187+
DataUpload data_upload = 2;
188+
ChunkPiece chunk_piece = 3;
189+
}
190+
}
191+
156192
service ProvisionerDaemon {
157193
// AcquireJob requests a job. Implementations should
158194
// hold a lock on the job until CompleteJob() is
@@ -180,4 +216,5 @@ service ProvisionerDaemon {
180216

181217
// CompleteJob indicates a job has been completed.
182218
rpc CompleteJob(CompletedJob) returns (Empty);
219+
rpc CompleteJobWithFiles(stream CompleteWithFilesRequest) returns (Empty);
183220
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy