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.

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