|
| 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 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.netapp.v1; |
| 18 | + |
| 19 | +import "google/api/field_behavior.proto"; |
| 20 | +import "google/api/resource.proto"; |
| 21 | +import "google/protobuf/field_mask.proto"; |
| 22 | +import "google/protobuf/timestamp.proto"; |
| 23 | + |
| 24 | +option csharp_namespace = "Google.Cloud.NetApp.V1"; |
| 25 | +option go_package = "cloud.google.com/go/netapp/apiv1/netapppb;netapppb"; |
| 26 | +option java_multiple_files = true; |
| 27 | +option java_outer_classname = "BackupProto"; |
| 28 | +option java_package = "com.google.cloud.netapp.v1"; |
| 29 | +option php_namespace = "Google\\Cloud\\NetApp\\V1"; |
| 30 | +option ruby_package = "Google::Cloud::NetApp::V1"; |
| 31 | + |
| 32 | +// A NetApp Backup. |
| 33 | +message Backup { |
| 34 | + option (google.api.resource) = { |
| 35 | + type: "netapp.googleapis.com/Backup" |
| 36 | + pattern: "projects/{project}/locations/{location}/backupVaults/{backup_vault}/backups/{backup}" |
| 37 | + plural: "backups" |
| 38 | + singular: "backup" |
| 39 | + }; |
| 40 | + |
| 41 | + // The Backup States |
| 42 | + enum State { |
| 43 | + // State not set. |
| 44 | + STATE_UNSPECIFIED = 0; |
| 45 | + |
| 46 | + // Backup is being created. While in this state, the snapshot for the backup |
| 47 | + // point-in-time may not have been created yet, and so the point-in-time may |
| 48 | + // not have been fixed. |
| 49 | + CREATING = 1; |
| 50 | + |
| 51 | + // Backup is being uploaded. While in this state, none of the writes to the |
| 52 | + // volume will be included in the backup. |
| 53 | + UPLOADING = 2; |
| 54 | + |
| 55 | + // Backup is available for use. |
| 56 | + READY = 3; |
| 57 | + |
| 58 | + // Backup is being deleted. |
| 59 | + DELETING = 4; |
| 60 | + |
| 61 | + // Backup is not valid and cannot be used for creating new volumes or |
| 62 | + // restoring existing volumes. |
| 63 | + ERROR = 5; |
| 64 | + |
| 65 | + // Backup is being updated. |
| 66 | + UPDATING = 6; |
| 67 | + } |
| 68 | + |
| 69 | + // Backup types. |
| 70 | + enum Type { |
| 71 | + // Unspecified backup type. |
| 72 | + TYPE_UNSPECIFIED = 0; |
| 73 | + |
| 74 | + // Manual backup type. |
| 75 | + MANUAL = 1; |
| 76 | + |
| 77 | + // Scheduled backup type. |
| 78 | + SCHEDULED = 2; |
| 79 | + } |
| 80 | + |
| 81 | + // Identifier. The resource name of the backup. |
| 82 | + // Format: |
| 83 | + // `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`. |
| 84 | + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; |
| 85 | + |
| 86 | + // Output only. The backup state. |
| 87 | + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 88 | + |
| 89 | + // A description of the backup with 2048 characters or less. |
| 90 | + // Requests with longer descriptions will be rejected. |
| 91 | + string description = 3; |
| 92 | + |
| 93 | + // Output only. Size of the file system when the backup was created. When |
| 94 | + // creating a new volume from the backup, the volume capacity will have to be |
| 95 | + // at least as big. |
| 96 | + int64 volume_usage_bytes = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 97 | + |
| 98 | + // Output only. Type of backup, manually created or created by a backup |
| 99 | + // policy. |
| 100 | + Type backup_type = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 101 | + |
| 102 | + // Volume full name of this backup belongs to. |
| 103 | + // Format: |
| 104 | + // `projects/{projects_id}/locations/{location}/volumes/{volume_id}` |
| 105 | + string source_volume = 6 [ |
| 106 | + (google.api.resource_reference) = { type: "netapp.googleapis.com/Volume" } |
| 107 | + ]; |
| 108 | + |
| 109 | + // If specified, backup will be created from the given snapshot. |
| 110 | + // If not specified, there will be a new snapshot taken to initiate the backup |
| 111 | + // creation. Format: |
| 112 | + // `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}` |
| 113 | + optional string source_snapshot = 7 [ |
| 114 | + (google.api.resource_reference) = { type: "netapp.googleapis.com/Snapshot" } |
| 115 | + ]; |
| 116 | + |
| 117 | + // Output only. The time when the backup was created. |
| 118 | + google.protobuf.Timestamp create_time = 8 |
| 119 | + [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 120 | + |
| 121 | + // Resource labels to represent user provided metadata. |
| 122 | + map<string, string> labels = 9; |
| 123 | + |
| 124 | + // Output only. Total size of all backups in a chain in bytes = baseline |
| 125 | + // backup size + sum(incremental backup size) |
| 126 | + int64 chain_storage_bytes = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; |
| 127 | +} |
| 128 | + |
| 129 | +// ListBackupsRequest lists backups. |
| 130 | +message ListBackupsRequest { |
| 131 | + // Required. The backupVault for which to retrieve backup information, |
| 132 | + // in the format |
| 133 | + // `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`. |
| 134 | + // To retrieve backup information for all locations, use "-" for the |
| 135 | + // `{location}` value. |
| 136 | + // To retrieve backup information for all backupVaults, use "-" for the |
| 137 | + // `{backup_vault_id}` value. |
| 138 | + // To retrieve backup information for a volume, use "-" for the |
| 139 | + // `{backup_vault_id}` value and specify volume full name with the filter. |
| 140 | + string parent = 1 [ |
| 141 | + (google.api.field_behavior) = REQUIRED, |
| 142 | + (google.api.resource_reference) = { |
| 143 | + child_type: "netapp.googleapis.com/Backup" |
| 144 | + } |
| 145 | + ]; |
| 146 | + |
| 147 | + // The maximum number of items to return. The service may return fewer |
| 148 | + // than this value. The maximum value |
| 149 | + // is 1000; values above 1000 will be coerced to 1000. |
| 150 | + int32 page_size = 2; |
| 151 | + |
| 152 | + // The next_page_token value to use if there are additional |
| 153 | + // results to retrieve for this list request. |
| 154 | + string page_token = 3; |
| 155 | + |
| 156 | + // Sort results. Supported values are "name", "name desc" or "" (unsorted). |
| 157 | + string order_by = 4; |
| 158 | + |
| 159 | + // The standard list filter. |
| 160 | + // If specified, backups will be returned based on the attribute name that |
| 161 | + // matches the filter expression. If empty, then no backups are filtered out. |
| 162 | + // See https://google.aip.dev/160 |
| 163 | + string filter = 5; |
| 164 | +} |
| 165 | + |
| 166 | +// ListBackupsResponse is the result of ListBackupsRequest. |
| 167 | +message ListBackupsResponse { |
| 168 | + // A list of backups in the project. |
| 169 | + repeated Backup backups = 1; |
| 170 | + |
| 171 | + // The token you can use to retrieve the next page of results. Not returned |
| 172 | + // if there are no more results in the list. |
| 173 | + string next_page_token = 2; |
| 174 | + |
| 175 | + // Locations that could not be reached. |
| 176 | + repeated string unreachable = 3; |
| 177 | +} |
| 178 | + |
| 179 | +// GetBackupRequest gets the state of a backup. |
| 180 | +message GetBackupRequest { |
| 181 | + // Required. The backup resource name, in the format |
| 182 | + // `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}` |
| 183 | + string name = 1 [ |
| 184 | + (google.api.field_behavior) = REQUIRED, |
| 185 | + (google.api.resource_reference) = { type: "netapp.googleapis.com/Backup" } |
| 186 | + ]; |
| 187 | +} |
| 188 | + |
| 189 | +// CreateBackupRequest creates a backup. |
| 190 | +message CreateBackupRequest { |
| 191 | + // Required. The NetApp backupVault to create the backups of, in the format |
| 192 | + // `projects/*/locations/*/backupVaults/{backup_vault_id}` |
| 193 | + string parent = 1 [ |
| 194 | + (google.api.field_behavior) = REQUIRED, |
| 195 | + (google.api.resource_reference) = { |
| 196 | + child_type: "netapp.googleapis.com/Backup" |
| 197 | + } |
| 198 | + ]; |
| 199 | + |
| 200 | + // Required. The ID to use for the backup. |
| 201 | + // The ID must be unique within the specified backupVault. |
| 202 | + // This value must start with a lowercase letter followed by up to 62 |
| 203 | + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. |
| 204 | + // Values that do not match this pattern will trigger an INVALID_ARGUMENT |
| 205 | + // error. |
| 206 | + string backup_id = 2 [(google.api.field_behavior) = REQUIRED]; |
| 207 | + |
| 208 | + // Required. A backup resource |
| 209 | + Backup backup = 3 [(google.api.field_behavior) = REQUIRED]; |
| 210 | +} |
| 211 | + |
| 212 | +// DeleteBackupRequest deletes a backup. |
| 213 | +message DeleteBackupRequest { |
| 214 | + // Required. The backup resource name, in the format |
| 215 | + // `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}` |
| 216 | + string name = 1 [ |
| 217 | + (google.api.field_behavior) = REQUIRED, |
| 218 | + (google.api.resource_reference) = { type: "netapp.googleapis.com/Backup" } |
| 219 | + ]; |
| 220 | +} |
| 221 | + |
| 222 | +// UpdateBackupRequest updates description and/or labels for a backup. |
| 223 | +message UpdateBackupRequest { |
| 224 | + // Required. Field mask is used to specify the fields to be overwritten in the |
| 225 | + // Backup resource to be updated. |
| 226 | + // The fields specified in the update_mask are relative to the resource, not |
| 227 | + // the full request. A field will be overwritten if it is in the mask. If the |
| 228 | + // user does not provide a mask then all fields will be overwritten. |
| 229 | + google.protobuf.FieldMask update_mask = 1 |
| 230 | + [(google.api.field_behavior) = REQUIRED]; |
| 231 | + |
| 232 | + // Required. The backup being updated |
| 233 | + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; |
| 234 | +} |
0 commit comments