task.proto 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. syntax = "proto3";
  2. import "google/protobuf/empty.proto";
  3. service TaskRunner {
  4. rpc StartContainer (google.protobuf.Empty) returns (StartContainerResponse);
  5. rpc StopContainer (StopContainerRequest) returns (StopContainerResponse);
  6. rpc RunCommand (RunCommandRequest) returns (stream RunCommandResponse);
  7. rpc FileExists (FileExistsRequest) returns (FileExistsResponse);
  8. rpc GetFile (GetFileRequest) returns (GetFileResponse);
  9. rpc PutFile (PutFileRequest) returns (PutFileResponse);
  10. }
  11. message StartContainerResponse {
  12. string id = 1;
  13. }
  14. message StopContainerRequest {
  15. string id = 1;
  16. }
  17. message StopContainerResponse {
  18. string id = 1;
  19. }
  20. message RunCommandRequest {
  21. string id = 1;
  22. repeated string command = 2;
  23. }
  24. message RunCommandResponse {
  25. string id = 1;
  26. optional string msg = 2;
  27. }
  28. message FileExistsRequest {
  29. string id = 1;
  30. string path = 2;
  31. }
  32. message FileExistsResponse {
  33. string id = 1;
  34. string path = 2;
  35. optional bool exists = 3;
  36. }
  37. message GetFileRequest {
  38. string id = 1;
  39. string path = 2;
  40. }
  41. message GetFileResponse {
  42. string id = 1;
  43. string oss_object_key = 2;
  44. }
  45. message PutFileRequest {
  46. string id = 1;
  47. optional string oss_object_key = 2;
  48. optional string local_path = 3;
  49. optional bytes payload = 4;
  50. string path = 5;
  51. }
  52. message PutFileResponse {
  53. string id = 1;
  54. string path = 2;
  55. bool success = 3;
  56. }