xref: /aosp_15_r20/external/googleapis/google/cloud/baremetalsolution/v2/volume_snapshot.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 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
15syntax = "proto3";
16
17package google.cloud.baremetalsolution.v2;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/timestamp.proto";
22
23option csharp_namespace = "Google.Cloud.BareMetalSolution.V2";
24option go_package = "cloud.google.com/go/baremetalsolution/apiv2/baremetalsolutionpb;baremetalsolutionpb";
25option java_multiple_files = true;
26option java_outer_classname = "VolumeSnapshotProto";
27option java_package = "com.google.cloud.baremetalsolution.v2";
28option php_namespace = "Google\\Cloud\\BareMetalSolution\\V2";
29option ruby_package = "Google::Cloud::BareMetalSolution::V2";
30
31// A snapshot of a volume. Only boot volumes can have snapshots.
32message VolumeSnapshot {
33  option (google.api.resource) = {
34    type: "baremetalsolution.googleapis.com/VolumeSnapshot"
35    pattern: "projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}"
36  };
37
38  // Represents the type of a snapshot.
39  enum SnapshotType {
40    // Type is not specified.
41    SNAPSHOT_TYPE_UNSPECIFIED = 0;
42
43    // Snapshot was taken manually by user.
44    AD_HOC = 1;
45
46    // Snapshot was taken automatically as a part of a snapshot schedule.
47    SCHEDULED = 2;
48  }
49
50  // The name of the snapshot.
51  string name = 1;
52
53  // Output only. An identifier for the snapshot, generated by the backend.
54  string id = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
55
56  // The description of the snapshot.
57  string description = 2;
58
59  // Output only. The creation time of the snapshot.
60  google.protobuf.Timestamp create_time = 4
61      [(google.api.field_behavior) = OUTPUT_ONLY];
62
63  // Output only. The name of the volume which this snapshot belongs to.
64  string storage_volume = 5 [
65    (google.api.field_behavior) = OUTPUT_ONLY,
66    (google.api.resource_reference) = {
67      type: "baremetalsolution.googleapis.com/Volume"
68    }
69  ];
70
71  // Output only. The type of the snapshot which indicates whether it was
72  // scheduled or manual/ad-hoc.
73  SnapshotType type = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
74}
75
76// Message for requesting volume snapshot information.
77message GetVolumeSnapshotRequest {
78  // Required. The name of the snapshot.
79  string name = 1 [
80    (google.api.field_behavior) = REQUIRED,
81    (google.api.resource_reference) = {
82      type: "baremetalsolution.googleapis.com/VolumeSnapshot"
83    }
84  ];
85}
86
87// Message for requesting a list of volume snapshots.
88message ListVolumeSnapshotsRequest {
89  // Required. Parent value for ListVolumesRequest.
90  string parent = 1 [
91    (google.api.field_behavior) = REQUIRED,
92    (google.api.resource_reference) = {
93      type: "baremetalsolution.googleapis.com/Volume"
94    }
95  ];
96
97  // Requested page size. The server might return fewer items than requested.
98  // If unspecified, server will pick an appropriate default.
99  int32 page_size = 2;
100
101  // A token identifying a page of results from the server.
102  string page_token = 3;
103}
104
105// Response message containing the list of volume snapshots.
106message ListVolumeSnapshotsResponse {
107  // The list of snapshots.
108  repeated VolumeSnapshot volume_snapshots = 1;
109
110  // A token identifying a page of results from the server.
111  string next_page_token = 2;
112
113  // Locations that could not be reached.
114  repeated string unreachable = 3;
115}
116
117// Message for deleting named Volume snapshot.
118message DeleteVolumeSnapshotRequest {
119  // Required. The name of the snapshot to delete.
120  string name = 1 [
121    (google.api.field_behavior) = REQUIRED,
122    (google.api.resource_reference) = {
123      type: "baremetalsolution.googleapis.com/VolumeSnapshot"
124    }
125  ];
126}
127
128// Message for creating a volume snapshot.
129message CreateVolumeSnapshotRequest {
130  // Required. The volume to snapshot.
131  string parent = 1 [
132    (google.api.field_behavior) = REQUIRED,
133    (google.api.resource_reference) = {
134      type: "baremetalsolution.googleapis.com/Volume"
135    }
136  ];
137
138  // Required. The snapshot to create.
139  VolumeSnapshot volume_snapshot = 2 [(google.api.field_behavior) = REQUIRED];
140}
141
142// Message for restoring a volume snapshot.
143message RestoreVolumeSnapshotRequest {
144  // Required. Name of the snapshot which will be used to restore its parent
145  // volume.
146  string volume_snapshot = 1 [
147    (google.api.field_behavior) = REQUIRED,
148    (google.api.resource_reference) = {
149      type: "baremetalsolution.googleapis.com/VolumeSnapshot"
150    }
151  ];
152}
153