|
| 1 | +# Copyright 2024 Google Inc. |
| 2 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +# you may not use this file except in compliance with the License. |
| 4 | +# You may obtain a copy of the License at |
| 5 | +# |
| 6 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | + |
| 14 | +name: 'BackupPlan' |
| 15 | +min_version: beta |
| 16 | +base_url: projects/{{project}}/locations/{{location}}/backupPlans |
| 17 | +create_url: projects/{{project}}/locations/{{location}}/backupPlans/?backup_plan_id={{backup_plan_id}} |
| 18 | +self_link: projects/{{project}}/locations/{{location}}/backupPlans/{{backup_plan_id}} |
| 19 | +immutable: true |
| 20 | +description: A backup plan defines when and how to back up a resource, including the backup's schedule, retention, and location. |
| 21 | +import_format: |
| 22 | + - 'projects/{{project}}/locations/{{location}}/backupPlans/{{backup_plan_id}}' |
| 23 | +references: |
| 24 | + guides: |
| 25 | + 'Official Documentation': 'https://cloud.google.com/backup-disaster-recovery/docs' |
| 26 | + api: 'https://cloud.google.com/backup-disaster-recovery/docs/reference/rest' |
| 27 | +autogen_async: true |
| 28 | +timeouts: |
| 29 | + insert_minutes: 60 |
| 30 | + delete_minutes: 60 |
| 31 | +examples: |
| 32 | + - name: 'backup_dr_backup_plan_simple' |
| 33 | + min_version: 'beta' |
| 34 | + primary_resource_id: 'my-backup-plan-1' |
| 35 | + vars: |
| 36 | + backup_plan_id: 'backup-plan-simple-test' |
| 37 | + test_env_vars: |
| 38 | + project: :PROJECT_NAME |
| 39 | +parameters: |
| 40 | + - name: 'location' |
| 41 | + type: String |
| 42 | + required: true |
| 43 | + url_param_only: true |
| 44 | + description: | |
| 45 | + The location for the backup plan |
| 46 | + - name: 'backup_plan_id' |
| 47 | + type: String |
| 48 | + required: true |
| 49 | + url_param_only: true |
| 50 | + description: |- |
| 51 | + The ID of the backup plan |
| 52 | +properties: |
| 53 | + - name: 'name' |
| 54 | + type: String |
| 55 | + description: | |
| 56 | + The name of backup plan resource created |
| 57 | + output: true |
| 58 | + - name: 'description' |
| 59 | + type: String |
| 60 | + default_value: "" |
| 61 | + send_empty_value: true |
| 62 | + description: | |
| 63 | + The description allows for additional details about `BackupPlan` and its use cases to be provided. |
| 64 | + - name: 'backupVault' |
| 65 | + type: String |
| 66 | + description: | |
| 67 | + Backup vault where the backups gets stored using this Backup plan. |
| 68 | + required: true |
| 69 | + diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress' |
| 70 | + - name: 'backupVaultServiceAccount' |
| 71 | + type: String |
| 72 | + description: | |
| 73 | + The Google Cloud Platform Service Account to be used by the BackupVault for taking backups. |
| 74 | + output: true |
| 75 | + - name: 'resourceType' |
| 76 | + type: String |
| 77 | + description: | |
| 78 | + The resource type to which the `BackupPlan` will be applied. Examples include, "compute.googleapis.com/Instance" and "storage.googleapis.com/Bucket". |
| 79 | + required: true |
| 80 | + - name: 'createTime' |
| 81 | + type: String |
| 82 | + description: | |
| 83 | + When the `BackupPlan` was created. |
| 84 | + output: true |
| 85 | + - name: 'updateTime' |
| 86 | + type: String |
| 87 | + description: | |
| 88 | + When the `BackupPlan` was last updated. |
| 89 | + output: true |
| 90 | + - name: 'backupRules' |
| 91 | + type: Array |
| 92 | + description: | |
| 93 | + The backup rules for this `BackupPlan`. There must be at least one `BackupRule` message. |
| 94 | + required: true |
| 95 | + item_type: |
| 96 | + type: NestedObject |
| 97 | + properties: |
| 98 | + - name: 'ruleId' |
| 99 | + type: String |
| 100 | + description: The unique ID of this `BackupRule`. The `rule_id` is unique per `BackupPlan`. |
| 101 | + required: true |
| 102 | + - name: 'backupRetentionDays' |
| 103 | + type: Integer |
| 104 | + description: | |
| 105 | + Configures the duration for which backup data will be kept. The value should be greater than or equal to minimum enforced retention of the backup vault. |
| 106 | + required: true |
| 107 | + - name: 'standardSchedule' |
| 108 | + type: NestedObject |
| 109 | + description: StandardSchedule defines a schedule that runs within the confines of a defined window of days. |
| 110 | + required: true |
| 111 | + properties: |
| 112 | + - name: 'recurrenceType' |
| 113 | + type: Enum |
| 114 | + description: RecurrenceType enumerates the applicable periodicity for the schedule. |
| 115 | + enum_values: |
| 116 | + - HOURLY |
| 117 | + - DAILY |
| 118 | + - WEEKLY |
| 119 | + - MONTHLY |
| 120 | + - YEARLY |
| 121 | + required: true |
| 122 | + - name: 'hourlyFrequency' |
| 123 | + type: Integer |
| 124 | + description: | |
| 125 | + Specifies frequency for hourly backups. An hourly frequency of 2 means jobs will run every 2 hours from start time till end time defined. |
| 126 | + This is required for `recurrence_type`, `HOURLY` and is not applicable otherwise. |
| 127 | + - name: 'daysOfWeek' |
| 128 | + type: Array |
| 129 | + description: 'Specifies days of week like MONDAY or TUESDAY, on which jobs will run. This is required for `recurrence_type`, `WEEKLY` and is not applicable otherwise.' |
| 130 | + item_type: |
| 131 | + type: Enum |
| 132 | + name: 'DayOfWeekEnum' |
| 133 | + description: 'Specifies day of week' |
| 134 | + enum_values: |
| 135 | + - DAY_OF_WEEK_UNSPECIFIED |
| 136 | + - MONDAY |
| 137 | + - TUESDAY |
| 138 | + - WEDNESDAY |
| 139 | + - THURSDAY |
| 140 | + - FRIDAY |
| 141 | + - SATURDAY |
| 142 | + - name: 'daysOfMonth' |
| 143 | + type: 'Array' |
| 144 | + description: 'Specifies days of months like 1, 5, or 14 on which jobs will run.' |
| 145 | + item_type: |
| 146 | + type: Integer |
| 147 | + - name: 'weekDayOfMonth' |
| 148 | + type: NestedObject |
| 149 | + description: 'Specifies a week day of the month like FIRST SUNDAY or LAST MONDAY, on which jobs will run.' |
| 150 | + properties: |
| 151 | + - name: 'weekOfMonth' |
| 152 | + type: Enum |
| 153 | + description: 'WeekOfMonth enumerates possible weeks in the month, e.g. the first, third, or last week of the month.' |
| 154 | + enum_values: |
| 155 | + - WEEK_OF_MONTH_UNSPECIFIED |
| 156 | + - FIRST |
| 157 | + - SECOND |
| 158 | + - THIRD |
| 159 | + - FOURTH |
| 160 | + - LAST |
| 161 | + required: true |
| 162 | + - name: 'dayOfWeek' |
| 163 | + type: Enum |
| 164 | + description: 'Specifies the day of the week.' |
| 165 | + enum_values: |
| 166 | + - DAY_OF_WEEK_UNSPECIFIED |
| 167 | + - MONDAY |
| 168 | + - TUESDAY |
| 169 | + - WEDNESDAY |
| 170 | + - THURSDAY |
| 171 | + - FRIDAY |
| 172 | + - SATURDAY |
| 173 | + - SUNDAY |
| 174 | + required: true |
| 175 | + - name: 'months' |
| 176 | + type: Array |
| 177 | + description: 'Specifies values of months' |
| 178 | + item_type: |
| 179 | + type: Enum |
| 180 | + name: 'MonthEnum' |
| 181 | + description: 'Specifies the months of the year, like `FEBRUARY` and/or `MAY`, on which jobs will run.' |
| 182 | + enum_values: |
| 183 | + - MONTH_UNSPECIFIED |
| 184 | + - JANUARY |
| 185 | + - FEBRUARY |
| 186 | + - MARCH |
| 187 | + - APRIL |
| 188 | + - MAY |
| 189 | + - JUNE |
| 190 | + - JULY |
| 191 | + - AUGUST |
| 192 | + - SEPTEMBER |
| 193 | + - OCTOBER |
| 194 | + - NOVEMBER |
| 195 | + - DECEMBER |
| 196 | + - name: timeZone |
| 197 | + type: String |
| 198 | + description: The time zone to be used when interpreting the schedule. |
| 199 | + required: true |
| 200 | + - name: 'backupWindow' |
| 201 | + type: NestedObject |
| 202 | + description: | |
| 203 | + A BackupWindow defines the window of the day during which backup jobs will run. Jobs are queued at the beginning of the window and will be marked as |
| 204 | + `NOT_RUN` if they do not start by the end of the window. |
| 205 | + properties: |
| 206 | + - name: 'startHourOfDay' |
| 207 | + type: Integer |
| 208 | + send_empty_value: true |
| 209 | + description: | |
| 210 | + The hour of the day (0-23) when the window starts, for example, if the value of the start hour of the day is 6, that means the backup window starts at 6:00. |
| 211 | + required: true |
| 212 | + - name: 'endHourOfDay' |
| 213 | + type: Integer |
| 214 | + description: | |
| 215 | + The hour of the day (1-24) when the window ends, for example, if the value of end hour of the day is 10, that means the backup window end time is 10:00. |
| 216 | + The end hour of the day should be greater than the start |
0 commit comments