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.

199 lines
4.0 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;
  65. int64 offset = 2;
  66. uint64 size = 3;
  67. int64 mtime = 4;
  68. string e_tag = 5;
  69. string source_file_id = 6;
  70. }
  71. message FuseAttributes {
  72. uint64 file_size = 1;
  73. int64 mtime = 2; // unix time in seconds
  74. uint32 file_mode = 3;
  75. uint32 uid = 4;
  76. uint32 gid = 5;
  77. int64 crtime = 6; // unix time in seconds
  78. string mime = 7;
  79. string replication = 8;
  80. string collection = 9;
  81. int32 ttl_sec = 10;
  82. string user_name = 11; // for hdfs
  83. repeated string group_name = 12; // for hdfs
  84. string symlink_target = 13;
  85. }
  86. message CreateEntryRequest {
  87. string directory = 1;
  88. Entry entry = 2;
  89. }
  90. message CreateEntryResponse {
  91. }
  92. message UpdateEntryRequest {
  93. string directory = 1;
  94. Entry entry = 2;
  95. }
  96. message UpdateEntryResponse {
  97. }
  98. message DeleteEntryRequest {
  99. string directory = 1;
  100. string name = 2;
  101. // bool is_directory = 3;
  102. bool is_delete_data = 4;
  103. bool is_recursive = 5;
  104. }
  105. message DeleteEntryResponse {
  106. }
  107. message AtomicRenameEntryRequest {
  108. string old_directory = 1;
  109. string old_name = 2;
  110. string new_directory = 3;
  111. string new_name = 4;
  112. }
  113. message AtomicRenameEntryResponse {
  114. }
  115. message AssignVolumeRequest {
  116. int32 count = 1;
  117. string collection = 2;
  118. string replication = 3;
  119. int32 ttl_sec = 4;
  120. string data_center = 5;
  121. }
  122. message AssignVolumeResponse {
  123. string file_id = 1;
  124. string url = 2;
  125. string public_url = 3;
  126. int32 count = 4;
  127. string auth = 5;
  128. }
  129. message LookupVolumeRequest {
  130. repeated string volume_ids = 1;
  131. }
  132. message Locations {
  133. repeated Location locations = 1;
  134. }
  135. message Location {
  136. string url = 1;
  137. string public_url = 2;
  138. }
  139. message LookupVolumeResponse {
  140. map<string, Locations> locations_map = 1;
  141. }
  142. message DeleteCollectionRequest {
  143. string collection = 1;
  144. }
  145. message DeleteCollectionResponse {
  146. }
  147. message StatisticsRequest {
  148. string replication = 1;
  149. string collection = 2;
  150. string ttl = 3;
  151. }
  152. message StatisticsResponse {
  153. string replication = 1;
  154. string collection = 2;
  155. string ttl = 3;
  156. uint64 total_size = 4;
  157. uint64 used_size = 5;
  158. uint64 file_count = 6;
  159. }