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.netapp.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/protobuf/field_mask.proto"; 22import "google/protobuf/timestamp.proto"; 23 24option csharp_namespace = "Google.Cloud.NetApp.V1"; 25option go_package = "cloud.google.com/go/netapp/apiv1/netapppb;netapppb"; 26option java_multiple_files = true; 27option java_outer_classname = "SnapshotProto"; 28option java_package = "com.google.cloud.netapp.v1"; 29option php_namespace = "Google\\Cloud\\NetApp\\V1"; 30option ruby_package = "Google::Cloud::NetApp::V1"; 31 32// ListSnapshotsRequest lists snapshots. 33message ListSnapshotsRequest { 34 // Required. The volume for which to retrieve snapshot information, 35 // in the format 36 // `projects/{project_id}/locations/{location}/volumes/{volume_id}`. 37 string parent = 1 [ 38 (google.api.field_behavior) = REQUIRED, 39 (google.api.resource_reference) = { 40 child_type: "netapp.googleapis.com/Snapshot" 41 } 42 ]; 43 44 // The maximum number of items to return. 45 int32 page_size = 2; 46 47 // The next_page_token value to use if there are additional 48 // results to retrieve for this list request. 49 string page_token = 3; 50 51 // Sort results. Supported values are "name", "name desc" or "" (unsorted). 52 string order_by = 4; 53 54 // List filter. 55 string filter = 5; 56} 57 58// ListSnapshotsResponse is the result of ListSnapshotsRequest. 59message ListSnapshotsResponse { 60 // A list of snapshots in the project for the specified volume. 61 repeated Snapshot snapshots = 1; 62 63 // The token you can use to retrieve the next page of results. Not returned 64 // if there are no more results in the list. 65 string next_page_token = 2; 66 67 // Locations that could not be reached. 68 repeated string unreachable = 3; 69} 70 71// GetSnapshotRequest gets the state of a snapshot. 72message GetSnapshotRequest { 73 // Required. The snapshot resource name, in the format 74 // `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}` 75 string name = 1 [ 76 (google.api.field_behavior) = REQUIRED, 77 (google.api.resource_reference) = { type: "netapp.googleapis.com/Snapshot" } 78 ]; 79} 80 81// CreateSnapshotRequest creates a snapshot. 82message CreateSnapshotRequest { 83 // Required. The NetApp volume to create the snapshots of, in the format 84 // `projects/{project_id}/locations/{location}/volumes/{volume_id}` 85 string parent = 1 [ 86 (google.api.field_behavior) = REQUIRED, 87 (google.api.resource_reference) = { 88 child_type: "netapp.googleapis.com/Snapshot" 89 } 90 ]; 91 92 // Required. A snapshot resource 93 Snapshot snapshot = 2 [(google.api.field_behavior) = REQUIRED]; 94 95 // Required. ID of the snapshot to create. 96 // This value must start with a lowercase letter followed by up to 62 97 // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. 98 string snapshot_id = 3 [(google.api.field_behavior) = REQUIRED]; 99} 100 101// DeleteSnapshotRequest deletes a snapshot. 102message DeleteSnapshotRequest { 103 // Required. The snapshot resource name, in the format 104 // `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}` 105 string name = 1 [ 106 (google.api.field_behavior) = REQUIRED, 107 (google.api.resource_reference) = { type: "netapp.googleapis.com/Snapshot" } 108 ]; 109} 110 111// UpdateSnapshotRequest updates description and/or labels for a snapshot. 112message UpdateSnapshotRequest { 113 // Required. Mask of fields to update. At least one path must be supplied in 114 // this field. 115 google.protobuf.FieldMask update_mask = 1 116 [(google.api.field_behavior) = REQUIRED]; 117 118 // Required. A snapshot resource 119 Snapshot snapshot = 2 [(google.api.field_behavior) = REQUIRED]; 120} 121 122// Snapshot is a point-in-time version of a Volume's content. 123message Snapshot { 124 option (google.api.resource) = { 125 type: "netapp.googleapis.com/Snapshot" 126 pattern: "projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}" 127 plural: "snapshots" 128 singular: "snapshot" 129 }; 130 131 // The Snapshot States 132 enum State { 133 // Unspecified Snapshot State 134 STATE_UNSPECIFIED = 0; 135 136 // Snapshot State is Ready 137 READY = 1; 138 139 // Snapshot State is Creating 140 CREATING = 2; 141 142 // Snapshot State is Deleting 143 DELETING = 3; 144 145 // Snapshot State is Updating 146 UPDATING = 4; 147 148 // Snapshot State is Disabled 149 DISABLED = 5; 150 151 // Snapshot State is Error 152 ERROR = 6; 153 } 154 155 // Identifier. The resource name of the snapshot. 156 // Format: 157 // `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`. 158 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 159 160 // Output only. The snapshot state. 161 State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 162 163 // Output only. State details of the storage pool 164 string state_details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 165 166 // A description of the snapshot with 2048 characters or less. 167 // Requests with longer descriptions will be rejected. 168 string description = 4; 169 170 // Output only. Current storage usage for the snapshot in bytes. 171 double used_bytes = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 172 173 // Output only. The time when the snapshot was created. 174 google.protobuf.Timestamp create_time = 6 175 [(google.api.field_behavior) = OUTPUT_ONLY]; 176 177 // Resource labels to represent user provided metadata. 178 map<string, string> labels = 7; 179} 180