Skip to content

Commit ec407b3

Browse files
Terraform Team AutomationNishtha Goel
authored andcommitted
Added - Support for OPSI News Report - SQL Insights
1 parent 7468da4 commit ec407b3

File tree

7 files changed

+670
-34
lines changed

7 files changed

+670
-34
lines changed

internal/integrationtest/opsi_news_report_test.go

Lines changed: 355 additions & 21 deletions
Large diffs are not rendered by default.

internal/service/opsi/opsi_host_insight_resource.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,21 @@ func (s *OpsiHostInsightResourceCrud) populateTopLevelPolymorphicUpdateHostInsig
11501150
tmp := s.D.Id()
11511151
request.HostInsightId = &tmp
11521152
request.UpdateHostInsightDetails = details
1153+
case strings.ToLower("PE_COMANAGED_HOST"):
1154+
details := oci_opsi.UpdatePeComanagedHostInsightDetails{}
1155+
if definedTags, ok := s.D.GetOkExists("defined_tags"); ok {
1156+
convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{}))
1157+
if err != nil {
1158+
return err
1159+
}
1160+
details.DefinedTags = convertedDefinedTags
1161+
}
1162+
if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok {
1163+
details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{}))
1164+
}
1165+
tmp := s.D.Id()
1166+
request.HostInsightId = &tmp
1167+
request.UpdateHostInsightDetails = details
11531168
default:
11541169
return fmt.Errorf("unknown entity_source '%v' was specified", entitySource)
11551170
}

internal/service/opsi/opsi_news_report_data_source.go

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

6767
s.D.SetId(*s.Res.Id)
6868

69+
if s.Res.AreChildCompartmentsIncluded != nil {
70+
s.D.Set("are_child_compartments_included", *s.Res.AreChildCompartmentsIncluded)
71+
}
72+
6973
if s.Res.CompartmentId != nil {
7074
s.D.Set("compartment_id", *s.Res.CompartmentId)
7175
}
@@ -76,6 +80,8 @@ func (s *OpsiNewsReportDataSourceCrud) SetData() error {
7680
s.D.Set("content_types", nil)
7781
}
7882

83+
s.D.Set("day_of_week", s.Res.DayOfWeek)
84+
7985
if s.Res.DefinedTags != nil {
8086
s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags))
8187
}

0 commit comments

Comments
 (0)