Skip to content

Commit fb99ead

Browse files
Madhu PankajNagaRajuPasunuri
authored andcommitted
Added - Support for Rollback Maintenance Cycle Feature
1 parent fb99aa7 commit fb99ead

13 files changed

+59
-3
lines changed

internal/integrationtest/fleet_software_update_fsu_collection_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ func TestFleetSoftwareUpdateFsuCollectionResource_DB_23ai(t *testing.T) {
638638
resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId),
639639
resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "TF_TEST_Collection_Updated"),
640640
resource.TestCheckResourceAttrSet(singularDatasourceName, "id"),
641+
resource.TestCheckResourceAttr(singularDatasourceName, "last_completed_fsu_cycle_id", ""),
641642
resource.TestCheckResourceAttr(singularDatasourceName, "service_type", "EXACS"),
642643
resource.TestCheckResourceAttr(singularDatasourceName, "source_major_version", "DB_23"),
643644
resource.TestCheckResourceAttrSet(singularDatasourceName, "state"),

internal/integrationtest/fleet_software_update_fsu_cycle_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ func TestFleetSoftwareUpdateFsuCycleResource_DB_ImageIdDetails(t *testing.T) {
627627
resource.TestCheckResourceAttr(singularDatasourceName, "is_keep_placement", "true"),
628628
resource.TestCheckResourceAttr(singularDatasourceName, "max_drain_timeout_in_seconds", "11"),
629629
resource.TestCheckResourceAttr(singularDatasourceName, "next_action_to_execute.#", "1"),
630+
resource.TestCheckResourceAttr(singularDatasourceName, "rollback_cycle_state", ""),
630631
resource.TestCheckResourceAttrSet(singularDatasourceName, "state"),
631632
resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"),
632633
resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"),

internal/service/fleet_software_update/fleet_software_update_fsu_collection_data_source.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ func (s *FleetSoftwareUpdateFsuCollectionDataSourceCrud) SetData() error {
102102

103103
s.D.Set("freeform_tags", v.FreeformTags)
104104

105+
if v.LastCompletedFsuCycleId != nil {
106+
s.D.Set("last_completed_fsu_cycle_id", *v.LastCompletedFsuCycleId)
107+
} else {
108+
s.D.Set("last_completed_fsu_cycle_id", nil)
109+
}
110+
105111
if v.LifecycleDetails != nil {
106112
s.D.Set("lifecycle_details", *v.LifecycleDetails)
107113
}
@@ -160,6 +166,10 @@ func (s *FleetSoftwareUpdateFsuCollectionDataSourceCrud) SetData() error {
160166

161167
s.D.Set("freeform_tags", v.FreeformTags)
162168

169+
if v.LastCompletedFsuCycleId != nil {
170+
s.D.Set("last_completed_fsu_cycle_id", *v.LastCompletedFsuCycleId)
171+
}
172+
163173
if v.LifecycleDetails != nil {
164174
s.D.Set("lifecycle_details", *v.LifecycleDetails)
165175
}

internal/service/fleet_software_update/fleet_software_update_fsu_collection_resource.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ func FleetSoftwareUpdateFsuCollectionResource() *schema.Resource {
262262
},
263263
},
264264
},
265+
"last_completed_fsu_cycle_id": {
266+
Type: schema.TypeString,
267+
Computed: true,
268+
},
265269
"lifecycle_details": {
266270
Type: schema.TypeString,
267271
Computed: true,
@@ -621,6 +625,10 @@ func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) SetData() error {
621625
s.D.Set("id", *v.Id)
622626
}
623627

628+
if v.LastCompletedFsuCycleId != nil {
629+
s.D.Set("last_completed_fsu_cycle_id", *v.LastCompletedFsuCycleId)
630+
}
631+
624632
if v.LifecycleDetails != nil {
625633
s.D.Set("lifecycle_details", *v.LifecycleDetails)
626634
}
@@ -683,6 +691,10 @@ func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) SetData() error {
683691
s.D.Set("id", *v.Id)
684692
}
685693

694+
if v.LastCompletedFsuCycleId != nil {
695+
s.D.Set("last_completed_fsu_cycle_id", *v.LastCompletedFsuCycleId)
696+
}
697+
686698
if v.LifecycleDetails != nil {
687699
s.D.Set("lifecycle_details", *v.LifecycleDetails)
688700
}

