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.

179 lines
3.6 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 AssignVolume (AssignVolumeRequest) returns (AssignVolumeResponse) {
  18. }
  19. rpc LookupVolume (LookupVolumeRequest) returns (LookupVolumeResponse) {
  20. }
  21. rpc DeleteCollection (DeleteCollectionRequest) returns (DeleteCollectionResponse) {
  22. }
  23. rpc Statistics (StatisticsRequest) returns (StatisticsResponse) {
  24. }
  25. }
  26. //////////////////////////////////////////////////
  27. message LookupDirectoryEntryRequest {
  28. string directory = 1;
  29. string name = 2;
  30. }
  31. message LookupDirectoryEntryResponse {
  32. Entry entry = 1;
  33. }
  34. message ListEntriesRequest {
  35. string directory = 1;
  36. string prefix = 2;
  37. string startFromFileName = 3;
  38. bool inclusiveStartFrom = 4;
  39. uint32 limit = 5;
  40. }
  41. message ListEntriesResponse {
  42. repeated Entry entries = 1;
  43. }
  44. message Entry {
  45. string name = 1;
  46. bool is_directory = 2;
  47. repeated FileChunk chunks = 3;
  48. FuseAttributes attributes = 4;
  49. map<string, bytes> extended = 5;
  50. }
  51. message EventNotification {
  52. Entry old_entry = 1;
  53. Entry new_entry = 2;
  54. bool delete_chunks = 3;
  55. }
  56. message FileChunk {
  57. string file_id = 1;
  58. int64 offset = 2;
  59. uint64 size = 3;
  60. int64 mtime = 4;
  61. string e_tag = 5;
  62. string source_file_id = 6;
  63. }
  64. message FuseAttributes {
  65. uint64 file_size = 1;
  66. int64 mtime = 2; // unix time in seconds
  67. uint32 file_mode = 3;
  68. uint32 uid = 4;
  69. uint32 gid = 5;
  70. int64 crtime = 6; // unix time in seconds
  71. string mime = 7;
  72. string replication = 8;
  73. string collection = 9;
  74. int32 ttl_sec = 10;
  75. string user_name = 11; // for hdfs
  76. repeated string group_name = 12; // for hdfs
  77. string symlink_target = 13;
  78. }
  79. message CreateEntryRequest {
  80. string directory = 1;
  81. Entry entry = 2;
  82. }
  83. message CreateEntryResponse {
  84. }
  85. message UpdateEntryRequest {
  86. string directory = 1;
  87. Entry entry = 2;
  88. }
  89. message UpdateEntryResponse {
  90. }
  91. message DeleteEntryRequest {
  92. string directory = 1;
  93. string name = 2;
  94. // bool is_directory = 3;
  95. bool is_delete_data = 4;
  96. bool is_recursive = 5;
  97. }
  98. message DeleteEntryResponse {
  99. }
  100. message AssignVolumeRequest {
  101. int32 count = 1;
  102. string collection = 2;
  103. string replication = 3;
  104. int32 ttl_sec = 4;
  105. string data_center = 5;
  106. }
  107. message AssignVolumeResponse {
  108. string file_id = 1;
  109. string url = 2;
  110. string public_url = 3;
  111. int32 count = 4;
  112. }
  113. message LookupVolumeRequest {
  114. repeated string volume_ids = 1;
  115. }
  116. message Locations {
  117. repeated Location locations = 1;
  118. }
  119. message Location {
  120. string url = 1;
  121. string public_url = 2;
  122. }
  123. message LookupVolumeResponse {
  124. map<string, Locations> locations_map = 1;
  125. }
  126. message DeleteCollectionRequest {
  127. string collection = 1;
  128. }
  129. message DeleteCollectionResponse {
  130. }
  131. message StatisticsRequest {
  132. string replication = 1;
  133. string collection = 2;
  134. string ttl = 3;
  135. }
  136. message StatisticsResponse {
  137. string replication = 1;
  138. string collection = 2;
  139. string ttl = 3;
  140. uint64 total_size = 4;
  141. uint64 used_size = 5;
  142. uint64 file_count = 6;
  143. }