You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
2.4 KiB

  1. syntax = "proto3";
  2. package filer_pb;
  3. //////////////////////////////////////////////////
  4. service SeaweedFiler {
  5. rpc LookupDirectoryEntry (LookupDirectoryEntryRequest) returns (LookupDirectoryEntryResponse) {
  6. }
  7. rpc ListEntries (ListEntriesRequest) returns (ListEntriesResponse) {
  8. }
  9. rpc GetFileAttributes (GetFileAttributesRequest) returns (GetFileAttributesResponse) {
  10. }
  11. rpc GetFileContent (GetFileContentRequest) returns (GetFileContentResponse) {
  12. }
  13. rpc CreateEntry (CreateEntryRequest) returns (CreateEntryResponse) {
  14. }
  15. rpc AppendFileChunks (AppendFileChunksRequest) returns (AppendFileChunksResponse) {
  16. }
  17. rpc DeleteEntry (DeleteEntryRequest) returns (DeleteEntryResponse) {
  18. }
  19. rpc AssignVolume (AssignVolumeRequest) returns (AssignVolumeResponse) {
  20. }
  21. }
  22. //////////////////////////////////////////////////
  23. message LookupDirectoryEntryRequest {
  24. string directory = 1;
  25. string name = 2;
  26. }
  27. message LookupDirectoryEntryResponse {
  28. Entry entry = 1;
  29. }
  30. message ListEntriesRequest {
  31. string directory = 1;
  32. }
  33. message ListEntriesResponse {
  34. repeated Entry entries = 1;
  35. }
  36. message Entry {
  37. string name = 1;
  38. bool is_directory = 2;
  39. repeated FileChunk chunks = 3;
  40. FuseAttributes attributes = 4;
  41. }
  42. message FileChunk {
  43. string file_id = 1;
  44. int64 offset = 2;
  45. uint64 size = 3;
  46. }
  47. message FuseAttributes {
  48. uint64 file_size = 1;
  49. int64 mtime = 2;
  50. uint32 file_mode = 3;
  51. uint32 uid = 4;
  52. uint32 gid = 5;
  53. }
  54. message GetFileAttributesRequest {
  55. string name = 1;
  56. string parent_dir = 2;
  57. string file_id = 3;
  58. }
  59. message GetFileAttributesResponse {
  60. FuseAttributes attributes = 1;
  61. }
  62. message GetFileContentRequest {
  63. string file_id = 1;
  64. }
  65. message GetFileContentResponse {
  66. bytes content = 1;
  67. }
  68. message CreateEntryRequest {
  69. string directory = 1;
  70. Entry entry = 2;
  71. }
  72. message CreateEntryResponse {
  73. }
  74. message DeleteEntryRequest {
  75. string directory = 1;
  76. string name = 2;
  77. bool is_directory = 3;
  78. }
  79. message DeleteEntryResponse {
  80. }
  81. message AssignVolumeRequest {
  82. int32 count = 1;
  83. string collection = 2;
  84. string replication = 3;
  85. }
  86. message AssignVolumeResponse {
  87. string file_id = 1;
  88. string url = 2;
  89. string public_url = 3;
  90. int32 count = 4;
  91. }
  92. message AppendFileChunksRequest {
  93. string directory = 1;
  94. Entry entry = 2;
  95. }
  96. message AppendFileChunksResponse {
  97. }