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.

173 lines
3.3 KiB

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