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.

148 lines
2.7 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 GetEntryAttributes (GetEntryAttributesRequest) returns (GetEntryAttributesResponse) {
  10. }
  11. rpc CreateEntry (CreateEntryRequest) returns (CreateEntryResponse) {
  12. }
  13. rpc UpdateEntry (UpdateEntryRequest) returns (UpdateEntryResponse) {
  14. }
  15. rpc DeleteEntry (DeleteEntryRequest) returns (DeleteEntryResponse) {
  16. }
  17. rpc AssignVolume (AssignVolumeRequest) returns (AssignVolumeResponse) {
  18. }
  19. rpc LookupVolume (LookupVolumeRequest) returns (LookupVolumeResponse) {
  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. int64 crtime = 6;
  55. string mime = 7;
  56. }
  57. message GetEntryAttributesRequest {
  58. string name = 1;
  59. string parent_dir = 2;
  60. string file_id = 3;
  61. }
  62. message GetEntryAttributesResponse {
  63. FuseAttributes attributes = 1;
  64. repeated FileChunk chunks = 2;
  65. }
  66. message GetFileContentRequest {
  67. string file_id = 1;
  68. }
  69. message GetFileContentResponse {
  70. bytes content = 1;
  71. }
  72. message CreateEntryRequest {
  73. string directory = 1;
  74. Entry entry = 2;
  75. }
  76. message CreateEntryResponse {
  77. }
  78. message UpdateEntryRequest {
  79. string directory = 1;
  80. Entry entry = 2;
  81. }
  82. message UpdateEntryResponse {
  83. }
  84. message DeleteEntryRequest {
  85. string directory = 1;
  86. string name = 2;
  87. bool is_directory = 3;
  88. }
  89. message DeleteEntryResponse {
  90. }
  91. message AssignVolumeRequest {
  92. int32 count = 1;
  93. string collection = 2;
  94. string replication = 3;
  95. }
  96. message AssignVolumeResponse {
  97. string file_id = 1;
  98. string url = 2;
  99. string public_url = 3;
  100. int32 count = 4;
  101. }
  102. message LookupVolumeRequest {
  103. repeated string volume_ids = 1;
  104. }
  105. message Locations {
  106. repeated Location locations = 1;
  107. }
  108. message Location {
  109. string url = 1;
  110. string public_url = 2;
  111. }
  112. message LookupVolumeResponse {
  113. map<string, Locations> locations_map = 1;
  114. }