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.

165 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 (stream VolumeSyncIndexResponse) {
  23. }
  24. rpc VolumeSyncData (VolumeSyncDataRequest) returns (stream 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 collection = 2;
  89. string replication = 4;
  90. string ttl = 5;
  91. uint64 tail_offset = 6;
  92. uint32 compact_revision = 7;
  93. uint64 idx_file_size = 8;
  94. }
  95. message VolumeSyncIndexRequest {
  96. uint32 volumd_id = 1;
  97. }
  98. message VolumeSyncIndexResponse {
  99. bytes index_file_content = 1;
  100. }
  101. message VolumeSyncDataRequest {
  102. uint32 volumd_id = 1;
  103. uint32 revision = 2;
  104. uint32 offset = 3;
  105. uint32 size = 4;
  106. string needle_id = 5;
  107. }
  108. message VolumeSyncDataResponse {
  109. bytes file_content = 1;
  110. }
  111. message VolumeMountRequest {
  112. uint32 volumd_id = 1;
  113. }
  114. message VolumeMountResponse {
  115. }
  116. message VolumeUnmountRequest {
  117. uint32 volumd_id = 1;
  118. }
  119. message VolumeUnmountResponse {
  120. }
  121. message VolumeUiPageRequest {
  122. }
  123. message VolumeUiPageResponse {
  124. }
  125. message DiskStatus {
  126. string dir = 1;
  127. uint64 all = 2;
  128. uint64 used = 3;
  129. uint64 free = 4;
  130. }
  131. message MemStatus {
  132. int32 goroutines = 1;
  133. uint64 all = 2;
  134. uint64 used = 3;
  135. uint64 free = 4;
  136. uint64 self = 5;
  137. uint64 heap = 6;
  138. uint64 stack = 7;
  139. }