filer.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. syntax = "proto3";
  2. package filer_pb;
  3. option java_package = "seaweedfs.client";
  4. option java_outer_classname = "FilerProto";
  5. //////////////////////////////////////////////////
  6. service SeaweedFiler {
  7. rpc LookupDirectoryEntry (LookupDirectoryEntryRequest) returns (LookupDirectoryEntryResponse) {
  8. }
  9. rpc ListEntries (ListEntriesRequest) returns (ListEntriesResponse) {
  10. }
  11. rpc CreateEntry (CreateEntryRequest) returns (CreateEntryResponse) {
  12. }
  13. rpc UpdateEntry (UpdateEntryRequest) returns (UpdateEntryResponse) {
  14. }
  15. rpc DeleteEntry (DeleteEntryRequest) returns (DeleteEntryResponse) {
  16. }
  17. rpc AtomicRenameEntry (AtomicRenameEntryRequest) returns (AtomicRenameEntryResponse) {
  18. }
  19. rpc AssignVolume (AssignVolumeRequest) returns (AssignVolumeResponse) {
  20. }
  21. rpc LookupVolume (LookupVolumeRequest) returns (LookupVolumeResponse) {
  22. }
  23. rpc DeleteCollection (DeleteCollectionRequest) returns (DeleteCollectionResponse) {
  24. }
  25. rpc Statistics (StatisticsRequest) returns (StatisticsResponse) {
  26. }
  27. rpc GetFilerConfiguration (GetFilerConfigurationRequest) returns (GetFilerConfigurationResponse) {
  28. }
  29. }
  30. //////////////////////////////////////////////////
  31. message LookupDirectoryEntryRequest {
  32. string directory = 1;
  33. string name = 2;
  34. }
  35. message LookupDirectoryEntryResponse {
  36. Entry entry = 1;
  37. }
  38. message ListEntriesRequest {
  39. string directory = 1;
  40. string prefix = 2;
  41. string startFromFileName = 3;
  42. bool inclusiveStartFrom = 4;
  43. uint32 limit = 5;
  44. }
  45. message ListEntriesResponse {
  46. repeated Entry entries = 1;
  47. }
  48. message Entry {
  49. string name = 1;
  50. bool is_directory = 2;
  51. repeated FileChunk chunks = 3;
  52. FuseAttributes attributes = 4;
  53. map<string, bytes> extended = 5;
  54. }
  55. message FullEntry {
  56. string dir = 1;
  57. Entry entry = 2;
  58. }
  59. message EventNotification {
  60. Entry old_entry = 1;
  61. Entry new_entry = 2;
  62. bool delete_chunks = 3;
  63. string new_parent_path = 4;
  64. }
  65. message FileChunk {
  66. string file_id = 1; // to be deprecated
  67. int64 offset = 2;
  68. uint64 size = 3;
  69. int64 mtime = 4;
  70. string e_tag = 5;
  71. string source_file_id = 6; // to be deprecated
  72. FileId fid = 7;
  73. FileId source_fid = 8;
  74. }
  75. message FileId {
  76. uint32 volume_id = 1;
  77. uint64 file_key = 2;
  78. fixed32 cookie = 3;
  79. }
  80. message FuseAttributes {
  81. uint64 file_size = 1;
  82. int64 mtime = 2; // unix time in seconds
  83. uint32 file_mode = 3;
  84. uint32 uid = 4;
  85. uint32 gid = 5;
  86. int64 crtime = 6; // unix time in seconds
  87. string mime = 7;
  88. string replication = 8;
  89. string collection = 9;
  90. int32 ttl_sec = 10;
  91. string user_name = 11; // for hdfs
  92. repeated string group_name = 12; // for hdfs
  93. string symlink_target = 13;
  94. }
  95. message CreateEntryRequest {
  96. string directory = 1;
  97. Entry entry = 2;
  98. }
  99. message CreateEntryResponse {
  100. }
  101. message UpdateEntryRequest {
  102. string directory = 1;
  103. Entry entry = 2;
  104. }
  105. message UpdateEntryResponse {
  106. }
  107. message DeleteEntryRequest {
  108. string directory = 1;
  109. string name = 2;
  110. // bool is_directory = 3;
  111. bool is_delete_data = 4;
  112. bool is_recursive = 5;
  113. bool ignore_recursive_error = 6;
  114. }
  115. message DeleteEntryResponse {
  116. }
  117. message AtomicRenameEntryRequest {
  118. string old_directory = 1;
  119. string old_name = 2;
  120. string new_directory = 3;
  121. string new_name = 4;
  122. }
  123. message AtomicRenameEntryResponse {
  124. }
  125. message AssignVolumeRequest {
  126. int32 count = 1;
  127. string collection = 2;
  128. string replication = 3;
  129. int32 ttl_sec = 4;
  130. string data_center = 5;
  131. }
  132. message AssignVolumeResponse {
  133. string file_id = 1;
  134. string url = 2;
  135. string public_url = 3;
  136. int32 count = 4;
  137. string auth = 5;
  138. }
  139. message LookupVolumeRequest {
  140. repeated string volume_ids = 1;
  141. }
  142. message Locations {
  143. repeated Location locations = 1;
  144. }
  145. message Location {
  146. string url = 1;
  147. string public_url = 2;
  148. }
  149. message LookupVolumeResponse {
  150. map<string, Locations> locations_map = 1;
  151. }
  152. message DeleteCollectionRequest {
  153. string collection = 1;
  154. }
  155. message DeleteCollectionResponse {
  156. }
  157. message StatisticsRequest {
  158. string replication = 1;
  159. string collection = 2;
  160. string ttl = 3;
  161. }
  162. message StatisticsResponse {
  163. string replication = 1;
  164. string collection = 2;
  165. string ttl = 3;
  166. uint64 total_size = 4;
  167. uint64 used_size = 5;
  168. uint64 file_count = 6;
  169. }
  170. message GetFilerConfigurationRequest {
  171. }
  172. message GetFilerConfigurationResponse {
  173. repeated string masters = 1;
  174. string replication = 2;
  175. string collection = 3;
  176. uint32 max_mb = 4;
  177. }