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.

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