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.

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