Skip to content

Commit 475613e

Browse files
Tom O'Shaughnessyjotruon
authored andcommitted
Added - Support for GGS Storage Utilization properties
1 parent eaead10 commit 475613e

File tree

6 files changed

+48
-6
lines changed

6 files changed

+48
-6
lines changed

internal/integrationtest/golden_gate_deployment_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,20 +265,22 @@ func TestGoldenGateDeploymentResource_basic(t *testing.T) {
265265
resource.TestCheckResourceAttr(singularDatasourceName, "is_auto_scaling_enabled", "false"),
266266
resource.TestCheckResourceAttrSet(singularDatasourceName, "is_healthy"),
267267
resource.TestCheckResourceAttrSet(singularDatasourceName, "is_latest_version"),
268-
resource.TestCheckResourceAttr(singularDatasourceName, "is_public", "false"),
268+
resource.TestCheckResourceAttrSet(singularDatasourceName, "is_public"),
269+
resource.TestCheckResourceAttrSet(singularDatasourceName, "is_storage_utilization_limit_exceeded"),
269270
resource.TestCheckResourceAttr(singularDatasourceName, "license_model", "LICENSE_INCLUDED"),
270271
resource.TestCheckResourceAttr(singularDatasourceName, "ogg_data.#", "1"),
271272
resource.TestCheckResourceAttr(singularDatasourceName, "ogg_data.0.admin_username", "adminUsername2"),
272273
resource.TestCheckResourceAttrSet(singularDatasourceName, "ogg_data.0.certificate"),
273274
resource.TestCheckResourceAttrSet(singularDatasourceName, "private_ip_address"),
274275
resource.TestCheckResourceAttrSet(singularDatasourceName, "state"),
276+
resource.TestCheckResourceAttrSet(singularDatasourceName, "storage_utilization_in_bytes"),
275277
resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"),
276278
resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"),
277279
),
278280
},
279281
// verify resource import
280282
{
281-
Config: config + DeploymentRequiredOnlyResource,
283+
Config: config + DeploymentResourceConfig,
282284
ImportState: true,
283285
ImportStateVerify: true,
284286
ImportStateVerifyIgnore: []string{

internal/service/golden_gate/golden_gate_deployment_data_source.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package golden_gate
55

66
import (
77
"context"
8+
"strconv"
89

910
"github.com/terraform-providers/terraform-provider-oci/internal/client"
1011
"github.com/terraform-providers/terraform-provider-oci/internal/tfresource"
@@ -118,6 +119,10 @@ func (s *GoldenGateDeploymentDataSourceCrud) SetData() error {
118119
s.D.Set("is_public", *s.Res.IsPublic)
119120
}
120121

122+
if s.Res.IsStorageUtilizationLimitExceeded != nil {
123+
s.D.Set("is_storage_utilization_limit_exceeded", *s.Res.IsStorageUtilizationLimitExceeded)
124+
}
125+
121126
s.D.Set("license_model", s.Res.LicenseModel)
122127

123128
if s.Res.LifecycleDetails != nil {
@@ -144,6 +149,10 @@ func (s *GoldenGateDeploymentDataSourceCrud) SetData() error {
144149

145150
s.D.Set("state", s.Res.LifecycleState)
146151

152+
if s.Res.StorageUtilizationInBytes != nil {
153+
s.D.Set("storage_utilization_in_bytes", strconv.FormatInt(*s.Res.StorageUtilizationInBytes, 10))
154+
}
155+
147156
if s.Res.SubnetId != nil {
148157
s.D.Set("subnet_id", *s.Res.SubnetId)
149158
}

internal/service/golden_gate/golden_gate_deployment_resource.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"context"
88
"fmt"
99
"log"
10+
"strconv"
1011
"strings"
1112
"time"
1213

@@ -168,6 +169,10 @@ func GoldenGateDeploymentResource() *schema.Resource {
168169
Type: schema.TypeBool,
169170
Computed: true,
170171
},
172+
"is_storage_utilization_limit_exceeded": {
173+
Type: schema.TypeBool,
174+
Computed: true,
175+
},
171176
"lifecycle_details": {
172177
Type: schema.TypeString,
173178
Computed: true,
@@ -188,6 +193,10 @@ func GoldenGateDeploymentResource() *schema.Resource {
188193
Type: schema.TypeString,
189194
Computed: true,
190195
},
196+
"storage_utilization_in_bytes": {
197+
Type: schema.TypeString,
198+
Computed: true,
199+
},
191200
"system_tags": {
192201
Type: schema.TypeMap,
193202
Computed: true,
@@ -692,6 +701,10 @@ func (s *GoldenGateDeploymentResourceCrud) SetData() error {
692701
s.D.Set("is_public", *s.Res.IsPublic)
693702
}
694703

704+
if s.Res.IsStorageUtilizationLimitExceeded != nil {
705+
s.D.Set("is_storage_utilization_limit_exceeded", *s.Res.IsStorageUtilizationLimitExceeded)
706+
}
707+
695708
s.D.Set("license_model", s.Res.LicenseModel)
696709

697710
if s.Res.LifecycleDetails != nil {
@@ -722,6 +735,10 @@ func (s *GoldenGateDeploymentResourceCrud) SetData() error {
722735

723736
s.D.Set("state", s.Res.LifecycleState)
724737

738+
if s.Res.StorageUtilizationInBytes != nil {
739+
s.D.Set("storage_utilization_in_bytes", strconv.FormatInt(*s.Res.StorageUtilizationInBytes, 10))
740+
}
741+
725742
if s.Res.SubnetId != nil {
726743
s.D.Set("subnet_id", *s.Res.SubnetId)
727744
}
@@ -890,6 +907,10 @@ func GoldenGateDeploymentSummaryToMap(obj oci_golden_gate.DeploymentSummary) map
890907
result["is_public"] = bool(*obj.IsPublic)
891908
}
892909

910+
if obj.IsStorageUtilizationLimitExceeded != nil {
911+
result["is_storage_utilization_limit_exceeded"] = bool(*obj.IsStorageUtilizationLimitExceeded)
912+
}
913+
893914
result["license_model"] = string(obj.LicenseModel)
894915

895916
if obj.LifecycleDetails != nil {
@@ -908,6 +929,10 @@ func GoldenGateDeploymentSummaryToMap(obj oci_golden_gate.DeploymentSummary) map
908929

909930
result["state"] = string(obj.LifecycleState)
910931

932+
if obj.StorageUtilizationInBytes != nil {
933+
result["storage_utilization_in_bytes"] = strconv.FormatInt(*obj.StorageUtilizationInBytes, 10)
934+
}
935+
911936
if obj.SubnetId != nil {
912937
result["subnet_id"] = string(*obj.SubnetId)
913938
}

website/docs/d/golden_gate_deployment.html.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The following attributes are exported:
3737
* `cpu_core_count` - The Minimum number of OCPUs to be made available for this Deployment.
3838
* `defined_tags` - Tags defined for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
3939
* `deployment_backup_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup being referenced.
40-
* `deployment_type` - The type of deployment, the value determines the exact 'type' of service executed in the Deployment. NOTE: Use of the value OGG is maintained for backward compatibility purposes. Its use is discouraged in favor of the equivalent DATABASE_ORACLE value.
40+
* `deployment_type` - The deployment type.
4141
* `deployment_url` - The URL of a resource.
4242
* `description` - Metadata about this specific object.
4343
* `display_name` - An object's Display Name.
@@ -48,6 +48,7 @@ The following attributes are exported:
4848
* `is_healthy` - True if all of the aggregate resources are working correctly.
4949
* `is_latest_version` - Indicates if the resource is the the latest available version.
5050
* `is_public` - True if this object is publicly available.
51+
* `is_storage_utilization_limit_exceeded` - Indicator will be true if the amount of storage being utilized exceeds the allowable storage utilization limit. Exceeding the limit may be an indication of a misconfiguration of the deployment's GoldenGate service.
5152
* `license_model` - The Oracle license model that applies to a Deployment.
5253
* `lifecycle_details` - Describes the object's current state in detail. For example, it can be used to provide actionable information for a resource in a Failed state.
5354
* `lifecycle_sub_state` - Possible GGS lifecycle sub-states.
@@ -60,6 +61,7 @@ The following attributes are exported:
6061
* `private_ip_address` - The private IP address in the customer's VCN representing the access point for the associated endpoint service in the GoldenGate service VCN.
6162
* `public_ip_address` - The public IP address representing the access point for the Deployment.
6263
* `state` - Possible lifecycle states.
64+
* `storage_utilization_in_bytes` - The amount of storage being utilized (in bytes)
6365
* `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet being referenced.
6466
* `system_tags` - The system tags associated with this resource, if any. The system tags are set by Oracle Cloud Infrastructure services. Each key is predefined and scoped to namespaces. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{orcl-cloud: {free-tier-retain: true}}`
6567
* `time_created` - The time the resource was created. The format is defined by [RFC3339](https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`.

website/docs/d/golden_gate_deployments.html.markdown

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ The following attributes are exported:
5353
* `cpu_core_count` - The Minimum number of OCPUs to be made available for this Deployment.
5454
* `defined_tags` - Tags defined for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
5555
* `deployment_backup_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup being referenced.
56-
* `deployment_type` - The type of deployment, the value determines the exact 'type' of service executed in the Deployment. NOTE: Use of the value OGG is maintained for backward compatibility purposes. Its use is discouraged in favor of the equivalent DATABASE_ORACLE value.
56+
* `deployment_type` - The deployment type.
5757
* `deployment_url` - The URL of a resource.
5858
* `description` - Metadata about this specific object.
5959
* `display_name` - An object's Display Name.
@@ -64,6 +64,7 @@ The following attributes are exported:
6464
* `is_healthy` - True if all of the aggregate resources are working correctly.
6565
* `is_latest_version` - Indicates if the resource is the the latest available version.
6666
* `is_public` - True if this object is publicly available.
67+
* `is_storage_utilization_limit_exceeded` - Indicator will be true if the amount of storage being utilized exceeds the allowable storage utilization limit. Exceeding the limit may be an indication of a misconfiguration of the deployment's GoldenGate service.
6768
* `license_model` - The Oracle license model that applies to a Deployment.
6869
* `lifecycle_details` - Describes the object's current state in detail. For example, it can be used to provide actionable information for a resource in a Failed state.
6970
* `lifecycle_sub_state` - Possible GGS lifecycle sub-states.
@@ -76,6 +77,7 @@ The following attributes are exported:
7677
* `private_ip_address` - The private IP address in the customer's VCN representing the access point for the associated endpoint service in the GoldenGate service VCN.
7778
* `public_ip_address` - The public IP address representing the access point for the Deployment.
7879
* `state` - Possible lifecycle states.
80+
* `storage_utilization_in_bytes` - The amount of storage being utilized (in bytes)
7981
* `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet being referenced.
8082
* `system_tags` - The system tags associated with this resource, if any. The system tags are set by Oracle Cloud Infrastructure services. Each key is predefined and scoped to namespaces. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{orcl-cloud: {free-tier-retain: true}}`
8183
* `time_created` - The time the resource was created. The format is defined by [RFC3339](https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`.

website/docs/r/golden_gate_deployment.html.markdown

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The following arguments are supported:
5555
* `cpu_core_count` - (Required) (Updatable) The Minimum number of OCPUs to be made available for this Deployment.
5656
* `defined_tags` - (Optional) (Updatable) Tags defined for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
5757
* `deployment_backup_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup being referenced.
58-
* `deployment_type` - (Required) The type of deployment, the value determines the exact 'type' of service executed in the Deployment. NOTE: Use of the value OGG is maintained for backward compatibility purposes. Its use is discouraged in favor of the equivalent DATABASE_ORACLE value.
58+
* `deployment_type` - (Required) The deployment type.
5959
* `description` - (Optional) (Updatable) Metadata about this specific object.
6060
* `display_name` - (Required) (Updatable) An object's Display Name.
6161
* `fqdn` - (Optional) (Updatable) A three-label Fully Qualified Domain Name (FQDN) for a resource.
@@ -84,7 +84,7 @@ The following attributes are exported:
8484
* `cpu_core_count` - The Minimum number of OCPUs to be made available for this Deployment.
8585
* `defined_tags` - Tags defined for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}`
8686
* `deployment_backup_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup being referenced.
87-
* `deployment_type` - The type of deployment, the value determines the exact 'type' of service executed in the Deployment. NOTE: Use of the value OGG is maintained for backward compatibility purposes. Its use is discouraged in favor of the equivalent DATABASE_ORACLE value.
87+
* `deployment_type` - The deployment type.
8888
* `deployment_url` - The URL of a resource.
8989
* `description` - Metadata about this specific object.
9090
* `display_name` - An object's Display Name.
@@ -95,6 +95,7 @@ The following attributes are exported:
9595
* `is_healthy` - True if all of the aggregate resources are working correctly.
9696
* `is_latest_version` - Indicates if the resource is the the latest available version.
9797
* `is_public` - True if this object is publicly available.
98+
* `is_storage_utilization_limit_exceeded` - Indicator will be true if the amount of storage being utilized exceeds the allowable storage utilization limit. Exceeding the limit may be an indication of a misconfiguration of the deployment's GoldenGate service.
9899
* `license_model` - The Oracle license model that applies to a Deployment.
99100
* `lifecycle_details` - Describes the object's current state in detail. For example, it can be used to provide actionable information for a resource in a Failed state.
100101
* `lifecycle_sub_state` - Possible GGS lifecycle sub-states.
@@ -107,6 +108,7 @@ The following attributes are exported:
107108
* `private_ip_address` - The private IP address in the customer's VCN representing the access point for the associated endpoint service in the GoldenGate service VCN.
108109
* `public_ip_address` - The public IP address representing the access point for the Deployment.
109110
* `state` - Possible lifecycle states.
111+
* `storage_utilization_in_bytes` - The amount of storage being utilized (in bytes)
110112
* `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet being referenced.
111113
* `system_tags` - The system tags associated with this resource, if any. The system tags are set by Oracle Cloud Infrastructure services. Each key is predefined and scoped to namespaces. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{orcl-cloud: {free-tier-retain: true}}`
112114
* `time_created` - The time the resource was created. The format is defined by [RFC3339](https://tools.ietf.org/html/rfc3339), such as `2016-08-25T21:10:29.600Z`.

0 commit comments

Comments
 (0)