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.

207 lines
4.1 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. }
  28. //////////////////////////////////////////////////
  29. message LookupDirectoryEntryRequest {
  30. string directory = 1;
  31. string name = 2;
  32. }
  33. message LookupDirectoryEntryResponse {
  34. Entry entry = 1;
  35. }
  36. message ListEntriesRequest {
  37. string directory = 1;
  38. string prefix = 2;
  39. string startFromFileName = 3;
  40. bool inclusiveStartFrom = 4;
  41. uint32 limit = 5;
  42. }
  43. message ListEntriesResponse {
  44. repeated Entry entries = 1;
  45. }
  46. message Entry {
  47. string name = 1;
  48. bool is_directory = 2;
  49. repeated FileChunk chunks = 3;
  50. FuseAttributes attributes = 4;
  51. map<string, bytes> extended = 5;
  52. }
  53. message FullEntry {
  54. string dir = 1;
  55. Entry entry = 2;
  56. }
  57. message EventNotification {
  58. Entry old_entry = 1;
  59. Entry new_entry = 2;
  60. bool delete_chunks = 3;
  61. string new_parent_path = 4;
  62. }
  63. message FileChunk {
  64. string file_id = 1; // to be deprecated
  65. int64 offset = 2;
  66. uint64 size = 3;
  67. int64 mtime = 4;
  68. string e_tag = 5;
  69. string source_file_id = 6; // to be deprecated
  70. FileId fid = 7;
  71. FileId source_fid = 8;
  72. }
  73. message FileId {
  74. uint32 volume_id = 1;
  75. uint64 file_key = 2;
  76. fixed32 cookie = 3;
  77. }
  78. message FuseAttributes {
  79. uint64 file_size = 1;
  80. int64 mtime = 2; // unix time in seconds
  81. uint32 file_mode = 3;
  82. uint32 uid = 4;
  83. uint32 gid = 5;
  84. int64 crtime = 6; // unix time in seconds
  85. string mime = 7;
  86. string replication = 8;
  87. string collection = 9;
  88. int32 ttl_sec = 10;
  89. string user_name = 11; // for hdfs
  90. repeated string group_name = 12; // for hdfs
  91. string symlink_target = 13;
  92. }
  93. message CreateEntryRequest {
  94. string directory = 1;
  95. Entry entry = 2;
  96. }
  97. message CreateEntryResponse {
  98. }
  99. message UpdateEntryRequest {
  100. string directory = 1;
  101. Entry entry = 2;
  102. }
  103. message UpdateEntryResponse {
  104. }
  105. message DeleteEntryRequest {
  106. string directory = 1;
  107. string name = 2;
  108. // bool is_directory = 3;
  109. bool is_delete_data = 4;
  110. bool is_recursive = 5;
  111. }
  112. message DeleteEntryResponse {
  113. }
  114. message AtomicRenameEntryRequest {
  115. string old_directory = 1;
  116. string old_name = 2;
  117. string new_directory = 3;
  118. string new_name = 4;
  119. }
  120. message AtomicRenameEntryResponse {
  121. }
  122. message AssignVolumeRequest {
  123. int32 count = 1;
  124. string collection = 2;
  125. string replication = 3;
  126. int32 ttl_sec = 4;
  127. string data_center = 5;
  128. }
  129. message AssignVolumeResponse {
  130. string file_id = 1;
  131. string url = 2;
  132. string public_url = 3;
  133. int32 count = 4;
  134. string auth = 5;
  135. }
  136. message LookupVolumeRequest {
  137. repeated string volume_ids = 1;
  138. }
  139. message Locations {
  140. repeated Location locations = 1;
  141. }
  142. message Location {
  143. string url = 1;
  144. string public_url = 2;
  145. }
  146. message LookupVolumeResponse {
  147. map<string, Locations> locations_map = 1;
  148. }
  149. message DeleteCollectionRequest {
  150. string collection = 1;
  151. }
  152. message DeleteCollectionResponse {
  153. }
  154. message StatisticsRequest {
  155. string replication = 1;
  156. string collection = 2;
  157. string ttl = 3;
  158. }
  159. message StatisticsResponse {
  160. string replication = 1;
  161. string collection = 2;
  162. string ttl = 3;
  163. uint64 total_size = 4;
  164. uint64 used_size = 5;
  165. uint64 file_count = 6;
  166. }