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.

146 lines
2.7 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. }
  55. message GetEntryAttributesRequest {
  56. string name = 1;
  57. string parent_dir = 2;
  58. string file_id = 3;
  59. }
  60. message GetEntryAttributesResponse {
  61. FuseAttributes attributes = 1;
  62. repeated FileChunk chunks = 2;
  63. }
  64. message GetFileContentRequest {
  65. string file_id = 1;
  66. }
  67. message GetFileContentResponse {
  68. bytes content = 1;
  69. }
  70. message CreateEntryRequest {
  71. string directory = 1;
  72. Entry entry = 2;
  73. }
  74. message CreateEntryResponse {
  75. }
  76. message UpdateEntryRequest {
  77. string directory = 1;
  78. Entry entry = 2;
  79. }
  80. message UpdateEntryResponse {
  81. }
  82. message DeleteEntryRequest {
  83. string directory = 1;
  84. string name = 2;
  85. bool is_directory = 3;
  86. }
  87. message DeleteEntryResponse {
  88. }
  89. message AssignVolumeRequest {
  90. int32 count = 1;
  91. string collection = 2;
  92. string replication = 3;
  93. }
  94. message AssignVolumeResponse {
  95. string file_id = 1;
  96. string url = 2;
  97. string public_url = 3;
  98. int32 count = 4;
  99. }
  100. message LookupVolumeRequest {
  101. repeated string volume_ids = 1;
  102. }
  103. message Locations {
  104. repeated Location locations = 1;
  105. }
  106. message Location {
  107. string url = 1;
  108. string public_url = 2;
  109. }
  110. message LookupVolumeResponse {
  111. map<string, Locations> locations_map = 1;
  112. }