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 = "BackupPolicyProto"; 28option java_package = "com.google.cloud.netapp.v1"; 29option php_namespace = "Google\\Cloud\\NetApp\\V1"; 30option ruby_package = "Google::Cloud::NetApp::V1"; 31 32// Backup Policy. 33message BackupPolicy { 34 option (google.api.resource) = { 35 type: "netapp.googleapis.com/BackupPolicy" 36 pattern: "projects/{project}/locations/{location}/backupPolicies/{backup_policy}" 37 plural: "backupPolicies" 38 singular: "backupPolicy" 39 }; 40 41 enum State { 42 // State not set. 43 STATE_UNSPECIFIED = 0; 44 45 // BackupPolicy is being created. 46 CREATING = 1; 47 48 // BackupPolicy is available for use. 49 READY = 2; 50 51 // BackupPolicy is being deleted. 52 DELETING = 3; 53 54 // BackupPolicy is not valid and cannot be used. 55 ERROR = 4; 56 57 // BackupPolicy is being updated. 58 UPDATING = 5; 59 } 60 61 // Identifier. The resource name of the backup policy. 62 // Format: 63 // `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`. 64 string name = 1 [(google.api.field_behavior) = IDENTIFIER]; 65 66 // Number of daily backups to keep. Note that the minimum daily backup limit 67 // is 2. 68 optional int32 daily_backup_limit = 2; 69 70 // Number of weekly backups to keep. Note that the sum of daily, weekly and 71 // monthly backups should be greater than 1. 72 optional int32 weekly_backup_limit = 3; 73 74 // Number of monthly backups to keep. Note that the sum of daily, weekly and 75 // monthly backups should be greater than 1. 76 optional int32 monthly_backup_limit = 4; 77 78 // Description of the backup policy. 79 optional string description = 5; 80 81 // If enabled, make backups automatically according to the schedules. 82 // This will be applied to all volumes that have this policy attached and 83 // enforced on volume level. If not specified, default is true. 84 optional bool enabled = 6; 85 86 // Output only. The total number of volumes assigned by this backup policy. 87 optional int32 assigned_volume_count = 7 88 [(google.api.field_behavior) = OUTPUT_ONLY]; 89 90 // Output only. The time when the backup policy was created. 91 google.protobuf.Timestamp create_time = 8 92 [(google.api.field_behavior) = OUTPUT_ONLY]; 93 94 // Resource labels to represent user provided metadata. 95 map<string, string> labels = 9; 96 97 // Output only. The backup policy state. 98 State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; 99} 100 101// CreateBackupPolicyRequest creates a backupPolicy. 102message CreateBackupPolicyRequest { 103 // Required. The location to create the backup policies of, in the format 104 // `projects/{project_id}/locations/{location}` 105 string parent = 1 [ 106 (google.api.field_behavior) = REQUIRED, 107 (google.api.resource_reference) = { 108 child_type: "netapp.googleapis.com/BackupPolicy" 109 } 110 ]; 111 112 // Required. A backupPolicy resource 113 BackupPolicy backup_policy = 2 [(google.api.field_behavior) = REQUIRED]; 114 115 // Required. The ID to use for the backup policy. 116 // The ID must be unique within the specified location. 117 // This value must start with a lowercase letter followed by up to 62 118 // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. 119 string backup_policy_id = 3 [(google.api.field_behavior) = REQUIRED]; 120} 121 122// GetBackupPolicyRequest gets the state of a backupPolicy. 123message GetBackupPolicyRequest { 124 // Required. The backupPolicy resource name, in the format 125 // `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}` 126 string name = 1 [ 127 (google.api.field_behavior) = REQUIRED, 128 (google.api.resource_reference) = { 129 type: "netapp.googleapis.com/BackupPolicy" 130 } 131 ]; 132} 133 134// ListBackupPoliciesRequest for requesting multiple backup policies. 135message ListBackupPoliciesRequest { 136 // Required. Parent value for ListBackupPoliciesRequest 137 string parent = 1 [ 138 (google.api.field_behavior) = REQUIRED, 139 (google.api.resource_reference) = { 140 child_type: "netapp.googleapis.com/BackupPolicy" 141 } 142 ]; 143 144 // Requested page size. Server may return fewer items than requested. 145 // If unspecified, the server will pick an appropriate default. 146 int32 page_size = 2; 147 148 // A token identifying a page of results the server should return. 149 string page_token = 3; 150 151 // Filtering results 152 string filter = 4; 153 154 // Hint for how to order the results 155 string order_by = 5; 156} 157 158// ListBackupPoliciesResponse contains all the backup policies requested. 159message ListBackupPoliciesResponse { 160 // The list of backup policies. 161 repeated BackupPolicy backup_policies = 1; 162 163 // A token identifying a page of results the server should return. 164 string next_page_token = 2; 165 166 // Locations that could not be reached. 167 repeated string unreachable = 3; 168} 169 170// UpdateBackupPolicyRequest for updating a backup policy. 171message UpdateBackupPolicyRequest { 172 // Required. Field mask is used to specify the fields to be overwritten in the 173 // Backup Policy resource by the update. 174 // The fields specified in the update_mask are relative to the resource, not 175 // the full request. A field will be overwritten if it is in the mask. If the 176 // user does not provide a mask then all fields will be overwritten. 177 google.protobuf.FieldMask update_mask = 1 178 [(google.api.field_behavior) = REQUIRED]; 179 180 // Required. The backup policy being updated 181 BackupPolicy backup_policy = 2 [(google.api.field_behavior) = REQUIRED]; 182} 183 184// DeleteBackupPolicyRequest deletes a backup policy. 185message DeleteBackupPolicyRequest { 186 // Required. The backup policy resource name, in the format 187 // `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}` 188 string name = 1 [ 189 (google.api.field_behavior) = REQUIRED, 190 (google.api.resource_reference) = { 191 type: "netapp.googleapis.com/BackupPolicy" 192 } 193 ]; 194} 195