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.

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