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.

173 lines
3.8 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 VolumeDelete (VolumeDeleteRequest) returns (VolumeDeleteResponse) {
  31. }
  32. // rpc VolumeUiPage (VolumeUiPageRequest) returns (VolumeUiPageResponse) {}
  33. }
  34. //////////////////////////////////////////////////
  35. message BatchDeleteRequest {
  36. repeated string file_ids = 1;
  37. }
  38. message BatchDeleteResponse {
  39. repeated DeleteResult results = 1;
  40. }
  41. message DeleteResult {
  42. string file_id = 1;
  43. int32 status = 2;
  44. string error = 3;
  45. uint32 size = 4;
  46. }
  47. message Empty {
  48. }
  49. message VacuumVolumeCheckRequest {
  50. uint32 volumd_id = 1;
  51. }
  52. message VacuumVolumeCheckResponse {
  53. double garbage_ratio = 1;
  54. }
  55. message VacuumVolumeCompactRequest {
  56. uint32 volumd_id = 1;
  57. int64 preallocate = 2;
  58. }
  59. message VacuumVolumeCompactResponse {
  60. }
  61. message VacuumVolumeCommitRequest {
  62. uint32 volumd_id = 1;
  63. }
  64. message VacuumVolumeCommitResponse {
  65. }
  66. message VacuumVolumeCleanupRequest {
  67. uint32 volumd_id = 1;
  68. }
  69. message VacuumVolumeCleanupResponse {
  70. }
  71. message DeleteCollectionRequest {
  72. string collection = 1;
  73. }
  74. message DeleteCollectionResponse {
  75. }
  76. message AssignVolumeRequest {
  77. uint32 volumd_id = 1;
  78. string collection = 2;
  79. int64 preallocate = 3;
  80. string replication = 4;
  81. string ttl = 5;
  82. }
  83. message AssignVolumeResponse {
  84. }
  85. message VolumeSyncStatusRequest {
  86. uint32 volumd_id = 1;
  87. }
  88. message VolumeSyncStatusResponse {
  89. uint32 volumd_id = 1;
  90. string collection = 2;
  91. string replication = 4;
  92. string ttl = 5;
  93. uint64 tail_offset = 6;
  94. uint32 compact_revision = 7;
  95. uint64 idx_file_size = 8;
  96. }
  97. message VolumeSyncIndexRequest {
  98. uint32 volumd_id = 1;
  99. }
  100. message VolumeSyncIndexResponse {
  101. bytes index_file_content = 1;
  102. }
  103. message VolumeSyncDataRequest {
  104. uint32 volumd_id = 1;
  105. uint32 revision = 2;
  106. uint32 offset = 3;
  107. uint32 size = 4;
  108. string needle_id = 5;
  109. }
  110. message VolumeSyncDataResponse {
  111. bytes file_content = 1;
  112. }
  113. message VolumeMountRequest {
  114. uint32 volumd_id = 1;
  115. }
  116. message VolumeMountResponse {
  117. }
  118. message VolumeUnmountRequest {
  119. uint32 volumd_id = 1;
  120. }
  121. message VolumeUnmountResponse {
  122. }
  123. message VolumeDeleteRequest {
  124. uint32 volumd_id = 1;
  125. }
  126. message VolumeDeleteResponse {
  127. }
  128. message VolumeUiPageRequest {
  129. }
  130. message VolumeUiPageResponse {
  131. }
  132. message DiskStatus {
  133. string dir = 1;
  134. uint64 all = 2;
  135. uint64 used = 3;
  136. uint64 free = 4;
  137. }
  138. message MemStatus {
  139. int32 goroutines = 1;
  140. uint64 all = 2;
  141. uint64 used = 3;
  142. uint64 free = 4;
  143. uint64 self = 5;
  144. uint64 heap = 6;
  145. uint64 stack = 7;
  146. }