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.

164 lines
3.6 KiB

  1. syntax = "proto3";
  2. package volume_server_pb;
  3. //////////////////////////////////////////////////
  4. service VolumeServer {
  5. //Experts only: takes multiple fid parameters. This function does not propagate deletes to replicas.
  6. rpc BatchDelete (BatchDeleteRequest) returns (BatchDeleteResponse) {
  7. }
  8. rpc VacuumVolumeCheck (VacuumVolumeCheckRequest) returns (VacuumVolumeCheckResponse) {
  9. }
  10. rpc VacuumVolumeCompact (VacuumVolumeCompactRequest) returns (VacuumVolumeCompactResponse) {
  11. }
  12. rpc VacuumVolumeCommit (VacuumVolumeCommitRequest) returns (VacuumVolumeCommitResponse) {
  13. }
  14. rpc VacuumVolumeCleanup (VacuumVolumeCleanupRequest) returns (VacuumVolumeCleanupResponse) {
  15. }
  16. rpc DeleteCollection (DeleteCollectionRequest) returns (DeleteCollectionResponse) {
  17. }
  18. rpc AssignVolume (AssignVolumeRequest) returns (AssignVolumeResponse) {
  19. }
  20. rpc VolumeSyncStatus (VolumeSyncStatusRequest) returns (VolumeSyncStatusResponse) {
  21. }
  22. rpc VolumeSyncIndex (VolumeSyncIndexRequest) returns (VolumeSyncIndexResponse) {
  23. }
  24. rpc VolumeSyncData (VolumeSyncDataRequest) returns (VolumeSyncDataResponse) {
  25. }
  26. rpc VolumeMount (VolumeMountRequest) returns (VolumeMountResponse) {
  27. }
  28. rpc VolumeUnmount (VolumeUnmountRequest) returns (VolumeUnmountResponse) {
  29. }
  30. // rpc VolumeUiPage (VolumeUiPageRequest) returns (VolumeUiPageResponse) {}
  31. }
  32. //////////////////////////////////////////////////
  33. message BatchDeleteRequest {
  34. repeated string file_ids = 1;
  35. }
  36. message BatchDeleteResponse {
  37. repeated DeleteResult results = 1;
  38. }
  39. message DeleteResult {
  40. string file_id = 1;
  41. int32 status = 2;
  42. string error = 3;
  43. uint32 size = 4;
  44. }
  45. message Empty {
  46. }
  47. message VacuumVolumeCheckRequest {
  48. uint32 volumd_id = 1;
  49. }
  50. message VacuumVolumeCheckResponse {
  51. double garbage_ratio = 1;
  52. }
  53. message VacuumVolumeCompactRequest {
  54. uint32 volumd_id = 1;
  55. int64 preallocate = 2;
  56. }
  57. message VacuumVolumeCompactResponse {
  58. }
  59. message VacuumVolumeCommitRequest {
  60. uint32 volumd_id = 1;
  61. }
  62. message VacuumVolumeCommitResponse {
  63. }
  64. message VacuumVolumeCleanupRequest {
  65. uint32 volumd_id = 1;
  66. }
  67. message VacuumVolumeCleanupResponse {
  68. }
  69. message DeleteCollectionRequest {
  70. string collection = 1;
  71. }
  72. message DeleteCollectionResponse {
  73. }
  74. message AssignVolumeRequest {
  75. uint32 volumd_id = 1;
  76. string collection = 2;
  77. int64 preallocate = 3;
  78. string replication = 4;
  79. string ttl = 5;
  80. }
  81. message AssignVolumeResponse {
  82. }
  83. message VolumeSyncStatusRequest {
  84. uint32 volumd_id = 1;
  85. }
  86. message VolumeSyncStatusResponse {
  87. uint32 volumd_id = 1;
  88. string replication = 4;
  89. string ttl = 5;
  90. uint64 tail_offset = 6;
  91. uint32 compact_revision = 7;
  92. uint64 idx_file_size = 8;
  93. }
  94. message VolumeSyncIndexRequest {
  95. uint32 volumd_id = 1;
  96. }
  97. message VolumeSyncIndexResponse {
  98. bytes index_file_content = 1;
  99. }
  100. message VolumeSyncDataRequest {
  101. uint32 volumd_id = 1;
  102. uint32 revision = 2;
  103. uint32 offset = 3;
  104. uint32 size = 4;
  105. string needle_id = 5;
  106. }
  107. message VolumeSyncDataResponse {
  108. bytes file_content = 1;
  109. }
  110. message VolumeMountRequest {
  111. uint32 volumd_id = 1;
  112. }
  113. message VolumeMountResponse {
  114. }
  115. message VolumeUnmountRequest {
  116. uint32 volumd_id = 1;
  117. }
  118. message VolumeUnmountResponse {
  119. }
  120. message VolumeUiPageRequest {
  121. }
  122. message VolumeUiPageResponse {
  123. }
  124. message DiskStatus {
  125. string dir = 1;
  126. uint64 all = 2;
  127. uint64 used = 3;
  128. uint64 free = 4;
  129. }
  130. message MemStatus {
  131. int32 goroutines = 1;
  132. uint64 all = 2;
  133. uint64 used = 3;
  134. uint64 free = 4;
  135. uint64 self = 5;
  136. uint64 heap = 6;
  137. uint64 stack = 7;
  138. }