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.

178 lines
3.5 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. }
  78. message CreateEntryRequest {
  79. string directory = 1;
  80. Entry entry = 2;
  81. }
  82. message CreateEntryResponse {
  83. }
  84. message UpdateEntryRequest {
  85. string directory = 1;
  86. Entry entry = 2;
  87. }
  88. message UpdateEntryResponse {
  89. }
  90. message DeleteEntryRequest {
  91. string directory = 1;
  92. string name = 2;
  93. bool is_directory = 3;
  94. bool is_delete_data = 4;
  95. bool is_recursive = 5;
  96. }
  97. message DeleteEntryResponse {
  98. }
  99. message AssignVolumeRequest {
  100. int32 count = 1;
  101. string collection = 2;
  102. string replication = 3;
  103. int32 ttl_sec = 4;
  104. string data_center = 5;
  105. }
  106. message AssignVolumeResponse {
  107. string file_id = 1;
  108. string url = 2;
  109. string public_url = 3;
  110. int32 count = 4;
  111. }
  112. message LookupVolumeRequest {
  113. repeated string volume_ids = 1;
  114. }
  115. message Locations {
  116. repeated Location locations = 1;
  117. }
  118. message Location {
  119. string url = 1;
  120. string public_url = 2;
  121. }
  122. message LookupVolumeResponse {
  123. map<string, Locations> locations_map = 1;
  124. }
  125. message DeleteCollectionRequest {
  126. string collection = 1;
  127. }
  128. message DeleteCollectionResponse {
  129. }
  130. message StatisticsRequest {
  131. string replication = 1;
  132. string collection = 2;
  133. string ttl = 3;
  134. }
  135. message StatisticsResponse {
  136. string replication = 1;
  137. string collection = 2;
  138. string ttl = 3;
  139. uint64 total_size = 4;
  140. uint64 used_size = 5;
  141. uint64 file_count = 6;
  142. }