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.

175 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. map<string, string> 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. }
  80. message GetFileContentRequest {
  81. string file_id = 1;
  82. }
  83. message GetFileContentResponse {
  84. bytes content = 1;
  85. }
  86. message CreateEntryRequest {
  87. string directory = 1;
  88. Entry entry = 2;
  89. }
  90. message CreateEntryResponse {
  91. }
  92. message UpdateEntryRequest {
  93. string directory = 1;
  94. Entry entry = 2;
  95. }
  96. message UpdateEntryResponse {
  97. }
  98. message DeleteEntryRequest {
  99. string directory = 1;
  100. string name = 2;
  101. bool is_directory = 3;
  102. bool is_delete_data = 4;
  103. bool is_recursive = 5;
  104. }
  105. message DeleteEntryResponse {
  106. }
  107. message AssignVolumeRequest {
  108. int32 count = 1;
  109. string collection = 2;
  110. string replication = 3;
  111. int32 ttl_sec = 4;
  112. string data_center = 5;
  113. }
  114. message AssignVolumeResponse {
  115. string file_id = 1;
  116. string url = 2;
  117. string public_url = 3;
  118. int32 count = 4;
  119. }
  120. message LookupVolumeRequest {
  121. repeated string volume_ids = 1;
  122. }
  123. message Locations {
  124. repeated Location locations = 1;
  125. }
  126. message Location {
  127. string url = 1;
  128. string public_url = 2;
  129. }
  130. message LookupVolumeResponse {
  131. map<string, Locations> locations_map = 1;
  132. }
  133. message DeleteCollectionRequest {
  134. string collection = 1;
  135. }
  136. message DeleteCollectionResponse {
  137. }