1// Copyright 2021 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.gkebackup.logging.v1; 18 19import "google/cloud/gkebackup/logging/v1/logged_common.proto"; 20 21option go_package = "cloud.google.com/go/gkebackup/logging/apiv1/loggingpb;loggingpb"; 22option java_multiple_files = true; 23option java_outer_classname = "LoggedBackupPlanProto"; 24option java_package = "google.cloud.gkebackup.logging.v1"; 25option csharp_namespace = "Google.Cloud.GkeBackup.Logging.V1"; 26option php_namespace = "Google\\Cloud\\GkeBackup\\Logging\\V1"; 27option ruby_package = "Google::Cloud::GkeBackup::Logging::V1"; 28 29// BackupPlan as stored in Platform log. It's used to log the details of 30// a createBackupPlan/updateBackupPlan request, so only fields that can be taken 31// from user input are included here. 32message LoggedBackupPlan { 33 // RentionPolicy is an inner message type to define: 34 // 1. When to automatically delete Backups created under this BackupPlan 35 // 2. A plan level minimum Backup retain days which blocks deletion 36 // 3. Lock to disallow any policy updates 37 message RetentionPolicy { 38 // Number of days during which deletion of a Backup created under this 39 // BackupPlan will be blocked. 40 int32 backup_delete_lock_days = 1; 41 42 // Number of days after which the service will delete a Backup. 43 // If specified, a Backup created under this BackupPlan will be 44 // automatically deleted after its age reaches create_time + 45 // backup_retain_days. 46 int32 backup_retain_days = 2; 47 48 // A flag denotes that the retention policy of this BackupPlan is locked. 49 // If set to True, no further update is allowed on this policy, including 50 // the 'locked' field itself. 51 // Default to False. 52 bool locked = 3; 53 } 54 55 // Schedule, an inner message type defines a cron schedule. 56 message Schedule { 57 // A cron style string schedule on which an operation will be executed. 58 string cron_schedule = 1; 59 60 // A flag to toggle scheduled operation. 61 bool paused = 2; 62 } 63 64 // BackupConfig, an inner message type defines the configuration of creating 65 // a backup from this BackupPlan 66 message BackupConfig { 67 oneof backup_scope { 68 // If set to true, backup whole cluster 69 bool all_namespaces = 1; 70 71 // If set, backup the list of namespaces 72 Namespaces selected_namespaces = 2; 73 74 // If set, backup the list of applications 75 NamespacedNames selected_applications = 3; 76 } 77 78 // A boolean flag specifies whether volume data should be backed up 79 bool include_volume_data = 4; 80 81 // A boolean flag specifies whether secrets should be backed up 82 bool include_secrets = 5; 83 84 // Custom encryption key. For preview, support GCP KMS only. 85 // This only contains the key metadata, and no key material. 86 EncryptionKey encryption_key = 6; 87 } 88 89 // User specified descriptive string for this BackupPlan. 90 string description = 1; 91 92 // GCP resource name of the source cluster for this BackupPlan. 93 string cluster = 2; 94 95 // RetentionPolicy governs lifecycle of Backups created under this plan. 96 RetentionPolicy retention_policy = 3; 97 98 // A set of custom labels supplied by user. 99 map<string, string> labels = 4; 100 101 // Defines scheduled Backup creation under this BackupPlan. 102 Schedule backup_schedule = 5; 103 104 // A flag indicates whether the plan has been deactivated. 105 bool deactivated = 6; 106 107 // Defines backup configuration of this BackupPlan. 108 BackupConfig backup_config = 7; 109} 110