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.

129 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. int64 mtime = 4;
  47. }
  48. message FuseAttributes {
  49. uint64 file_size = 1;
  50. int64 mtime = 2;
  51. uint32 file_mode = 3;
  52. uint32 uid = 4;
  53. uint32 gid = 5;
  54. }
  55. message GetFileAttributesRequest {
  56. string name = 1;
  57. string parent_dir = 2;
  58. string file_id = 3;
  59. }
  60. message GetFileAttributesResponse {
  61. FuseAttributes attributes = 1;
  62. }
  63. message GetFileContentRequest {
  64. string file_id = 1;
  65. }
  66. message GetFileContentResponse {
  67. bytes content = 1;
  68. }
  69. message CreateEntryRequest {
  70. string directory = 1;
  71. Entry entry = 2;
  72. }
  73. message CreateEntryResponse {
  74. }
  75. message DeleteEntryRequest {
  76. string directory = 1;
  77. string name = 2;
  78. bool is_directory = 3;
  79. }
  80. message DeleteEntryResponse {
  81. }
  82. message AssignVolumeRequest {
  83. int32 count = 1;
  84. string collection = 2;
  85. string replication = 3;
  86. }
  87. message AssignVolumeResponse {
  88. string file_id = 1;
  89. string url = 2;
  90. string public_url = 3;
  91. int32 count = 4;
  92. }
  93. message AppendFileChunksRequest {
  94. string directory = 1;
  95. Entry entry = 2;
  96. }
  97. message AppendFileChunksResponse {
  98. }