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.

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