logged_backup_plan.proto 3.9 KB

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