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.

176 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 = 2;
  51. Entry new_entry = 3;
  52. }
  53. message FileChunk {
  54. string file_id = 1;
  55. int64 offset = 2;
  56. uint64 size = 3;
  57. int64 mtime = 4;
  58. }
  59. message FuseAttributes {
  60. uint64 file_size = 1;
  61. int64 mtime = 2;
  62. uint32 file_mode = 3;
  63. uint32 uid = 4;
  64. uint32 gid = 5;
  65. int64 crtime = 6;
  66. string mime = 7;
  67. string replication = 8;
  68. string collection = 9;
  69. int32 ttl_sec = 10;
  70. }
  71. message GetEntryAttributesRequest {
  72. string name = 1;
  73. string parent_dir = 2;
  74. string file_id = 3;
  75. }
  76. message GetEntryAttributesResponse {
  77. FuseAttributes attributes = 1;
  78. repeated FileChunk chunks = 2;
  79. map<string, bytes> extended = 3;
  80. }
  81. message GetFileContentRequest {
  82. string file_id = 1;
  83. }
  84. message GetFileContentResponse {
  85. bytes content = 1;
  86. }
  87. message CreateEntryRequest {
  88. string directory = 1;
  89. Entry entry = 2;
  90. }
  91. message CreateEntryResponse {
  92. }
  93. message UpdateEntryRequest {
  94. string directory = 1;
  95. Entry entry = 2;
  96. }
  97. message UpdateEntryResponse {
  98. }
  99. message DeleteEntryRequest {
  100. string directory = 1;
  101. string name = 2;
  102. bool is_directory = 3;
  103. bool is_delete_data = 4;
  104. bool is_recursive = 5;
  105. }
  106. message DeleteEntryResponse {
  107. }
  108. message AssignVolumeRequest {
  109. int32 count = 1;
  110. string collection = 2;
  111. string replication = 3;
  112. int32 ttl_sec = 4;
  113. string data_center = 5;
  114. }
  115. message AssignVolumeResponse {
  116. string file_id = 1;
  117. string url = 2;
  118. string public_url = 3;
  119. int32 count = 4;
  120. }
  121. message LookupVolumeRequest {
  122. repeated string volume_ids = 1;
  123. }
  124. message Locations {
  125. repeated Location locations = 1;
  126. }
  127. message Location {
  128. string url = 1;
  129. string public_url = 2;
  130. }
  131. message LookupVolumeResponse {
  132. map<string, Locations> locations_map = 1;
  133. }
  134. message DeleteCollectionRequest {
  135. string collection = 1;
  136. }
  137. message DeleteCollectionResponse {
  138. }