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.

235 lines
4.9 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. bool is_gzipped = 10;
  78. }
  79. message FileId {
  80. uint32 volume_id = 1;
  81. uint64 file_key = 2;
  82. fixed32 cookie = 3;
  83. }
  84. message FuseAttributes {
  85. uint64 file_size = 1;
  86. int64 mtime = 2; // unix time in seconds
  87. uint32 file_mode = 3;
  88. uint32 uid = 4;
  89. uint32 gid = 5;
  90. int64 crtime = 6; // unix time in seconds
  91. string mime = 7;
  92. string replication = 8;
  93. string collection = 9;
  94. int32 ttl_sec = 10;
  95. string user_name = 11; // for hdfs
  96. repeated string group_name = 12; // for hdfs
  97. string symlink_target = 13;
  98. }
  99. message CreateEntryRequest {
  100. string directory = 1;
  101. Entry entry = 2;
  102. bool o_excl = 3;
  103. }
  104. message CreateEntryResponse {
  105. string error = 1;
  106. }
  107. message UpdateEntryRequest {
  108. string directory = 1;
  109. Entry entry = 2;
  110. }
  111. message UpdateEntryResponse {
  112. }
  113. message DeleteEntryRequest {
  114. string directory = 1;
  115. string name = 2;
  116. // bool is_directory = 3;
  117. bool is_delete_data = 4;
  118. bool is_recursive = 5;
  119. bool ignore_recursive_error = 6;
  120. }
  121. message DeleteEntryResponse {
  122. string error = 1;
  123. }
  124. message AtomicRenameEntryRequest {
  125. string old_directory = 1;
  126. string old_name = 2;
  127. string new_directory = 3;
  128. string new_name = 4;
  129. }
  130. message AtomicRenameEntryResponse {
  131. }
  132. message AssignVolumeRequest {
  133. int32 count = 1;
  134. string collection = 2;
  135. string replication = 3;
  136. int32 ttl_sec = 4;
  137. string data_center = 5;
  138. string parent_path = 6;
  139. }
  140. message AssignVolumeResponse {
  141. string file_id = 1;
  142. string url = 2;
  143. string public_url = 3;
  144. int32 count = 4;
  145. string auth = 5;
  146. string collection = 6;
  147. string replication = 7;
  148. string error = 8;
  149. }
  150. message LookupVolumeRequest {
  151. repeated string volume_ids = 1;
  152. }
  153. message Locations {
  154. repeated Location locations = 1;
  155. }
  156. message Location {
  157. string url = 1;
  158. string public_url = 2;
  159. }
  160. message LookupVolumeResponse {
  161. map<string, Locations> locations_map = 1;
  162. }
  163. message DeleteCollectionRequest {
  164. string collection = 1;
  165. }
  166. message DeleteCollectionResponse {
  167. }
  168. message StatisticsRequest {
  169. string replication = 1;
  170. string collection = 2;
  171. string ttl = 3;
  172. }
  173. message StatisticsResponse {
  174. string replication = 1;
  175. string collection = 2;
  176. string ttl = 3;
  177. uint64 total_size = 4;
  178. uint64 used_size = 5;
  179. uint64 file_count = 6;
  180. }
  181. message GetFilerConfigurationRequest {
  182. }
  183. message GetFilerConfigurationResponse {
  184. repeated string masters = 1;
  185. string replication = 2;
  186. string collection = 3;
  187. uint32 max_mb = 4;
  188. string dir_buckets = 5;
  189. string dir_queues = 6;
  190. bool cipher = 7;
  191. }