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.

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