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.

252 lines
5.2 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. rpc ListenForEvents (ListenForEventsRequest) returns (stream FullEventNotification) {
  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. bytes md5 = 14;
  99. }
  100. message CreateEntryRequest {
  101. string directory = 1;
  102. Entry entry = 2;
  103. bool o_excl = 3;
  104. }
  105. message CreateEntryResponse {
  106. string error = 1;
  107. }
  108. message UpdateEntryRequest {
  109. string directory = 1;
  110. Entry entry = 2;
  111. }
  112. message UpdateEntryResponse {
  113. }
  114. message DeleteEntryRequest {
  115. string directory = 1;
  116. string name = 2;
  117. // bool is_directory = 3;
  118. bool is_delete_data = 4;
  119. bool is_recursive = 5;
  120. bool ignore_recursive_error = 6;
  121. }
  122. message DeleteEntryResponse {
  123. string error = 1;
  124. }
  125. message AtomicRenameEntryRequest {
  126. string old_directory = 1;
  127. string old_name = 2;
  128. string new_directory = 3;
  129. string new_name = 4;
  130. }
  131. message AtomicRenameEntryResponse {
  132. }
  133. message AssignVolumeRequest {
  134. int32 count = 1;
  135. string collection = 2;
  136. string replication = 3;
  137. int32 ttl_sec = 4;
  138. string data_center = 5;
  139. string parent_path = 6;
  140. }
  141. message AssignVolumeResponse {
  142. string file_id = 1;
  143. string url = 2;
  144. string public_url = 3;
  145. int32 count = 4;
  146. string auth = 5;
  147. string collection = 6;
  148. string replication = 7;
  149. string error = 8;
  150. }
  151. message LookupVolumeRequest {
  152. repeated string volume_ids = 1;
  153. }
  154. message Locations {
  155. repeated Location locations = 1;
  156. }
  157. message Location {
  158. string url = 1;
  159. string public_url = 2;
  160. }
  161. message LookupVolumeResponse {
  162. map<string, Locations> locations_map = 1;
  163. }
  164. message DeleteCollectionRequest {
  165. string collection = 1;
  166. }
  167. message DeleteCollectionResponse {
  168. }
  169. message StatisticsRequest {
  170. string replication = 1;
  171. string collection = 2;
  172. string ttl = 3;
  173. }
  174. message StatisticsResponse {
  175. string replication = 1;
  176. string collection = 2;
  177. string ttl = 3;
  178. uint64 total_size = 4;
  179. uint64 used_size = 5;
  180. uint64 file_count = 6;
  181. }
  182. message GetFilerConfigurationRequest {
  183. }
  184. message GetFilerConfigurationResponse {
  185. repeated string masters = 1;
  186. string replication = 2;
  187. string collection = 3;
  188. uint32 max_mb = 4;
  189. string dir_buckets = 5;
  190. string dir_queues = 6;
  191. bool cipher = 7;
  192. }
  193. message ListenForEventsRequest {
  194. string client_name = 1;
  195. string path_prefix = 2;
  196. int64 since_ns = 3;
  197. }
  198. message FullEventNotification {
  199. string directory = 1;
  200. EventNotification event_notification = 2;
  201. }
  202. message LogEntry {
  203. int64 ts_ns = 1;
  204. int32 partition_key_hash = 2;
  205. bytes data = 3;
  206. }