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.

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