volume.proto 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.baremetalsolution.v2;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/field_mask.proto";
  19. option csharp_namespace = "Google.Cloud.BareMetalSolution.V2";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2;baremetalsolution";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "VolumeProto";
  23. option java_package = "com.google.cloud.baremetalsolution.v2";
  24. option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2";
  25. option ruby_package = "Google::Cloud::BareMetalSolution::V2";
  26. // A storage volume.
  27. message Volume {
  28. option (google.api.resource) = {
  29. type: "baremetalsolution.googleapis.com/Volume"
  30. pattern: "projects/{project}/locations/{location}/volumes/{volume}"
  31. };
  32. // The storage type for a volume.
  33. enum StorageType {
  34. // The storage type for this volume is unknown.
  35. STORAGE_TYPE_UNSPECIFIED = 0;
  36. // The storage type for this volume is SSD.
  37. SSD = 1;
  38. // This storage type for this volume is HDD.
  39. HDD = 2;
  40. }
  41. // The possible states for a storage volume.
  42. enum State {
  43. // The storage volume is in an unknown state.
  44. STATE_UNSPECIFIED = 0;
  45. // The storage volume is being created.
  46. CREATING = 1;
  47. // The storage volume is ready for use.
  48. READY = 2;
  49. // The storage volume has been requested to be deleted.
  50. DELETING = 3;
  51. }
  52. // Details about snapshot space reservation and usage on the storage volume.
  53. message SnapshotReservationDetail {
  54. // The space on this storage volume reserved for snapshots, shown in GiB.
  55. int64 reserved_space_gib = 1;
  56. // The percent of snapshot space on this storage volume actually being used
  57. // by the snapshot copies. This value might be higher than 100% if the
  58. // snapshot copies have overflowed into the data portion of the storage
  59. // volume.
  60. int32 reserved_space_used_percent = 2;
  61. // The amount, in GiB, of available space in this storage volume's reserved
  62. // snapshot space.
  63. int64 reserved_space_remaining_gib = 3;
  64. // Percent of the total Volume size reserved for snapshot copies.
  65. // Enabling snapshots requires reserving 20% or more of
  66. // the storage volume space for snapshots. Maximum reserved space for
  67. // snapshots is 40%.
  68. // Setting this field will effectively set snapshot_enabled to true.
  69. int32 reserved_space_percent = 4;
  70. }
  71. // The kinds of auto delete behavior to use when snapshot reserved space is
  72. // full.
  73. enum SnapshotAutoDeleteBehavior {
  74. // The unspecified behavior.
  75. SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED = 0;
  76. // Don't delete any snapshots. This disables new snapshot creation, as
  77. // long as the snapshot reserved space is full.
  78. DISABLED = 1;
  79. // Delete the oldest snapshots first.
  80. OLDEST_FIRST = 2;
  81. // Delete the newest snapshots first.
  82. NEWEST_FIRST = 3;
  83. }
  84. // Output only. The resource name of this `Volume`.
  85. // Resource names are schemeless URIs that follow the conventions in
  86. // https://cloud.google.com/apis/design/resource_names.
  87. // Format:
  88. // `projects/{project}/locations/{location}/volumes/{volume}`
  89. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  90. // An identifier for the `Volume`, generated by the backend.
  91. string id = 11;
  92. // The storage type for this volume.
  93. StorageType storage_type = 2;
  94. // The state of this storage volume.
  95. State state = 3;
  96. // The requested size of this storage volume, in GiB.
  97. int64 requested_size_gib = 4;
  98. // The current size of this storage volume, in GiB, including space reserved
  99. // for snapshots. This size might be different than the requested size if the
  100. // storage volume has been configured with auto grow or auto shrink.
  101. int64 current_size_gib = 5;
  102. // Additional emergency size that was requested for this Volume, in GiB.
  103. // current_size_gib includes this value.
  104. int64 emergency_size_gib = 14;
  105. // The size, in GiB, that this storage volume has expanded as a result of an
  106. // auto grow policy. In the absence of auto-grow, the value is 0.
  107. int64 auto_grown_size_gib = 6;
  108. // The space remaining in the storage volume for new LUNs, in GiB, excluding
  109. // space reserved for snapshots.
  110. int64 remaining_space_gib = 7;
  111. // Details about snapshot space reservation and usage on the storage volume.
  112. SnapshotReservationDetail snapshot_reservation_detail = 8;
  113. // The behavior to use when snapshot reserved space is full.
  114. SnapshotAutoDeleteBehavior snapshot_auto_delete_behavior = 9;
  115. // Labels as key value pairs.
  116. map<string, string> labels = 12;
  117. // Whether snapshots are enabled.
  118. bool snapshot_enabled = 13;
  119. // Immutable. Pod name.
  120. string pod = 15 [(google.api.field_behavior) = IMMUTABLE];
  121. }
  122. // Message for requesting storage volume information.
  123. message GetVolumeRequest {
  124. // Required. Name of the resource.
  125. string name = 1 [
  126. (google.api.field_behavior) = REQUIRED,
  127. (google.api.resource_reference) = {
  128. type: "baremetalsolution.googleapis.com/Volume"
  129. }
  130. ];
  131. }
  132. // Message for requesting a list of storage volumes.
  133. message ListVolumesRequest {
  134. // Required. Parent value for ListVolumesRequest.
  135. string parent = 1 [
  136. (google.api.field_behavior) = REQUIRED,
  137. (google.api.resource_reference) = {
  138. type: "locations.googleapis.com/Location"
  139. }
  140. ];
  141. // Requested page size. The server might return fewer items than requested.
  142. // If unspecified, server will pick an appropriate default.
  143. int32 page_size = 2;
  144. // A token identifying a page of results from the server.
  145. string page_token = 3;
  146. // List filter.
  147. string filter = 4;
  148. }
  149. // Response message containing the list of storage volumes.
  150. message ListVolumesResponse {
  151. // The list of storage volumes.
  152. repeated Volume volumes = 1;
  153. // A token identifying a page of results from the server.
  154. string next_page_token = 2;
  155. // Locations that could not be reached.
  156. repeated string unreachable = 3;
  157. }
  158. // Message for updating a volume.
  159. message UpdateVolumeRequest {
  160. // Required. The volume to update.
  161. //
  162. // The `name` field is used to identify the volume to update.
  163. // Format: projects/{project}/locations/{location}/volumes/{volume}
  164. Volume volume = 1 [(google.api.field_behavior) = REQUIRED];
  165. // The list of fields to update.
  166. // The only currently supported fields are:
  167. // `snapshot_auto_delete_behavior`
  168. // `snapshot_schedule_policy_name`
  169. // 'labels'
  170. // 'snapshot_enabled'
  171. // 'snapshot_reservation_detail.reserved_space_percent'
  172. google.protobuf.FieldMask update_mask = 2;
  173. }
  174. // Request for emergency resize Volume.
  175. message ResizeVolumeRequest {
  176. // Required. Volume to resize.
  177. string volume = 1 [
  178. (google.api.field_behavior) = REQUIRED,
  179. (google.api.resource_reference) = {
  180. type: "baremetalsolution.googleapis.com/Volume"
  181. }
  182. ];
  183. // New Volume size, in GiB.
  184. int64 size_gib = 2;
  185. }