|
1 | | -// Copyright (c) HashiCorp, Inc. |
2 | | -// SPDX-License-Identifier: MPL-2.0 |
| 1 | +// Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 2 |
|
4 | 3 | package odb |
5 | 4 |
|
@@ -60,6 +59,7 @@ var ResourceCloudAutonomousVMCluster = newResourceCloudAutonomousVmCluster |
60 | 59 | type resourceCloudAutonomousVmCluster struct { |
61 | 60 | framework.ResourceWithModel[cloudAutonomousVmClusterResourceModel] |
62 | 61 | framework.WithTimeouts |
| 62 | + framework.WithImportByID |
63 | 63 | } |
64 | 64 |
|
65 | 65 | func (r *resourceCloudAutonomousVmCluster) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { |
@@ -339,30 +339,55 @@ func (r *resourceCloudAutonomousVmCluster) Schema(ctx context.Context, req resou |
339 | 339 |
|
340 | 340 | NestedObject: schema.NestedBlockObject{ |
341 | 341 | Attributes: map[string]schema.Attribute{ |
342 | | - "days_of_week": schema.SetAttribute{ |
343 | | - ElementType: fwtypes.NewObjectTypeOf[dayWeekNameAutonomousVmClusterMaintenanceWindowResourceModel](ctx), |
| 342 | + "custom_action_timeout_in_mins": schema.Int32Attribute{ |
344 | 343 | Optional: true, |
345 | 344 | Computed: true, |
346 | | - Description: "The day of week of the Autonomous VM cluster.", |
| 345 | + Description: "The custom action timeout in minutes for the maintenance window.", |
347 | 346 | }, |
348 | | - "months": schema.SetAttribute{ |
349 | | - ElementType: fwtypes.NewObjectTypeOf[monthNameAutonomousVmClusterMaintenanceWindowResourceModel](ctx), |
| 347 | + "days_of_week": schema.SetAttribute{ |
| 348 | + ElementType: fwtypes.NewObjectTypeOf[dayWeekNameAutonomousVmClusterMaintenanceWindowResourceModel](ctx), |
350 | 349 | Optional: true, |
351 | 350 | Computed: true, |
352 | | - Description: "The month of the Autonomous VM cluster.", |
| 351 | + Description: "The days of the week when maintenance can be performed.", |
353 | 352 | }, |
354 | 353 | "hours_of_day": schema.SetAttribute{ |
355 | 354 | ElementType: types.Int32Type, |
356 | 355 | Optional: true, |
357 | 356 | Computed: true, |
| 357 | + Description: "The hours of the day when maintenance can be performed.", |
| 358 | + }, |
| 359 | + "is_custom_action_timeout_enabled": schema.BoolAttribute{ |
| 360 | + Optional: true, |
| 361 | + Computed: true, |
| 362 | + Description: "Indicates whether custom action timeout is enabled for the maintenance window.", |
358 | 363 | }, |
359 | 364 | "lead_time_in_weeks": schema.Int32Attribute{ |
360 | | - Optional: true, |
361 | | - Computed: true, |
| 365 | + Optional: true, |
| 366 | + Computed: true, |
| 367 | + Description: "The lead time in weeks before the maintenance window.", |
| 368 | + }, |
| 369 | + "months": schema.SetAttribute{ |
| 370 | + ElementType: fwtypes.NewObjectTypeOf[monthNameAutonomousVmClusterMaintenanceWindowResourceModel](ctx), |
| 371 | + Optional: true, |
| 372 | + Computed: true, |
| 373 | + Description: "The months when maintenance can be performed.", |
| 374 | + }, |
| 375 | + "patching_mode": schema.StringAttribute{ |
| 376 | + Optional: true, |
| 377 | + Computed: true, |
| 378 | + CustomType: fwtypes.StringEnumType[odbtypes.PatchingModeType](), |
| 379 | + Description: "The patching mode for the maintenance window.", |
362 | 380 | }, |
363 | 381 | "preference": schema.StringAttribute{ |
364 | | - Required: true, |
365 | | - CustomType: fwtypes.StringEnumType[odbtypes.PreferenceType](), |
| 382 | + Required: true, |
| 383 | + CustomType: fwtypes.StringEnumType[odbtypes.PreferenceType](), |
| 384 | + Description: "The preference for the maintenance window scheduling.", |
| 385 | + }, |
| 386 | + "weeks_of_month": schema.SetAttribute{ |
| 387 | + ElementType: types.Int32Type, |
| 388 | + Optional: true, |
| 389 | + Computed: true, |
| 390 | + Description: "Indicates whether to skip release updates during maintenance.", |
366 | 391 | }, |
367 | 392 | }, |
368 | 393 | }, |
@@ -651,12 +676,15 @@ type cloudAutonomousVmClusterResourceModel struct { |
651 | 676 | } |
652 | 677 |
|
653 | 678 | type cloudAutonomousVmClusterMaintenanceWindowResourceModel struct { |
654 | | - DaysOfWeek fwtypes.SetNestedObjectValueOf[dayWeekNameAutonomousVmClusterMaintenanceWindowResourceModel] `tfsdk:"days_of_week"` |
655 | | - HoursOfDay fwtypes.SetValueOf[types.Int32] `tfsdk:"hours_of_day"` |
656 | | - LeadTimeInWeeks types.Int32 `tfsdk:"lead_time_in_weeks"` |
657 | | - Months fwtypes.SetNestedObjectValueOf[monthNameAutonomousVmClusterMaintenanceWindowResourceModel] `tfsdk:"months"` |
658 | | - Preference fwtypes.StringEnum[odbtypes.PreferenceType] `tfsdk:"preference"` |
659 | | - WeeksOfMonth fwtypes.SetValueOf[types.Int32] `tfsdk:"weeks_of_month"` |
| 679 | + CustomActionTimeoutInMins types.Int32 `tfsdk:"custom_action_timeout_in_mins"` |
| 680 | + DaysOfWeek fwtypes.SetNestedObjectValueOf[dayWeekNameAutonomousVmClusterMaintenanceWindowResourceModel] `tfsdk:"days_of_week"` |
| 681 | + HoursOfDay fwtypes.SetValueOf[types.Int32] `tfsdk:"hours_of_day"` |
| 682 | + IsCustomActionTimeoutEnabled types.Bool `tfsdk:"is_custom_action_timeout_enabled"` |
| 683 | + LeadTimeInWeeks types.Int32 `tfsdk:"lead_time_in_weeks"` |
| 684 | + Months fwtypes.SetNestedObjectValueOf[monthNameAutonomousVmClusterMaintenanceWindowResourceModel] `tfsdk:"months"` |
| 685 | + PatchingMode fwtypes.StringEnum[odbtypes.PatchingModeType] `tfsdk:"patching_mode"` |
| 686 | + Preference fwtypes.StringEnum[odbtypes.PreferenceType] `tfsdk:"preference"` |
| 687 | + WeeksOfMonth fwtypes.SetValueOf[types.Int32] `tfsdk:"weeks_of_month"` |
660 | 688 | } |
661 | 689 |
|
662 | 690 | type dayWeekNameAutonomousVmClusterMaintenanceWindowResourceModel struct { |
|
0 commit comments