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.

219 lines
4.4 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. }
  114. message DeleteEntryResponse {
  115. }
  116. message AtomicRenameEntryRequest {
  117. string old_directory = 1;
  118. string old_name = 2;
  119. string new_directory = 3;
  120. string new_name = 4;
  121. }
  122. message AtomicRenameEntryResponse {
  123. }
  124. message AssignVolumeRequest {
  125. int32 count = 1;
  126. string collection = 2;
  127. string replication = 3;
  128. int32 ttl_sec = 4;
  129. string data_center = 5;
  130. }
  131. message AssignVolumeResponse {
  132. string file_id = 1;
  133. string url = 2;
  134. string public_url = 3;
  135. int32 count = 4;
  136. string auth = 5;
  137. }
  138. message LookupVolumeRequest {
  139. repeated string volume_ids = 1;
  140. }
  141. message Locations {
  142. repeated Location locations = 1;
  143. }
  144. message Location {
  145. string url = 1;
  146. string public_url = 2;
  147. }
  148. message LookupVolumeResponse {
  149. map<string, Locations> locations_map = 1;
  150. }
  151. message DeleteCollectionRequest {
  152. string collection = 1;
  153. }
  154. message DeleteCollectionResponse {
  155. }
  156. message StatisticsRequest {
  157. string replication = 1;
  158. string collection = 2;
  159. string ttl = 3;
  160. }
  161. message StatisticsResponse {
  162. string replication = 1;
  163. string collection = 2;
  164. string ttl = 3;
  165. uint64 total_size = 4;
  166. uint64 used_size = 5;
  167. uint64 file_count = 6;
  168. }
  169. message GetFilerConfigurationRequest {
  170. }
  171. message GetFilerConfigurationResponse {
  172. repeated string masters = 1;
  173. string replication = 2;
  174. string collection = 3;
  175. uint32 max_mb = 4;
  176. }