woodpecker/pipeline/rpc/proto/woodpecker.proto

130 lines
2.4 KiB
Protocol Buffer
Raw Normal View History

2017-06-28 17:21:22 +00:00
syntax = "proto3";
option go_package = "github.com/woodpecker-ci/woodpecker/pipeline/rpc/proto";
2017-06-28 17:21:22 +00:00
package proto;
service Woodpecker {
rpc Next (NextRequest) returns (NextReply) {}
rpc Init (InitRequest) returns (Empty) {}
rpc Wait (WaitRequest) returns (Empty) {}
rpc Done (DoneRequest) returns (Empty) {}
rpc Extend (ExtendRequest) returns (Empty) {}
rpc Update (UpdateRequest) returns (Empty) {}
rpc Upload (UploadRequest) returns (Empty) {}
rpc Log (LogRequest) returns (Empty) {}
rpc RegisterAgent (RegisterAgentRequest) returns (RegisterAgentResponse) {}
rpc ReportHealth (ReportHealthRequest) returns (Empty) {}
}
2017-06-28 17:21:22 +00:00
message File {
string name = 1;
string step = 2;
2017-06-28 17:21:22 +00:00
string mime = 3;
int64 time = 4;
int32 size = 5;
bytes data = 6;
2017-08-02 20:04:00 +00:00
map<string, string> meta = 7;
2017-06-28 17:21:22 +00:00
}
message State {
string name = 1;
bool exited = 2;
int32 exit_code = 3;
int64 started = 4;
int64 finished = 5;
string error = 6;
}
message Line {
string step = 1;
2017-06-28 17:21:22 +00:00
int64 time = 2;
int32 pos = 3;
string out = 4;
}
message Filter {
map<string, string> labels = 1;
}
message Pipeline {
string id = 1;
int64 timeout = 2;
bytes payload = 3;
}
message NextRequest {
Filter filter = 1;
}
message NextReply {
Pipeline pipeline = 1;
}
message InitRequest {
string id = 1;
2017-06-28 17:21:22 +00:00
State state = 2;
}
message WaitRequest {
string id = 1;
}
message DoneRequest {
string id = 1;
2017-06-28 17:21:22 +00:00
State state = 2;
}
message ExtendRequest {
string id = 1;
}
message UploadRequest {
string id = 1;
2017-06-28 17:21:22 +00:00
File file = 2;
}
message UpdateRequest {
string id = 1;
2017-06-28 17:21:22 +00:00
State state = 2;
}
message LogRequest {
string id = 1;
2017-06-28 17:21:22 +00:00
Line line = 2;
}
message Empty {
}
message ReportHealthRequest {
string status = 1;
}
message RegisterAgentRequest {
string platform = 1;
int32 capacity = 2;
string backend = 3;
string version = 4;
}
message RegisterAgentResponse {
int64 agent_id = 1;
}
// Woodpecker auth service is a simple service to authenticate agents and aquire a token
service WoodpeckerAuth {
rpc Auth (AuthRequest) returns (AuthReply) {}
}
message AuthRequest {
string agent_token = 1;
int64 agent_id = 2;
}
2017-06-28 17:21:22 +00:00
message AuthReply {
string status = 1;
int64 agent_id = 2;
string access_token = 3;
2017-06-28 17:21:22 +00:00
}