filer.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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 (stream 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. Entry entry = 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. bool o_excl = 3;
  99. }
  100. message CreateEntryResponse {
  101. string error = 1;
  102. }
  103. message UpdateEntryRequest {
  104. string directory = 1;
  105. Entry entry = 2;
  106. }
  107. message UpdateEntryResponse {
  108. }
  109. message DeleteEntryRequest {
  110. string directory = 1;
  111. string name = 2;
  112. // bool is_directory = 3;
  113. bool is_delete_data = 4;
  114. bool is_recursive = 5;
  115. bool ignore_recursive_error = 6;
  116. }
  117. message DeleteEntryResponse {
  118. }
  119. message AtomicRenameEntryRequest {
  120. string old_directory = 1;
  121. string old_name = 2;
  122. string new_directory = 3;
  123. string new_name = 4;
  124. }
  125. message AtomicRenameEntryResponse {
  126. }
  127. message AssignVolumeRequest {
  128. int32 count = 1;
  129. string collection = 2;
  130. string replication = 3;
  131. int32 ttl_sec = 4;
  132. string data_center = 5;
  133. }
  134. message AssignVolumeResponse {
  135. string file_id = 1;
  136. string url = 2;
  137. string public_url = 3;
  138. int32 count = 4;
  139. string auth = 5;
  140. }
  141. message LookupVolumeRequest {
  142. repeated string volume_ids = 1;
  143. }
  144. message Locations {
  145. repeated Location locations = 1;
  146. }
  147. message Location {
  148. string url = 1;
  149. string public_url = 2;
  150. }
  151. message LookupVolumeResponse {
  152. map<string, Locations> locations_map = 1;
  153. }
  154. message DeleteCollectionRequest {
  155. string collection = 1;
  156. }
  157. message DeleteCollectionResponse {
  158. }
  159. message StatisticsRequest {
  160. string replication = 1;
  161. string collection = 2;
  162. string ttl = 3;
  163. }
  164. message StatisticsResponse {
  165. string replication = 1;
  166. string collection = 2;
  167. string ttl = 3;
  168. uint64 total_size = 4;
  169. uint64 used_size = 5;
  170. uint64 file_count = 6;
  171. }
  172. message GetFilerConfigurationRequest {
  173. }
  174. message GetFilerConfigurationResponse {
  175. repeated string masters = 1;
  176. string replication = 2;
  177. string collection = 3;
  178. uint32 max_mb = 4;
  179. }