internal/service/fleet_software_update/fleet_software_update_fsu_cycle_data_source.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ func (s *FleetSoftwareUpdateFsuCycleDataSourceCrud) SetData() error {
146146

147147
s.D.Set("last_completed_action", v.LastCompletedAction)
148148

149+
if v.LastCompletedActionId != nil {
150+
s.D.Set("last_completed_action_id", *v.LastCompletedActionId)
151+
}
152+
149153
if v.LifecycleDetails != nil {
150154
s.D.Set("lifecycle_details", *v.LifecycleDetails)
151155
}
@@ -156,6 +160,8 @@ func (s *FleetSoftwareUpdateFsuCycleDataSourceCrud) SetData() error {
156160
}
157161
s.D.Set("next_action_to_execute", nextActionToExecute)
158162

163+
s.D.Set("rollback_cycle_state", v.RollbackCycleState)
164+
159165
if v.StageActionSchedule != nil {
160166
stageActionScheduleArray := []interface{}{}
161167
if stageActionScheduleMap := ScheduleDetailsToMap(&v.StageActionSchedule); stageActionScheduleMap != nil {

internal/service/fleet_software_update/fleet_software_update_fsu_cycle_resource.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ func FleetSoftwareUpdateFsuCycleResource() *schema.Resource {
280280
Type: schema.TypeString,
281281
Computed: true,
282282
},
283+
"last_completed_action_id": {
284+
Type: schema.TypeString,
285+
Computed: true,
286+
},
283287
"lifecycle_details": {
284288
Type: schema.TypeString,
285289
Computed: true,
@@ -305,6 +309,10 @@ func FleetSoftwareUpdateFsuCycleResource() *schema.Resource {
305309
},
306310
},
307311
},
312+
"rollback_cycle_state": {
313+
Type: schema.TypeString,
314+
Computed: true,
315+
},
308316
"state": {
309317
Type: schema.TypeString,
310318
Computed: true,
@@ -698,6 +706,10 @@ func (s *FleetSoftwareUpdateFsuCycleResourceCrud) SetData() error {
698706

699707
s.D.Set("last_completed_action", v.LastCompletedAction)
700708

709+
if v.LastCompletedActionId != nil {
710+
s.D.Set("last_completed_action_id", *v.LastCompletedActionId)
711+
}
712+
701713
if v.LifecycleDetails != nil {
702714
s.D.Set("lifecycle_details", *v.LifecycleDetails)
703715
}
@@ -708,6 +720,8 @@ func (s *FleetSoftwareUpdateFsuCycleResourceCrud) SetData() error {
708720
}
709721
s.D.Set("next_action_to_execute", nextActionToExecute)
710722

723+
s.D.Set("rollback_cycle_state", v.RollbackCycleState)
724+
711725
if v.StageActionSchedule != nil {
712726
stageActionScheduleArray := []interface{}{}
713727
if stageActionScheduleMap := ScheduleDetailsToMap(&v.StageActionSchedule); stageActionScheduleMap != nil {
@@ -994,6 +1008,10 @@ func FsuCycleSummaryToMap(obj oci_fleet_software_update.FsuCycleSummary) map[str
9941008

9951009
result["last_completed_action"] = string(obj.LastCompletedAction)
9961010

1011+
if obj.LastCompletedActionId != nil {
1012+
result["last_completed_action_id"] = string(*obj.LastCompletedActionId)
1013+
}
1014+
9971015
if obj.LifecycleDetails != nil {
9981016
result["lifecycle_details"] = string(*obj.LifecycleDetails)
9991017
}
@@ -1004,6 +1022,8 @@ func FsuCycleSummaryToMap(obj oci_fleet_software_update.FsuCycleSummary) map[str
10041022
}
10051023
result["next_action_to_execute"] = nextActionToExecute
10061024

1025+
result["rollback_cycle_state"] = string(obj.RollbackCycleState)
1026+
10071027
result["state"] = string(obj.LifecycleState)
10081028

10091029
if obj.SystemTags != nil {

website/docs/d/fleet_software_update_fsu_collection.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ The following attributes are exported:
5858
* `targets` - OCIDs of target resources to include. For EXACC service type Collections only VMClusters are allowed. For EXACS service type Collections only CloudVMClusters are allowed.
5959
* `freeform_tags` - Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
6060
* `id` - OCID identifier for the Exadata Fleet Update Collection.
61+
* `last_completed_fsu_cycle_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of last completed FSU Cycle.
6162
* `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
6263
* `service_type` - Exadata service type for the target resource members.
6364
* `source_major_version` - Database Major Version of targets to be included in the Exadata Fleet Update Collection. https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/DbVersionSummary/ListDbVersions Only Database targets that match the version specified in this value would be added to the Exadata Fleet Update Collection.

website/docs/d/fleet_software_update_fsu_collections.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ The following attributes are exported:
7272
* `targets` - OCIDs of target resources to include. For EXACC service type Collections only VMClusters are allowed. For EXACS service type Collections only CloudVMClusters are allowed.
7373
* `freeform_tags` - Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
7474
* `id` - OCID identifier for the Exadata Fleet Update Collection.
75+
* `last_completed_fsu_cycle_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of last completed FSU Cycle.
7576
* `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
7677
* `service_type` - Exadata service type for the target resource members.
7778
* `source_major_version` - Database Major Version of targets to be included in the Exadata Fleet Update Collection. https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/DbVersionSummary/ListDbVersions Only Database targets that match the version specified in this value would be added to the Exadata Fleet Update Collection.

website/docs/d/fleet_software_update_fsu_cycle.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,13 @@ The following attributes are exported:
6161
* `is_ignore_patches` - Ignore all patches between the source and target homes during patching.
6262
* `is_keep_placement` - Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same instances before and after the move operation.
6363
* `last_completed_action` - The latest Action type that was completed in the Exadata Fleet Update Cycle. No value would indicate that the Cycle has not completed any Action yet.
64+
* `last_completed_action_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest Action in the Exadata Fleet Update Cycle.
6465
* `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
6566
* `max_drain_timeout_in_seconds` - Service drain timeout specified in seconds.
6667
* `next_action_to_execute` - In this array all the possible actions will be listed. The first element is the suggested Action.
6768
* `time_to_start` - The date and time the Exadata Fleet Update Action is expected to start. Null if no Action has been scheduled. [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29.
6869
* `type` - Type of Exadata Fleet Update Action
70+
* `rollback_cycle_state` - Current rollback cycle state if rollback maintenance cycle action has been attempted. No value would indicate that the Cycle has not run a rollback maintenance cycle action before.
6971
* `stage_action_schedule` - Scheduling related details for the Exadata Fleet Update Action. The specified time should not conflict with existing Exadata Infrastructure maintenance windows. Null scheduleDetails would execute the Exadata Fleet Update Action as soon as possible.
7072
* `time_to_start` - The date and time the Exadata Fleet Update Action is expected to start. [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29.
7173
* `type` - Type of scheduling strategy to use for Fleet Patching Update Action execution.

website/docs/d/fleet_software_update_fsu_cycles.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ The following attributes are exported:
7979
* `is_ignore_patches` - Ignore all patches between the source and target homes during patching.
8080
* `is_keep_placement` - Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same instances before and after the move operation.
8181
* `last_completed_action` - The latest Action type that was completed in the Exadata Fleet Update Cycle. No value would indicate that the Cycle has not completed any Action yet.
82+
* `last_completed_action_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest Action in the Exadata Fleet Update Cycle.
8283
* `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.
8384
* `max_drain_timeout_in_seconds` - Service drain timeout specified in seconds.
8485
* `next_action_to_execute` - In this array all the possible actions will be listed. The first element is the suggested Action.
8586
* `time_to_start` - The date and time the Exadata Fleet Update Action is expected to start. Null if no Action has been scheduled. [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29.
8687
* `type` - Type of Exadata Fleet Update Action
88+
* `rollback_cycle_state` - Current rollback cycle state if rollback maintenance cycle action has been attempted. No value would indicate that the Cycle has not run a rollback maintenance cycle action before.
8789
* `stage_action_schedule` - Scheduling related details for the Exadata Fleet Update Action. The specified time should not conflict with existing Exadata Infrastructure maintenance windows. Null scheduleDetails would execute the Exadata Fleet Update Action as soon as possible.
8890
* `time_to_start` - The date and time the Exadata Fleet Update Action is expected to start. [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29.
8991
* `type` - Type of scheduling strategy to use for Fleet Patching Update Action execution.

0 commit comments

Comments
 (0)