Skip to content

Commit ef2cb8a

Browse files
srishtipmishragovindrao55
authored andcommitted
- Added - Support for ExaCC DOMU OS update
1 parent 4e5c4ac commit ef2cb8a

8 files changed

+44
-9
lines changed

oci/database_vm_cluster_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ func (s *DatabaseVmClusterDataSourceCrud) SetData() error {
131131

132132
s.D.Set("state", s.Res.LifecycleState)
133133

134+
if s.Res.SystemVersion != nil {
135+
s.D.Set("system_version", *s.Res.SystemVersion)
136+
}
137+
134138
if s.Res.TimeCreated != nil {
135139
s.D.Set("time_created", s.Res.TimeCreated.String())
136140
}

oci/database_vm_cluster_network_resource_test.go

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,23 @@ var (
3434
"dns": Representation{repType: Optional, create: []string{`192.168.10.10`}, update: []string{`192.168.10.12`}},
3535
"freeform_tags": Representation{repType: Optional, create: map[string]string{"Department": "Finance"}, update: map[string]string{"Department": "Accounting"}},
3636
"ntp": Representation{repType: Optional, create: []string{`192.168.10.20`}, update: []string{`192.168.10.22`}},
37-
"validate_vm_cluster_network": Representation{repType: Optional, create: "true"},
37+
"validate_vm_cluster_network": Representation{repType: Optional, create: "true", update: "true"},
38+
"lifecycle": RepresentationGroup{repType: Optional, group: vmClusterNetworkIgnoreChangesRepresentation},
39+
}
40+
vmClusterNetworkIgnoreChangesRepresentation = map[string]interface{}{
41+
"ignore_changes": Representation{repType: Required, create: []string{`validate_vm_cluster_network`}},
42+
}
43+
vmClusterNetworkValidateUpdateRepresentation = map[string]interface{}{
44+
"compartment_id": Representation{repType: Required, create: `${var.compartment_id}`},
45+
"display_name": Representation{repType: Required, create: `testVmClusterNw`},
46+
"exadata_infrastructure_id": Representation{repType: Required, create: `${oci_database_exadata_infrastructure.test_exadata_infrastructure.id}`},
47+
"scans": RepresentationGroup{Required, vmClusterNetworkScansRepresentation},
48+
"vm_networks": []RepresentationGroup{{Required, vmClusterNetworkBackupVmNetworkRepresentation}, {Required, vmClusterNetworkClientVmNetworkRepresentation}},
49+
"defined_tags": Representation{repType: Optional, create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
50+
"dns": Representation{repType: Optional, create: []string{`192.168.10.10`}, update: []string{`192.168.10.12`}},
51+
"freeform_tags": Representation{repType: Optional, create: map[string]string{"Department": "Finance"}, update: map[string]string{"Department": "Accounting"}},
52+
"ntp": Representation{repType: Optional, create: []string{`192.168.10.20`}, update: []string{`192.168.10.22`}},
53+
"validate_vm_cluster_network": Representation{repType: Optional, create: "true", update: "true"},
3854
}
3955

4056
VmClusterNetworkValidateResourceDependencies = DefinedTagsDependencies +
@@ -105,7 +121,7 @@ func TestResourceDatabaseVmClusterNetwork_basic(t *testing.T) {
105121
// verify create without validation
106122
{
107123
Config: config + compartmentIdVariableStr + VmClusterNetworkResourceDependencies +
108-
generateResourceFromRepresentationMap("oci_database_vm_cluster_network", "test_vm_cluster_network", Optional, Update,
124+
generateResourceFromRepresentationMap("oci_database_vm_cluster_network", "test_vm_cluster_network", Optional, Create,
109125
representationCopyWithRemovedProperties(vmClusterNetworkValidateRepresentation, []string{`validate_vm_cluster_network`})),
110126
Check: ComposeAggregateTestCheckFuncWrapper(
111127
resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId),
@@ -117,16 +133,16 @@ func TestResourceDatabaseVmClusterNetwork_basic(t *testing.T) {
117133
resource.TestCheckResourceAttr(resourceName, "ntp.#", "1"),
118134
resource.TestCheckResourceAttr(resourceName, "scans.#", "1"),
119135
CheckResourceSetContainsElementWithProperties(resourceName, "scans", map[string]string{
120-
"hostname": "myprefix2-ivmmj-scan",
136+
"hostname": "myprefix1-ivmmj-scan",
121137
"ips.#": "3",
122-
"port": "1522",
138+
"port": "1521",
123139
},
124140
[]string{}),
125141
resource.TestCheckResourceAttr(resourceName, "vm_networks.#", "2"),
126142
CheckResourceSetContainsElementWithProperties(resourceName, "vm_networks", map[string]string{
127143
"domain_name": "oracle.com",
128-
"gateway": "192.169.20.2",
129-
"netmask": "255.255.192.0",
144+
"gateway": "192.169.20.1",
145+
"netmask": "255.255.0.0",
130146
"network_type": "BACKUP",
131147
"nodes.#": "2",
132148
},
@@ -144,8 +160,8 @@ func TestResourceDatabaseVmClusterNetwork_basic(t *testing.T) {
144160
// verify validation
145161
{
146162
Config: config + compartmentIdVariableStr + VmClusterNetworkResourceDependencies +
147-
generateResourceFromRepresentationMap("oci_database_vm_cluster_network", "test_vm_cluster_network", Optional, Update, vmClusterNetworkValidateRepresentation),
148-
Check: ComposeAggregateTestCheckFuncWrapper(
163+
generateResourceFromRepresentationMap("oci_database_vm_cluster_network", "test_vm_cluster_network", Optional, Update, vmClusterNetworkValidateUpdateRepresentation),
164+
Check: resource.ComposeAggregateTestCheckFunc(
149165
resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId),
150166
resource.TestCheckResourceAttr(resourceName, "defined_tags.%", "1"),
151167
resource.TestCheckResourceAttr(resourceName, "display_name", "testVmClusterNw"),

oci/database_vm_cluster_resource.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ func DatabaseVmClusterResource() *schema.Resource {
139139
Type: schema.TypeString,
140140
Computed: true,
141141
},
142+
"system_version": {
143+
Type: schema.TypeString,
144+
Computed: true,
145+
},
142146
"time_created": {
143147
Type: schema.TypeString,
144148
Computed: true,
@@ -511,6 +515,10 @@ func (s *DatabaseVmClusterResourceCrud) SetData() error {
511515

512516
s.D.Set("state", s.Res.LifecycleState)
513517

518+
if s.Res.SystemVersion != nil {
519+
s.D.Set("system_version", *s.Res.SystemVersion)
520+
}
521+
514522
if s.Res.TimeCreated != nil {
515523
s.D.Set("time_created", s.Res.TimeCreated.String())
516524
}

oci/database_vm_cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func TestDatabaseVmClusterResource_basic(t *testing.T) {
113113

114114
// delete before next create
115115
{
116-
Config: config + compartmentIdVariableStr + VmClusterResourceDependencies,
116+
Config: config + compartmentIdVariableStr,
117117
},
118118
//verify create with optionals
119119
{

oci/database_vm_clusters_data_source.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ func (s *DatabaseVmClustersDataSourceCrud) SetData() error {
185185

186186
vmCluster["state"] = r.LifecycleState
187187

188+
if r.SystemVersion != nil {
189+
vmCluster["system_version"] = *r.SystemVersion
190+
}
191+
188192
if r.TimeCreated != nil {
189193
vmCluster["time_created"] = r.TimeCreated.String()
190194
}

website/docs/d/database_vm_cluster.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ The following attributes are exported:
5252
* `shape` - The shape of the Exadata infrastructure. The shape determines the amount of CPU, storage, and memory resources allocated to the instance.
5353
* `ssh_public_keys` - The public key portion of one or more key pairs used for SSH access to the VM cluster.
5454
* `state` - The current state of the VM cluster.
55+
* `system_version` - Operating system version of the image.
5556
* `time_created` - The date and time that the VM cluster was created.
5657
* `time_zone` - The time zone of the Exadata infrastructure. For details, see [Exadata Infrastructure Time Zones](https://docs.cloud.oracle.com/iaas/Content/Database/References/timezones.htm).
5758
* `vm_cluster_network_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM cluster network.

website/docs/d/database_vm_clusters.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ The following attributes are exported:
6767
* `shape` - The shape of the Exadata infrastructure. The shape determines the amount of CPU, storage, and memory resources allocated to the instance.
6868
* `ssh_public_keys` - The public key portion of one or more key pairs used for SSH access to the VM cluster.
6969
* `state` - The current state of the VM cluster.
70+
* `system_version` - Operating system version of the image.
7071
* `time_created` - The date and time that the VM cluster was created.
7172
* `time_zone` - The time zone of the Exadata infrastructure. For details, see [Exadata Infrastructure Time Zones](https://docs.cloud.oracle.com/iaas/Content/Database/References/timezones.htm).
7273
* `vm_cluster_network_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM cluster network.

website/docs/r/database_vm_cluster.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ The following attributes are exported:
8787
* `shape` - The shape of the Exadata infrastructure. The shape determines the amount of CPU, storage, and memory resources allocated to the instance.
8888
* `ssh_public_keys` - The public key portion of one or more key pairs used for SSH access to the VM cluster.
8989
* `state` - The current state of the VM cluster.
90+
* `system_version` - Operating system version of the image.
9091
* `time_created` - The date and time that the VM cluster was created.
9192
* `time_zone` - The time zone of the Exadata infrastructure. For details, see [Exadata Infrastructure Time Zones](https://docs.cloud.oracle.com/iaas/Content/Database/References/timezones.htm).
9293
* `vm_cluster_network_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM cluster network.

0 commit comments

Comments
 (0)