summaryrefslogtreecommitdiff
path: root/third_party/googleapis/google/cloud/baremetalsolution/v2/volume.proto
blob: 39d66f9ceed80ad571ce5ff45660aa3a6aa755d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.baremetalsolution.v2;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Cloud.BareMetalSolution.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/baremetalsolution/v2;baremetalsolution";
option java_multiple_files = true;
option java_outer_classname = "VolumeProto";
option java_package = "com.google.cloud.baremetalsolution.v2";
option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2";
option ruby_package = "Google::Cloud::BareMetalSolution::V2";

// A storage volume.
message Volume {
  option (google.api.resource) = {
    type: "baremetalsolution.googleapis.com/Volume"
    pattern: "projects/{project}/locations/{location}/volumes/{volume}"
  };

  // The storage type for a volume.
  enum StorageType {
    // The storage type for this volume is unknown.
    STORAGE_TYPE_UNSPECIFIED = 0;

    // The storage type for this volume is SSD.
    SSD = 1;

    // This storage type for this volume is HDD.
    HDD = 2;
  }

  // The possible states for a storage volume.
  enum State {
    // The storage volume is in an unknown state.
    STATE_UNSPECIFIED = 0;

    // The storage volume is being created.
    CREATING = 1;

    // The storage volume is ready for use.
    READY = 2;

    // The storage volume has been requested to be deleted.
    DELETING = 3;
  }

  // Details about snapshot space reservation and usage on the storage volume.
  message SnapshotReservationDetail {
    // The space on this storage volume reserved for snapshots, shown in GiB.
    int64 reserved_space_gib = 1;

    // The percent of snapshot space on this storage volume actually being used
    // by the snapshot copies. This value might be higher than 100% if the
    // snapshot copies have overflowed into the data portion of the storage
    // volume.
    int32 reserved_space_used_percent = 2;

    // The amount, in GiB, of available space in this storage volume's reserved
    // snapshot space.
    int64 reserved_space_remaining_gib = 3;

    // Percent of the total Volume size reserved for snapshot copies.
    // Enabling snapshots requires reserving 20% or more of
    // the storage volume space for snapshots. Maximum reserved space for
    // snapshots is 40%.
    // Setting this field will effectively set snapshot_enabled to true.
    int32 reserved_space_percent = 4;
  }

  // The kinds of auto delete behavior to use when snapshot reserved space is
  // full.
  enum SnapshotAutoDeleteBehavior {
    // The unspecified behavior.
    SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED = 0;

    // Don't delete any snapshots. This disables new snapshot creation, as
    // long as the snapshot reserved space is full.
    DISABLED = 1;

    // Delete the oldest snapshots first.
    OLDEST_FIRST = 2;

    // Delete the newest snapshots first.
    NEWEST_FIRST = 3;
  }

  // Output only. The resource name of this `Volume`.
  // Resource names are schemeless URIs that follow the conventions in
  // https://cloud.google.com/apis/design/resource_names.
  // Format:
  // `projects/{project}/locations/{location}/volumes/{volume}`
  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

  // An identifier for the `Volume`, generated by the backend.
  string id = 11;

  // The storage type for this volume.
  StorageType storage_type = 2;

  // The state of this storage volume.
  State state = 3;

  // The requested size of this storage volume, in GiB.
  int64 requested_size_gib = 4;

  // The current size of this storage volume, in GiB, including space reserved
  // for snapshots. This size might be different than the requested size if the
  // storage volume has been configured with auto grow or auto shrink.
  int64 current_size_gib = 5;

  // Additional emergency size that was requested for this Volume, in GiB.
  // current_size_gib includes this value.
  int64 emergency_size_gib = 14;

  // The size, in GiB, that this storage volume has expanded as a result of an
  // auto grow policy. In the absence of auto-grow, the value is 0.
  int64 auto_grown_size_gib = 6;

  // The space remaining in the storage volume for new LUNs, in GiB, excluding
  // space reserved for snapshots.
  int64 remaining_space_gib = 7;

  // Details about snapshot space reservation and usage on the storage volume.
  SnapshotReservationDetail snapshot_reservation_detail = 8;

  // The behavior to use when snapshot reserved space is full.
  SnapshotAutoDeleteBehavior snapshot_auto_delete_behavior = 9;

  // Labels as key value pairs.
  map<string, string> labels = 12;

  // Whether snapshots are enabled.
  bool snapshot_enabled = 13;

  // Immutable. Pod name.
  string pod = 15 [(google.api.field_behavior) = IMMUTABLE];
}

// Message for requesting storage volume information.
message GetVolumeRequest {
  // Required. Name of the resource.
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "baremetalsolution.googleapis.com/Volume"
    }
  ];
}

// Message for requesting a list of storage volumes.
message ListVolumesRequest {
  // Required. Parent value for ListVolumesRequest.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "locations.googleapis.com/Location"
    }
  ];

  // Requested page size. The server might return fewer items than requested.
  // If unspecified, server will pick an appropriate default.
  int32 page_size = 2;

  // A token identifying a page of results from the server.
  string page_token = 3;

  // List filter.
  string filter = 4;
}

// Response message containing the list of storage volumes.
message ListVolumesResponse {
  // The list of storage volumes.
  repeated Volume volumes = 1;

  // A token identifying a page of results from the server.
  string next_page_token = 2;

  // Locations that could not be reached.
  repeated string unreachable = 3;
}

// Message for updating a volume.
message UpdateVolumeRequest {
  // Required. The volume to update.
  //
  // The `name` field is used to identify the volume to update.
  // Format: projects/{project}/locations/{location}/volumes/{volume}
  Volume volume = 1 [(google.api.field_behavior) = REQUIRED];

  // The list of fields to update.
  // The only currently supported fields are:
  //   `snapshot_auto_delete_behavior`
  //   `snapshot_schedule_policy_name`
  //   'labels'
  //   'snapshot_enabled'
  //   'snapshot_reservation_detail.reserved_space_percent'
  google.protobuf.FieldMask update_mask = 2;
}

// Request for emergency resize Volume.
message ResizeVolumeRequest {
  // Required. Volume to resize.
  string volume = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "baremetalsolution.googleapis.com/Volume"
    }
  ];

  // New Volume size, in GiB.
  int64 size_gib = 2;
}