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.

156 lines
3.0 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 CreateEntry (CreateEntryRequest) returns (CreateEntryResponse) {
  10. }
  11. rpc UpdateEntry (UpdateEntryRequest) returns (UpdateEntryResponse) {
  12. }
  13. rpc DeleteEntry (DeleteEntryRequest) returns (DeleteEntryResponse) {
  14. }
  15. rpc AssignVolume (AssignVolumeRequest) returns (AssignVolumeResponse) {
  16. }
  17. rpc LookupVolume (LookupVolumeRequest) returns (LookupVolumeResponse) {
  18. }
  19. rpc DeleteCollection (DeleteCollectionRequest) returns (DeleteCollectionResponse) {
  20. }
  21. }
  22. //////////////////////////////////////////////////
  23. message LookupDirectoryEntryRequest {
  24. string directory = 1;
  25. string name = 2;
  26. }
  27. message LookupDirectoryEntryResponse {
  28. Entry entry = 1;
  29. }
  30. message ListEntriesRequest {
  31. string directory = 1;
  32. string prefix = 2;
  33. string startFromFileName = 3;
  34. bool inclusiveStartFrom = 4;
  35. uint32 limit = 5;
  36. }
  37. message ListEntriesResponse {
  38. repeated Entry entries = 1;
  39. }
  40. message Entry {
  41. string name = 1;
  42. bool is_directory = 2;
  43. repeated FileChunk chunks = 3;
  44. FuseAttributes attributes = 4;
  45. map<string, bytes> extended = 5;
  46. }
  47. message EventNotification {
  48. Entry old_entry = 1;
  49. Entry new_entry = 2;
  50. bool delete_chunks = 3;
  51. }
  52. message FileChunk {
  53. string file_id = 1;
  54. int64 offset = 2;
  55. uint64 size = 3;
  56. int64 mtime = 4;
  57. string e_tag = 5;
  58. string source_file_id = 6;
  59. }
  60. message FuseAttributes {
  61. uint64 file_size = 1;
  62. int64 mtime = 2;
  63. uint32 file_mode = 3;
  64. uint32 uid = 4;
  65. uint32 gid = 5;
  66. int64 crtime = 6;
  67. string mime = 7;
  68. string replication = 8;
  69. string collection = 9;
  70. int32 ttl_sec = 10;
  71. }
  72. message CreateEntryRequest {
  73. string directory = 1;
  74. Entry entry = 2;
  75. }
  76. message CreateEntryResponse {
  77. }
  78. message UpdateEntryRequest {
  79. string directory = 1;
  80. Entry entry = 2;
  81. }
  82. message UpdateEntryResponse {
  83. }
  84. message DeleteEntryRequest {
  85. string directory = 1;
  86. string name = 2;
  87. bool is_directory = 3;
  88. bool is_delete_data = 4;
  89. bool is_recursive = 5;
  90. }
  91. message DeleteEntryResponse {
  92. }
  93. message AssignVolumeRequest {
  94. int32 count = 1;
  95. string collection = 2;
  96. string replication = 3;
  97. int32 ttl_sec = 4;
  98. string data_center = 5;
  99. }
  100. message AssignVolumeResponse {
  101. string file_id = 1;
  102. string url = 2;
  103. string public_url = 3;
  104. int32 count = 4;
  105. }
  106. message LookupVolumeRequest {
  107. repeated string volume_ids = 1;
  108. }
  109. message Locations {
  110. repeated Location locations = 1;
  111. }
  112. message Location {
  113. string url = 1;
  114. string public_url = 2;
  115. }
  116. message LookupVolumeResponse {
  117. map<string, Locations> locations_map = 1;
  118. }
  119. message DeleteCollectionRequest {
  120. string collection = 1;
  121. }
  122. message DeleteCollectionResponse {
  123. }