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.

234 lines
4.8 KiB

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