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.

263 lines
5.4 KiB

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