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.

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