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.

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