@@ -15,151 +15,12 @@ func init() {
1515}
1616
1717func OsmanagementManagedInstanceDataSource () * schema.Resource {
18- return & schema.Resource {
19- Read : readSingularOsmanagementManagedInstance ,
20- Schema : map [string ]* schema.Schema {
21- "managed_instance_id" : {
22- Type : schema .TypeString ,
23- Required : true ,
24- },
25- // Computed
26- "bug_updates_available" : {
27- Type : schema .TypeInt ,
28- Computed : true ,
29- },
30- "child_software_sources" : {
31- Type : schema .TypeList ,
32- Computed : true ,
33- Elem : & schema.Resource {
34- Schema : map [string ]* schema.Schema {
35- // Required
36-
37- // Optional
38-
39- // Computed
40- "id" : {
41- Type : schema .TypeString ,
42- Computed : true ,
43- },
44- "name" : {
45- Type : schema .TypeString ,
46- Computed : true ,
47- },
48- },
49- },
50- },
51- "compartment_id" : {
52- Type : schema .TypeString ,
53- Computed : true ,
54- },
55- "description" : {
56- Type : schema .TypeString ,
57- Computed : true ,
58- },
59- "display_name" : {
60- Type : schema .TypeString ,
61- Computed : true ,
62- },
63- "enhancement_updates_available" : {
64- Type : schema .TypeInt ,
65- Computed : true ,
66- },
67- "is_reboot_required" : {
68- Type : schema .TypeBool ,
69- Computed : true ,
70- },
71- "last_boot" : {
72- Type : schema .TypeString ,
73- Computed : true ,
74- },
75- "last_checkin" : {
76- Type : schema .TypeString ,
77- Computed : true ,
78- },
79- "managed_instance_groups" : {
80- Type : schema .TypeList ,
81- Computed : true ,
82- Elem : & schema.Resource {
83- Schema : map [string ]* schema.Schema {
84- // Required
85-
86- // Optional
87-
88- // Computed
89- "display_name" : {
90- Type : schema .TypeString ,
91- Computed : true ,
92- },
93- "id" : {
94- Type : schema .TypeString ,
95- Computed : true ,
96- },
97- },
98- },
99- },
100- "os_family" : {
101- Type : schema .TypeString ,
102- Computed : true ,
103- },
104- "os_kernel_version" : {
105- Type : schema .TypeString ,
106- Computed : true ,
107- },
108- "os_name" : {
109- Type : schema .TypeString ,
110- Computed : true ,
111- },
112- "os_version" : {
113- Type : schema .TypeString ,
114- Computed : true ,
115- },
116- "other_updates_available" : {
117- Type : schema .TypeInt ,
118- Computed : true ,
119- },
120- "parent_software_source" : {
121- Type : schema .TypeList ,
122- Computed : true ,
123- Elem : & schema.Resource {
124- Schema : map [string ]* schema.Schema {
125- // Required
126-
127- // Optional
128-
129- // Computed
130- "id" : {
131- Type : schema .TypeString ,
132- Computed : true ,
133- },
134- "name" : {
135- Type : schema .TypeString ,
136- Computed : true ,
137- },
138- },
139- },
140- },
141- "scheduled_job_count" : {
142- Type : schema .TypeInt ,
143- Computed : true ,
144- },
145- "security_updates_available" : {
146- Type : schema .TypeInt ,
147- Computed : true ,
148- },
149- "status" : {
150- Type : schema .TypeString ,
151- Computed : true ,
152- },
153- "updates_available" : {
154- Type : schema .TypeInt ,
155- Computed : true ,
156- },
157- "work_request_count" : {
158- Type : schema .TypeInt ,
159- Computed : true ,
160- },
161- },
18+ fieldMap := make (map [string ]* schema.Schema )
19+ fieldMap ["managed_instance_id" ] = & schema.Schema {
20+ Type : schema .TypeString ,
21+ Required : true ,
16222 }
23+ return GetSingularDataSourceItemSchema (OsmanagementManagedInstanceResource (), fieldMap , readSingularOsmanagementManagedInstance )
16324}
16425
16526func readSingularOsmanagementManagedInstance (d * schema.ResourceData , m interface {}) error {
@@ -206,6 +67,12 @@ func (s *OsmanagementManagedInstanceDataSourceCrud) SetData() error {
20667
20768 s .D .SetId (* s .Res .Id )
20869
70+ if s .Res .Autonomous != nil {
71+ s .D .Set ("autonomous" , []interface {}{AutonomousSettingsToMap (s .Res .Autonomous )})
72+ } else {
73+ s .D .Set ("autonomous" , nil )
74+ }
75+
20976 if s .Res .BugUpdatesAvailable != nil {
21077 s .D .Set ("bug_updates_available" , * s .Res .BugUpdatesAvailable )
21178 }
@@ -232,10 +99,18 @@ func (s *OsmanagementManagedInstanceDataSourceCrud) SetData() error {
23299 s .D .Set ("enhancement_updates_available" , * s .Res .EnhancementUpdatesAvailable )
233100 }
234101
102+ if s .Res .IsDataCollectionAuthorized != nil {
103+ s .D .Set ("is_data_collection_authorized" , * s .Res .IsDataCollectionAuthorized )
104+ }
105+
235106 if s .Res .IsRebootRequired != nil {
236107 s .D .Set ("is_reboot_required" , * s .Res .IsRebootRequired )
237108 }
238109
110+ if s .Res .KspliceEffectiveKernelVersion != nil {
111+ s .D .Set ("ksplice_effective_kernel_version" , * s .Res .KspliceEffectiveKernelVersion )
112+ }
113+
239114 if s .Res .LastBoot != nil {
240115 s .D .Set ("last_boot" , * s .Res .LastBoot )
241116 }
@@ -250,6 +125,10 @@ func (s *OsmanagementManagedInstanceDataSourceCrud) SetData() error {
250125 }
251126 s .D .Set ("managed_instance_groups" , managedInstanceGroups )
252127
128+ if s .Res .NotificationTopicId != nil {
129+ s .D .Set ("notification_topic_id" , * s .Res .NotificationTopicId )
130+ }
131+
253132 s .D .Set ("os_family" , s .Res .OsFamily )
254133
255134 if s .Res .OsKernelVersion != nil {
0 commit comments