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.4 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 GetEntryAttributes (GetEntryAttributesRequest) returns (GetEntryAttributesResponse) {
  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. }
  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 GetEntryAttributesRequest {
  75. string name = 1;
  76. string parent_dir = 2;
  77. string file_id = 3;
  78. }
  79. message GetEntryAttributesResponse {
  80. FuseAttributes attributes = 1;
  81. repeated FileChunk chunks = 2;
  82. map<string, bytes> extended = 3;
  83. }
  84. message GetFileContentRequest {
  85. string file_id = 1;
  86. }
  87. message GetFileContentResponse {
  88. bytes content = 1;
  89. }
  90. message CreateEntryRequest {
  91. string directory = 1;
  92. Entry entry = 2;
  93. }
  94. message CreateEntryResponse {
  95. }
  96. message UpdateEntryRequest {
  97. string directory = 1;
  98. Entry entry = 2;
  99. }
  100. message UpdateEntryResponse {
  101. }
  102. message DeleteEntryRequest {
  103. string directory = 1;
  104. string name = 2;
  105. bool is_directory = 3;
  106. bool is_delete_data = 4;
  107. bool is_recursive = 5;
  108. }
  109. message DeleteEntryResponse {
  110. }
  111. message AssignVolumeRequest {
  112. int32 count = 1;
  113. string collection = 2;
  114. string replication = 3;
  115. int32 ttl_sec = 4;
  116. string data_center = 5;
  117. }
  118. message AssignVolumeResponse {
  119. string file_id = 1;
  120. string url = 2;
  121. string public_url = 3;
  122. int32 count = 4;
  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. }